Jail Time
#7

thanks all and here is my jail command.

pawn Код:
CMD:jail(playerid,params[])
{
    new targetid,reason[50],string[128],minutes;
    if(!IsPlayerAdmin(playerid)) return 0;
    if(sscanf(params, "uds[50]", targetid, minutes, reason))return SendClientMessage(playerid, COLOR_WHITE, "/jail [playerid/name] [time in minutes] [reason]");
    if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, COLOR_WHITE, "Error: This player is not connected.");
    if(Spawned[targetid] == 0) return SendClientMessage(playerid,COLOR_WHITE,"Error: This Player Is Not Spawned.");
    if(PlayerInfo[targetid][pJailed] == 1) return SendClientMessage(playerid,COLOR_WHITE,"Error: This player is already in jail.");
    else
    {
        new calc = minutes*60;
        PlayerInfo[targetid][pJailTime] = calc;
        PlayerInfo[targetid][pAdminJailed] = 1;
        ResetPlayerWeapons(targetid);
        SetPlayerScore(targetid,GetPlayerScore(targetid)-1);
        GameTextForPlayer(targetid,"~r~JAILED!",7000,4);
        PutPlayerInJail(targetid);
        format(string, sizeof(string), "%s(%d) has been Jailed by an Administrator - Reason: %s", GetName(targetid), targetid, reason);
        SendClientMessageToAll(COLOR_WHITE,string);
        Releaser[targetid] = SetTimerEx("JailTime",calc*1000, false, "i", targetid);
    }
    return 1;
}
Reply


Messages In This Thread
Jail Time - by AnonScripter - 15.12.2013, 13:12
Re: Jail Time - by Dawno - 15.12.2013, 13:25
Re: Jail Time - by AnonScripter - 15.12.2013, 13:34
Re: Jail Time - by SilentSoul - 15.12.2013, 13:36
Re: Jail Time - by Jankingston - 15.12.2013, 13:41
Re: Jail Time - by erminpr0 - 15.12.2013, 14:11
Re: Jail Time - by AnonScripter - 15.12.2013, 14:27
Re: Jail Time - by SilentSoul - 15.12.2013, 14:33
Re: Jail Time - by AnonScripter - 15.12.2013, 15:42

Forum Jump:


Users browsing this thread: 2 Guest(s)