Jail system
#2

Quote:
Originally Posted by Lirbo
Посмотреть сообщение
how to make jail system with countdown?
pawn Код:
CMD:jail(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] == 0) return SendClientMessage(playerid,-1,"You are not admin to use this command!");
     new targetid, minutes,id,reason;
      if(sscanf(params, "ris[30]", targetid, minutes)) return SendClientMessage(playerid, -1,"[System Usage]: /jail [playerid] [minutes] [reason]");
       if(minutes <= 0 || minutes > 60) return SendClientMessage(playerid, -1, "Minutes can't be less than 0 or more than 60!");
       new str[300];
       format(str, sizeof(str), "{00FFE5}Jail |{FFFFFF} Administrator %s has jailed %s for %d |{00FFE5} reason : %s", GetPlayerNameEx(playerid), GetPlayerNameEx(id), minutes,reason);
       SendClientMessageToAll(-1,str);
       JailTimer[targetid] = SetTimer("Unjail", minutes*60*1000, false);
    SetPlayerPos(targetid, 264.4176, 77.8930, 1001.0391);
    SetPlayerInterior(playerid, 6);
    inJail[targetid] = true;
    GameTextForPlayer(playerid, "~p~JAILED", 10000, 6);
    PlayerPlaySound(targetid,1057,0.0,0.0,0.0);
    return 1;
}
forward Unjail(playerid);
public Unjail(playerid)  
{
    SpawnPlayer(playerid);  
    SetPlayerInterior(playerid, 0);  
    inJail[playerid] = false;  
    KillTimer(JailTimer[playerid]);  
    GameTextForPlayer(playerid, "~g~Unjailed", 5000, 6);  
    PlayerPlaySound(playerid,1057,0.0,0.0,0.0);  
}
you got luck i got it already in my mod so i copy it from the pawn
Reply


Messages In This Thread
Jail system - by Lirbo - 13.05.2014, 19:41
Re: Jail system - by salev13 - 13.05.2014, 19:43
Re: Jail system - by gekas - 13.05.2014, 20:24
Re: Jail system - by Aerotactics - 13.05.2014, 23:07
Re: Jail system - by Lirbo - 14.05.2014, 04:34

Forum Jump:


Users browsing this thread: 1 Guest(s)