Jail Timing System.
#1

Hello!

I want to make the Jail Timing System like that:



And If the Player Time over in Jail then he should release from the Jail. I made already /jail and /unjail CMD. Just now I want a Timer in seconds...as shown in Above Figure.
Reply
#2

You have been already given about how to show the time left. You only need to create the textdraw, a timer to display the time and then killing the timer when the player gets unjailed.
Reply
#3

Please can you again repeat it? And Can you make it for me? Please?
Reply
#4

Sorry but have to Bump?
Reply
#5

Just Update The TextDraw Time With Giving The Seconds as "playertimevar--;" which means it will reduce the players current time by 1 . Put the code in a timer , set it when the player is jailed and keep the Repeating to 1 so that it repeats When the Players Jail time reaches 0 Kill that timer in itself

Example:

pawn Код:
//TimerVar

new JailTimer[MAX_PLAYERS];

//Put This where You have the jail command or auto jail or something..
//if it gives the error that player1 is undefined symbol just replace player1 by the var you have in your /jail //command
JailTimer[playerid] = SetTimerEx("UpdateJailTime",1000,1,"d",player1);

forward UpdateJailTime(playerid);
public UpdateJailTime(playerid)
{
    if(pInfo[playerid][JailTime] != 0)
    {
         pInfo[playerid][JailTime]--; //Will reduce jail time by 1
         new string[256];
         format(string,sizeof(string),"~w~Time:~n~~y~%d",pInfo[playerid][JailTime]);
         TextDrawSetString(textdraw,string);
    }
    else
    {
         KillTimer(JailTimer[playerid]);
         TextDrawHideForPlayer(playerid,textdraw);
     }
     return 1;
}
Dont Forget to replace pInfo[playerid][JailTime] by players jail time.

Set The Jailtime to 500 seconds on jail like

pawn Код:
pInfo[playerid][JailTime] = 500;
Reply
#6

Your pos just like wazadmin and jakadmin @@

Use textdraw....

SYSTEM: iPLEOMAX's TEXTDRAW editor, Zamaroth Textdraw Editor,...
Reply
#7

Thanks! But I want that Player should be jailed for that seconds which I selected like: /ajail <playerid> <seconds>

so I select seconds for players not just for 500 seconds.

OK I applied what you said now see I am getting few errors here:

pawn Код:
forward UpdateJailTime(playerid);
public UpdateJailTime(playerid)
{
    if(pInfo[playerid][JailTime] != 0) //Line 894
    {
         pInfo[playerid][JailTime]--; //Will reduce jail time by 1 // Line 896
         new string[256];
         format(string,sizeof(string),"~w~Time:~n~~y~%d",pInfo[playerid][JailTime]); //Line 898
         TextDrawSetString(textdraw,string); //Line 899
    }
    else
    {
         KillTimer(JailTimer[playerid]);
         TextDrawHideForPlayer(playerid,textdraw); //Line 904
    }
    return 1;
}
Errors:
pawn Код:
E:\Scritping\gamemodes\Gamemode.pwn(894) : error 017: undefined symbol "JailTime"
E:\Scritping\gamemodes\Gamemode.pwn(896) : error 017: undefined symbol "JailTime"
E:\Scritping\gamemodes\Gamemode.pwn(898) : error 017: undefined symbol "JailTime"
E:\Scritping\gamemodes\Gamemode.pwn(899) : error 017: undefined symbol "textdraw"
E:\Scritping\gamemodes\Gamemode.pwn(904) : error 017: undefined symbol "textdraw"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Reply
#8

Quote:
Originally Posted by MAFIAWARS
Посмотреть сообщение
Thanks! But I want that Player should be jailed for that seconds which I selected like: /ajail <playerid> <seconds>

so I select seconds for players not just for 500 seconds.

OK I applied what you said now see I am getting few errors here:

pawn Код:
forward UpdateJailTime(playerid);
public UpdateJailTime(playerid)
{
    if(pInfo[playerid][JailTime] != 0) //Line 894
    {
         pInfo[playerid][JailTime]--; //Will reduce jail time by 1 // Line 896
         new string[256];
         format(string,sizeof(string),"~w~Time:~n~~y~%d",pInfo[playerid][JailTime]); //Line 898
         TextDrawSetString(textdraw,string); //Line 899
    }
    else
    {
         KillTimer(JailTimer[playerid]);
         TextDrawHideForPlayer(playerid,textdraw); //Line 904
    }
    return 1;
}
Errors:
pawn Код:
E:\Scritping\gamemodes\Gamemode.pwn(894) : error 017: undefined symbol "JailTime"
E:\Scritping\gamemodes\Gamemode.pwn(896) : error 017: undefined symbol "JailTime"
E:\Scritping\gamemodes\Gamemode.pwn(898) : error 017: undefined symbol "JailTime"
E:\Scritping\gamemodes\Gamemode.pwn(899) : error 017: undefined symbol "textdraw"
E:\Scritping\gamemodes\Gamemode.pwn(904) : error 017: undefined symbol "textdraw"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
like i said , The "textdraw" just replace with the var you have for your textdraw and , "jailtime" you need to specify it in the enumeration "Jailtime" and set it 0 When player connects , If you still dont understand it just give me your code here i will fix it..

As Far as your Jailtime is concerned set the jailtime to the var you set for timing the jail
For Example:-
pawn Код:
// here time is in /ajail <playerid> <time>
//Replace the "time" thing with your var

pInfo[playerid][JailTime] = time;
Reply
#9

I don't have any var of TextDraw in my Gamemode :3
Reply
#10

BUmp sryyyyyyyyyyyy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)