04.03.2011, 13:42
I would do it this way
Код:
CMD:cuff(playerid, params[]) { new targetid; new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); if(sscanf(params, "U", targetid)) SendClientMessage(playerid,RED, "USAGE: /cuff [id]"); else if(gTeam[playerid] != CLASS_COPS) SendClientMessage(playerid, RED,"Only Cops Can Cuff People!"); else if(targetid == playerid) SendClientMessage(playerid, RED, "You Cant Cuff Yourself!"); else if(!ProxDetectorS(7.5, playerid, targetid)) SendClientMessage(playerid, RED, "The Player Is Not Close Enough!"); else if(GetPlayerWantedLevel(targetid) < 4) SendClientMessage(playerid, RED, "That Player Is Not Wanted!"); else if(IsPlayerInAnyVehicle(targetid) && IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, RED, "You Cant Cuff Players Through Vehicles!"); else if(gTeam[targetid] == CLASS_COPS || gTeam[targetid] == CLASS_MEDIC) SendClientMessage(playerid, RED, "You Cant Cuff Other Cops Or Medics!"); else { GameTextForPlayer(targetid, "\n\n\n~r~Cuffed!", 2500, 5); GameTextForPlayer(playerid, "\n\n\n~g~Suspect Cuffed!", 2500, 5); TogglePlayerControllable(targetid, false); } return true; }