[HELP] Unjail countdown
#2

pawn Код:
CMD:jail(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,0xFFFFFFFF,"");
    new targetid, time, reason[256];
    if(sscanf(params,"uis[50]", targetid, time, reason)) return SendClientMessage(playerid, 0xFFFFFFFF, "");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,0xFFFFFFFF,"");
    if(PlayerInfo[playerid][pAdmin] < 6 && PlayerInfo[targetid][pAdmin]  == 6) return SendClientMessage(playerid,0xFFFFFFFF,"");
    new string[128];
    format(string, sizeof(string), "",GetName(playerid), GetName(targetid), time);
    SendClientMessageToAll(0xCC000022, string);
    format(string, sizeof(string), "", reason);
    SendClientMessageToAll(0xCC000022, string);
    SetPlayerInterior(targetid, 6);
    SetPlayerPos(targetid,264.1800,77.5989,1001.0391);
    PlayerInfo[targetid][pJailed] = 1;
    PlayerInfo[targetid][pJailedTime] = time + 1;
    KillTimer(JailTime[targetid]);
    JailTime[targetid] = SetTimerEx("UpdateJailTime",1000,true,"d",targetid);
    return 1;
}

forward UpdateJailTime(playerid);
public UpdateJailTime(playerid)
{
    if(!IsPlayerConnected(playerid))
    {
        KillTimer(JailTime[playerid]);
        return 0;
    }

    if(--PlayerInfo[playerid][pJailedTime] < 1)
    {
        KillTimer(JailTime[playerid]);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid,1552.5085,-1675.7572,16.1953);
        GameTextForPlayer(playerid, "~w~BlahBlah~r~!", 3000, 6);
        PlayerInfo[playerid][pJailed] = 0;
        PlayerInfo[playerid][pJailedTime] = 0;
        return 1;
    }

    new str[20];
    format(str,sizeof(str),"~r~%d",PlayerInfo[playerid][pJailedTime]);
    GameTextForPlayer(playerid,str,1200,1);
    return 0;
}
Reply


Messages In This Thread
[HELP] Unjail countdown - by ThomasEvil - 03.06.2017, 22:52
Re: [HELP] Unjail countdown - by Jefff - 04.06.2017, 00:49
Re: [HELP] Unjail countdown - by ThomasEvil - 04.06.2017, 04:14
Re: [HELP] Unjail countdown - by silverms - 04.06.2017, 09:37
Re: [HELP] Unjail countdown - by Abagail - 04.06.2017, 15:24
Re: [HELP] Unjail countdown - by Jefff - 04.06.2017, 18:03
Re: [HELP] Unjail countdown - by ThomasEvil - 05.06.2017, 05:51
Re: [HELP] Unjail countdown - by ThomasEvil - 05.06.2017, 06:05
Re: [HELP] Unjail countdown - by UHPS - 05.06.2017, 06:14
Re: [HELP] Unjail countdown - by ThomasEvil - 05.06.2017, 06:30

Forum Jump:


Users browsing this thread: 2 Guest(s)