25.02.2009, 22:47
ok so i finished scripting a /arrest cmd but its not working, can someone plz fix it, or tell me whats wrorng, thanks
pawn Код:
if(strcmp("/arrest", cmdtext, true, 7) == 0)
{
if(gTeam[playerid] != TEAM_COP) return SendClientMessage(playerid, COLOR_RED, "You Are Not A Cop. Only Cops Can Use This Command.");
if(strlen(cmdtext[8]) == playerid) return SendClientMessage(playerid,COLOR_RED,"You Cannot Arrest Yourself, Idoit.");
if(strlen(cmdtext[8]) == 0){
new closest[MAX_PLAYERS];
new closestlvl;
closest[playerid] = GetClosestPlayer(1);
closestlvl = GetPlayerWantedLevel(closest[playerid]);
if(closestlvl >= 4)
{
new copname[MAX_PLAYER_NAME];
new cmdname[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, copname, sizeof(cmdname));
GetPlayerName(strval(cmdtext[8]), cmdname, sizeof(cmdname));
format(string, sizeof(string), "%s (%d) Has Been Arested By Officer %s (%d)", cmdname,strval(cmdtext[8]),copname,playerid);
SendClientMessageToAll(COLOR_PURPLE, string);
new rand;
rand = random(sizeof(AJail));
SetPlayerInterior(strval(cmdtext[8]), 3);
SetPlayerPos(strval(cmdtext[8]), AJail[rand][0], AJail[rand][1], AJail[rand][2]);
gPlayerJailed[playerid] = 1;
SetPlayerWantedLevel(strval(cmdtext[8]),0);
return 1;
} else return SendClientMessage(playerid,COLOR_RED,"No Wanted Players Close Enough TO Arrest.");
}
return 1;
}