SA-MP Forums Archive
Jail system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Jail system (/showthread.php?tid=512984)



Jail system - Lirbo - 13.05.2014

how to make jail system with countdown?


Re: Jail system - salev13 - 13.05.2014

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


Re: Jail system - gekas - 13.05.2014

Yeah But this jail have bug.

I add this when i got jail he unjailed in second

He is Bug


Re: Jail system - Aerotactics - 13.05.2014

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


Re: Jail system - Lirbo - 14.05.2014

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?