GetClosestPlayer
#2

indention ? :S

pawn Код:
if(strcmp(cmd, "/ar", true) == 0 || strcmp(cmd, "/arrest", true) == 0) {
    if(Spawned[playerid] == 0)
        return SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
    else if(gTeam[playerid] != TEAM_POLICE && gTeam[playerid] != TEAM_ARMY)
        return SendClientMessage(playerid,COLOR_ERROR,"You are not a Law Enforcement officer ");
    else if(Jailed[playerid] == 1)
        return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in jail");
    else if( (tmp = strtok(cmdtext, idx))[0] != EOS) {
        if(!IsNumeric(tmp)) return SendClientMessage(playerid, COLOR_ERROR, "USAGE: /ar (id) - /arrest (id) ID Must be a number");
        else if(!IsPlayerConnected( (giveplayerid = strval(tmp)) )) {
            format(string, sizeof(string), "ID (%d) is not an active player", giveplayerid);
            return SendClientMessage(playerid, COLOR_ERROR, string);
        }
    }
    else    giveplayerid = GetClosestPlayer(playerid);
    //And the rest of your code
}
Like always, this is untested
Reply


Messages In This Thread
GetClosestPlayer - by Kyle - 23.12.2009, 16:34
Re: GetClosestPlayer - by Nero_3D - 23.12.2009, 17:06
Re: GetClosestPlayer - by Kyle - 23.12.2009, 21:07
Re: GetClosestPlayer - by Nero_3D - 24.12.2009, 00:08
Re: GetClosestPlayer - by Kyle - 24.12.2009, 08:57
Re: GetClosestPlayer - by Nero_3D - 24.12.2009, 14:00

Forum Jump:


Users browsing this thread: 1 Guest(s)