Jail system
#1

how to make jail system with countdown?
Reply
#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
#3

Yeah But this jail have bug.

I add this when i got jail he unjailed in second

He is Bug
Reply
#4

Remember kids, go learn pawn before trying to edit someone else's work.
Reply
#5

Quote:
Originally Posted by salev13
Посмотреть сообщение
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
Thanks, but you can add GameText how much time left?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)