Jail count down gametext
#1

hi again, i was asking for jail tutorail and i create one , now i have a question about how to make count down gametext for the left jail time
my commands
PHP код:
CMD:jail(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdminLevel] == 0) return SendClientMessage(playerid,-1,"You are not admin to use this command!");
     new 
targetidminutes,id,reason;
      if(
sscanf(params"ris[30]"targetidminutes)) return SendClientMessage(playerid, -1,"[System Usage]: /jail [playerid] [minutes] [reason]");
       if(
minutes <= || minutes 60) return SendClientMessage(playerid, -1"Minutes can't be less than 0 or more than 60!");
       new 
str[300];
       
format(strsizeof(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*1000false);
    
SetPlayerPos(targetid264.417677.89301001.0391);
    
SetPlayerInterior(playerid6);
    
inJail[targetid] = true;
    
GameTextForPlayer(playerid"~p~JAILED"100006);
    
PlayerPlaySound(targetid,1057,0.0,0.0,0.0);
    return 
1;
}
forward Unjail(playerid);
public 
Unjail(playerid
{
    
SpawnPlayer(playerid); 
    
SetPlayerInterior(playerid0); 
    
inJail[playerid] = false
    
KillTimer(JailTimer[playerid]); 
    
GameTextForPlayer(playerid"~g~Unjailed"50006); 
    
PlayerPlaySound(playerid,1057,0.0,0.0,0.0); 

also i use Y_INI if someone would like to help me to save the jail time when player dissconect it will be very good

Sorry i am new to scripting 3 days ago thx
Reply
#2

pawn Код:
new time[20];
 Unjail[playerid]--;
 if(Unjail[playerid] > 0)
 {
 format(time,sizeof(time),"Jailtime: %d",Unjail[playerid]);
 GameTextForPlayer(playerid,time,500,3);
 }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)