01.06.2012, 12:15
My command:
Код:
CMD:arrest(playerid, params[])
{
if(PlayerInfo[playerid][Fmember] == 1)
{
new toplayer;
new jailtime;
new price;
if(!sscanf(params, "uii", toplayer, jailtime, price))
{
if((jailtime >= 1 && jailtime <= 10))
{
if(IsPlayerInRangeOfPoint(toplayer, 20.0, 221.9771, 121.3747, 999.0156))
{
if(IsPlayerInRangeOfPoint(playerid, 20.0, 221.9771, 121.3747, 999.0156))
{
new string[128];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(toplayer, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You are jailed for %d days by %s!", jailtime * 60000, name);
SCM(toplayer, COLOR_BLUE, string);
SetPlayerPos(toplayer, 219.3402, 110.0057, 999.0156);
SetPlayerInterior(toplayer, 10);
ResetPlayerWeapons(toplayer);
jailed[toplayer] = 1;
SetTimerEx("unjail", jailtime * 60000, false, "i", toplayer);
GivePlayerCash(toplayer, -price);
PlayerInfo[toplayer][Suspect] = sus_no;
SetPlayerColor(toplayer, COLOR_WHITE);
}
else return SendClientMessage(playerid, 0x2641FEAA, "You are not near the jail!");
}
else return SendClientMessage(playerid, 0x2641FEAA, "No suspect near the jail!");
}
else return SendClientMessage(playerid, 0x2641FEAA, "Jailtime cant be shorter then 1 or longer then 10");
}
else return SendClientMessage(playerid, 0x2641FEAA, "USAGE: /arrest [Playername] [JailTime] [price]");
}
else return SendClientMessage(playerid, 0x2641FEAA, "You are not a cop!");
return 1;
}

