dcmd_arrest

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo liebe Breadfische!


    dcmd_arrest(playerid,params[]){#pragma unused params{new pID;if(sscanf(params, "ud", pID)){ return SendClientMessage(playerid,COLOR_RED,"Benutzung: /arrest [Playerid]");}if(!IsPlayerConnected(pID)){ return SendClientMessage(playerid,COLOR_RED,"nobody with this ID");}if(GetDistanceBetweenPlayers(playerid,pID) > 10){return SendClientMessage(playerid, COLOR_GRAD1, "Der Spieler ist nicht in deiner Nähe!");} if(gTeam[pID] == 110) { return SendClientMessage(playerid, COLOR_GRAD1, "Cannot arrest Cops!");}if(WantedPoints[pID] == 0){return SendClientMessage(playerid, COLOR_GRAD1, " The Player doesn't have wanteds!"); } if(WantedPoints[pID] == 2) { SetPlayerPos(pID, 264.6288,77.5742,1001.0391); SetPlayerInterior(pID, 6); SetTimerEx("arresttimer", 10000, 0, "i", pID);new name[MAX_PLAYER_NAME], string[256]; GetPlayerName(pID, name, sizeof(name)); new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, sizeof(aname)); SendClientMessage(pID, COLOR_RED, "You are 10 seconds in Jail!"); format(string, sizeof(string), "[Arrested] Police Officer %s arrested %s. ", name, aname); SendClientMessageToAll(COLOR_RED, string); SetPlayerColor(pID, COLOR_WHITE); becomewanted[pID] = 0;} if(WantedPoints[pID] == 3) { SetPlayerPos(pID, 264.6288,77.5742,1001.0391); SetPlayerInterior(pID, 6); SetTimerEx("arresttimer", 30000, 0, "i", pID);new name[MAX_PLAYER_NAME], string[256]; GetPlayerName(pID, name, sizeof(name)); new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, sizeof(aname)); SendClientMessage(pID, COLOR_RED, "You are 30 seconds in Jail!"); format(string, sizeof(string), "[Arrested] Police Officer %s arrested %s. ", name, aname); SendClientMessageToAll(COLOR_RED, string); SetPlayerColor(pID, COLOR_WHITE); becomewanted[pID] = 0;} if(WantedPoints[pID] == 4) { SetPlayerPos(pID, 264.6288,77.5742,1001.0391); SetPlayerInterior(pID, 6); SetTimerEx("arresttimer", 55000, 0, "i", pID);new name[MAX_PLAYER_NAME], string[256]; GetPlayerName(pID, name, sizeof(name)); new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, sizeof(aname)); SendClientMessage(pID, COLOR_RED, "You are 55 seconds in Jail!"); format(string, sizeof(string), "[Arrested] Police Officer %s arrested %s. ", name, aname); SendClientMessageToAll(COLOR_RED, string); SetPlayerColor(pID, COLOR_WHITE); becomewanted[pID] = 0;} if(WantedPoints[pID] == 5) { SetPlayerPos(pID, 264.6288,77.5742,1001.0391); SetPlayerInterior(pID, 6); SetTimerEx("arresttimer", 18000, 0, "i", pID);new name[MAX_PLAYER_NAME], string[256]; GetPlayerName(pID, name, sizeof(name)); new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, sizeof(aname)); SendClientMessage(pID, COLOR_RED, "You are 180 seconds in Jail!"); format(string, sizeof(string), "[Arrested] Police Officer %s arrested %s. ", name, aname); SendClientMessageToAll(COLOR_RED, string); SetPlayerColor(pID, COLOR_WHITE); becomewanted[pID] = 0;} if(WantedPoints[pID] == 6) { SetPlayerPos(pID, 264.6288,77.5742,1001.0391); SetPlayerInterior(pID, 6); SetTimerEx("arresttimer", 120000, 0, "i", pID);new name[MAX_PLAYER_NAME], string[256]; GetPlayerName(pID, name, sizeof(name)); new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, sizeof(aname)); SendClientMessage(pID, COLOR_RED, "You are 2 minutes in Jail!"); format(string, sizeof(string), "[Arrested] Police Officer %s arrested %s. ", name, aname); SendClientMessageToAll(COLOR_RED, string); SetPlayerColor(pID, COLOR_WHITE); becomewanted[pID] = 0;}


    if(gTeam[pID] == 110) { return SendClientMessage(playerid, COLOR_GRAD1, "Cannot arrest Cops!");} } return 1;}



    Hier vllt. übersichtlicher



    dcmd_arrest(playerid,params[])
    {
    #pragma unused params
    {
    new pID;
    if(sscanf(params, "ud", pID))
    {
    return SendClientMessage(playerid,COLOR_RED,"Benutzung: /arrest [Playerid]");
    }
    if(!IsPlayerConnected(pID))
    {
    return SendClientMessage(playerid,COLOR_RED,"nobody with this ID");
    }
    if(GetDistanceBetweenPlayers(playerid,pID) > 10)
    {
    return SendClientMessage(playerid, COLOR_GRAD1, "Der Spieler ist nicht in deiner Nähe!");
    }
    if(gTeam[pID] == 110) { return SendClientMessage(playerid, COLOR_GRAD1, "Cannot arrest Cops!");}
    if(WantedPoints[pID] == 0)
    {
    return SendClientMessage(playerid, COLOR_GRAD1, " The Player doesn't have wanteds!");
    }
    if(WantedPoints[pID] == 2)
    {
    SetPlayerPos(pID, 264.6288,77.5742,1001.0391);
    SetPlayerInterior(pID, 6);
    SetTimerEx("arresttimer", 10000, 0, "i", pID);
    new name[MAX_PLAYER_NAME], string[256];
    GetPlayerName(pID, name, sizeof(name));
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, sizeof(aname));
    SendClientMessage(pID, COLOR_RED, "You are 10 seconds in Jail!");
    format(string, sizeof(string), "[Arrested] Police Officer %s arrested %s. ", name, aname);
    SendClientMessageToAll(COLOR_RED, string);
    SetPlayerColor(pID, COLOR_WHITE);
    becomewanted[pID] = 0;
    }
    if(WantedPoints[pID] == 3)
    {
    SetPlayerPos(pID, 264.6288,77.5742,1001.0391);
    SetPlayerInterior(pID, 6);
    SetTimerEx("arresttimer", 30000, 0, "i", pID);
    new name[MAX_PLAYER_NAME], string[256];
    GetPlayerName(pID, name, sizeof(name));
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, sizeof(aname));
    SendClientMessage(pID, COLOR_RED, "You are 30 seconds in Jail!");
    format(string, sizeof(string), "[Arrested] Police Officer %s arrested %s. ", name, aname);
    SendClientMessageToAll(COLOR_RED, string);
    SetPlayerColor(pID, COLOR_WHITE);
    becomewanted[pID] = 0;
    }
    if(WantedPoints[pID] == 4)
    {
    SetPlayerPos(pID, 264.6288,77.5742,1001.0391);
    SetPlayerInterior(pID, 6);
    SetTimerEx("arresttimer", 55000, 0, "i", pID);
    new name[MAX_PLAYER_NAME], string[256];
    GetPlayerName(pID, name, sizeof(name));
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, sizeof(aname));
    SendClientMessage(pID, COLOR_RED, "You are 55 seconds in Jail!");
    format(string, sizeof(string), "[Arrested] Police Officer %s arrested %s. ", name, aname);
    SendClientMessageToAll(COLOR_RED, string);
    SetPlayerColor(pID, COLOR_WHITE);
    becomewanted[pID] = 0;
    }
    if(WantedPoints[pID] == 5)
    {
    SetPlayerPos(pID, 264.6288,77.5742,1001.0391);
    SetPlayerInterior(pID, 6);
    SetTimerEx("arresttimer", 18000, 0, "i", pID);
    new name[MAX_PLAYER_NAME], string[256];
    GetPlayerName(pID, name, sizeof(name));
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, sizeof(aname));
    SendClientMessage(pID, COLOR_RED, "You are 180 seconds in Jail!");
    format(string, sizeof(string), "[Arrested] Police Officer %s arrested %s. ", name, aname);
    SendClientMessageToAll(COLOR_RED, string);
    SetPlayerColor(pID, COLOR_WHITE);
    becomewanted[pID] = 0;
    }
    if(WantedPoints[pID] == 6)
    {
    SetPlayerPos(pID, 264.6288,77.5742,1001.0391);
    SetPlayerInterior(pID, 6);
    SetTimerEx("arresttimer", 120000, 0, "i", pID);
    new name[MAX_PLAYER_NAME], string[256];
    GetPlayerName(pID, name, sizeof(name));
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, sizeof(aname));
    SendClientMessage(pID, COLOR_RED, "You are 2 minutes in Jail!");
    format(string, sizeof(string), "[Arrested] Police Officer %s arrested %s. ", name, aname);
    SendClientMessageToAll(COLOR_RED, string);
    SetPlayerColor(pID, COLOR_WHITE);
    becomewanted[pID] = 0;
    }



    if(gTeam[pID] == 110) { return SendClientMessage(playerid, COLOR_GRAD1, "Cannot arrest Cops!");}
    }
    return 1;
    }






    Es gibt keine Warnings/Errors!
    Aber wenn ich jetzt /arrest [PlayerID] eingebe z.B. /arrest 0 dann steht da


    Benutzung: /arrest [PID]bla bla




    ich finde den Fehler nicht und wollte das hier mal gerne ansprechen und gucken ob ihr es wisst ;)

    Du brauchst eine Website?

    Du hast ein Layout angefertigt und willst es gecoded sehen?

    DANN SCHREIB MICH AN.

    Kostenlos und für euch.

  • Anstatt

    if(sscanf(params, "ud", pID))
    {
    return SendClientMessage(playerid,COLOR_RED,"Benutzung: /arrest [Playerid]");
    }

    nur

    if(sscanf(params, "d", pID))
    {
    return SendClientMessage(playerid,COLOR_RED,"Benutzung: /arrest [Playerid]");
    }


    Da du ja nur einen Wert hast bzw. brauchst.