Jail problem
#1

idk but guys Do you know how to do that,when i jail player he left server and re-join and he will be in jail unit time left?
Reply
#2

Save the player's remaining jail time in your saving system.
Reply
#3

new InJail[MAX_PLAYERS]

in your cmd add :
InJail[playerid] = 1

and on player spawn

if(InJail[playerid] == 0) return 0;
if(InJail[playerid] == 1)
{
SetPlayerInterior(playerid, jailint);
SetPlayerPos(playerid, x, y, z);
}

But if you will restart the server it wont save so batter use it with your saving system
Reply
#4

is that ok ?

stock LoginPlayer(playerid)
{

PlayerInfo[playerid][Jailed] = 1;
return 1;
}
Reply
#5

no i meant like this:

in your jail cmd:

new Ini:File = INI_Open(handle);
INI_WriteInt(File, "jail", 1);
INI_Close(File);

And when unjail:

new Ini:File = INI_Open(handle);
INI_WriteInt(File, "jail", 0);
INI_Close(File);
Reply
#6

But i want when player jailed and he left he will be jailed again unit time expire ;/
Reply
#7

Use settimerex + callbacks
Reply
#8

You will be needing a saving system. That may keep the value of jailed player to 1 or true(if its a bool) .
And, when player connects first you will need to clear the variables and booleans. Then fetch the jailed data/punishment data and save in that same variable
And then on player spawn you just check if player is jailed and if the value is 1 or true then teleport player to the jail coordinates. And voilб you just jailed player even after reconnecting to the server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)