29.12.2015, 04:16
Try to do something like this :
its not the full codes but you get my idea.
PHP код:
if(sscanf(params, "u", ID)) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[INFO]{FFFFFF}: /rob (Player Name/ID)");
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_ERROR,"Invalid ID. You cannot rob them");
if(IsSpawned[playerid] != 1) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You must be alive and spawned in order to be able to use this command.");
if(gTeam[playerid] < 9) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command with your class/skill.");
if(gTeam[playerid] == TEAM_STUNT) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command with your class/skill.");
if(gTeam[ID] == TEAM_STUNT) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command on stunters.");
if(GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot Rob someone while in an Interior");
if(IsFrozen[playerid] == 1) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You have been frozen by a Server Administrator. You cannot use this command.");
if(InAdminMode[ID] == 1) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command on this player because they are in Administrator mode.");
if(IsKidnapped[playerid] >= 1)return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You are kidnapped. You cannot use this command.");
if(Away[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You can't rob someone while you are in AFK.");
if(Away[ID] == 1) return SendClientMessage(playerid, COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You can't rob someone while he is in AFK.");