19.08.2009, 13:47
Heres the /ar command i have:
You can edit it a bit so it works for your GM Like the teams and such...Hope this helps
EDIT: Everytime i post a code, its make it not indented...so you will have loose indentation warnings...just fix them lol
Код:
if(!strcmp(cmd, "/ar", true))
{
if(gTeam[playerid] != TEAM_COP && gTeam[playerid] != TEAM_ARMY)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /ar [playerid]");
id = strval(tmp);
if(IsPlayerConnected(id) == 0) return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR]: The ID you have entered does not exist!");
if(id == playerid) return SendClientMessage(playerid, COLOR_GREY, "You cannot arrest yourself!");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Cannot use this while being in the Car!");
if(getdist(playerid,id) > CUFF/UNCUFF_DISTANCE) return SendClientMessage(playerid, COLOR_ERROR, "You are not close enough to that user");
Jailed[id] = 1;
ResetPlayerWeapons(playerid);
cd_sec = 120;
cd_timer = SetTimer("countdown", 999, 1);
SetPlayerInterior(id,3);
SetPlayerPos(id,198.3797,160.8905,1003.0300);
SetPlayerFacingAngle(id,177.0350);
SetCameraBehindPlayer(id);
GetPlayerName(id, oname, sizeof(oname));
format(string1, sizeof(string1), "You have arrested %s (id: %d)", oname, id);
SendClientMessage(playerid, COLOR_YELLOW, string1);
SendClientMessage(id, COLOR_YELLOW, "You have been sent to jail for your criminal acts");
format(string1, sizeof(string1), "%s has been arrested by %s", oname, pname);
print(string1);
return 1;
}
else return SendClientMessage(playerid, COLOR_LIME, "Only Law enforcement agents can use this command! ");
}
return 0;
}
EDIT: Everytime i post a code, its make it not indented...so you will have loose indentation warnings...just fix them lol
