16.06.2012, 13:36
pawn Код:
dcmd_adjail(playerid,params[])
{
new string[128];
new ID;
new cmdtime;
new cmdreason[100];
if(sscanf(params, "ui", ID, cmdtime))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adjail (Player Name/ID) (Seconds) (Reason)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot jail them.");
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(IsSpawned[ID] != 1)
{
format(string,sizeof(string),"%s(%d) is not spawned. You cannot jail them.");
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
format(string,sizeof(string),"[ADMIN] Administrator has jailed %s(%d) to San Fierro Prison for %d seconds. (Reason: %s )",PlayerName(ID),ID,cmdtime,cmdreason);
SendClientMessageToAll(COLOR_ADMIN,string);
format(string,sizeof(string),"9[ADMIN] Administrator has jailed %s(%d) to San Fierro Prison for %d seconds. (Reason: %s )",PlayerName(ID),ID,cmdtime,cmdreason);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
//TextDraw
TextDrawShowForPlayer(ID,JailTimer[ID]);
//Others
ResetPlayerWeapons(ID);
new rnd = random(sizeof(JailSpawnPoints));
JailTime[ID] =cmdtime;
IsCuffed[ID] =0;
CuffTime[ID] =0;
TotalJailTime[ID] =cmdtime;
SetPlayerInterior(ID,10);
SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
TogglePlayerControllable(ID,1);
SetPlayerWantedLevel(ID,0);
SetPlayerToTeamColour(ID);
return 1;
}