Problem with jail
#5

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.

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;
}
Reply


Messages In This Thread
Problem with jail - by Ruffian - 09.09.2012, 15:24
Re: Problem with jail -.- - by AaronKillz - 09.09.2012, 15:27
Re: Problem with jail -.- - by antonio112 - 09.09.2012, 15:47
Re: Problem with jail -.- - by Ruffian - 09.09.2012, 15:56
Re: Problem with jail -.- - by Guitar - 09.09.2012, 15:59
Re: Problem with jail -.- - by antonio112 - 09.09.2012, 16:00
Re: Problem with jail -.- - by Ruffian - 09.09.2012, 16:00
Re: Problem with jail -.- - by antonio112 - 09.09.2012, 16:02
Re: Problem with jail -.- - by Ruffian - 09.09.2012, 16:03
Re: Problem with jail -.- - by antonio112 - 09.09.2012, 16:06

Forum Jump:


Users browsing this thread: 3 Guest(s)