Posts: 484
Threads: 189
Joined: Jun 2016
Reputation:
0
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?
Posts: 349
Threads: 38
Joined: Jul 2015
Reputation:
0
Save the player's remaining jail time in your saving system.
Posts: 802
Threads: 41
Joined: Oct 2014
Reputation:
0
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
Posts: 484
Threads: 189
Joined: Jun 2016
Reputation:
0
is that ok ?
stock LoginPlayer(playerid)
{
PlayerInfo[playerid][Jailed] = 1;
return 1;
}
Posts: 802
Threads: 41
Joined: Oct 2014
Reputation:
0
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);
Posts: 484
Threads: 189
Joined: Jun 2016
Reputation:
0
But i want when player jailed and he left he will be jailed again unit time expire ;/
Posts: 802
Threads: 41
Joined: Oct 2014
Reputation:
0
Use settimerex + callbacks
Posts: 355
Threads: 40
Joined: Dec 2012
Reputation:
0
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.