09.09.2012, 15:59
Here, I have made you commands for it, but they could be bugged -- I have tested them they work perfectly but who knows
- Try to make a command out of it.
- Try to make a command out of it.
pawn Код:
CMD:jailplayer(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 2) return SendClientMessage(playerid, COLOR_RED, "Error Occured: This command is only for admins.");
new targetid, sendername[MAX_PLAYER_NAME], string[128], reason[128], jailtime;
if(sscanf(params,"uis[128]", targetid, jailtime, reason)) return SendClientMessage(playerid, COLOR_RED,"[ADMIN] /jailplayer [PLAYERID/PLAYERNAME] JAILTIME REASON");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"That player is not connected to your server");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string),"%s has put you in jail. Offence:%s -- For about: %i minutes", sendername, reason, jailtime);
SendClientMessage(targetid, COLOR_GREEN, string);
format(string, sizeof(string),"%s has jailed %i, Reason: %s - For: %i minutes", sendername, targetid, reason, jailtime);
SendClientMessageToAll(COLOR_GREEN, string);
SetPlayerPos(targetid, 2131.507812,1600.818481,1008.359375);
SetPlayerInterior(targetid, 1);
PlayerInfo[targetid][pJailed] = 1;
print(string);
return 1;
}
CMD:unjailplayer(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 2) return SendClientMessage(playerid, COLOR_RED, "Error Occured: This command is only for admins.");
new targetid, sendername[MAX_PLAYER_NAME], string[128];
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_RED,"[ADMIN] /unjailplayer [PLAYERID/PLAYERNAME]");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string),"%s has set you free.", sendername);
SendClientMessage(targetid, COLOR_GREEN, string);
PlayerInfo[targetid][pJailed] = 0;
SetPlayerInterior(targetid, 0);
SpawnPlayer(targetid);
return 1;
}