Players are unjailed after reconnect
#1

Hello there, I am using the LuxAdmin system and I've been trying to figure out how I can save the player's remaining jail time OnPlayerDisconnect and then load it back in OnPlayerConnect so I can put them back in jail for the remaining amount of time when they spawn after they reconnect. I've been searching for about an hour using SA:MP wiki and the forums but I've had no luck with that so that's why I am posting a new thread. +rep to the ones who will really help me!

P.S. Don't suggest me to create my own Admin system or find another
Reply
#2

Under OnPlayerSpawn(playerid)
Код:
	if(AccInfo[playerid][Jailed] == 1) {
	    SetTimerEx("JailPlayer",3000,0,"d",playerid);
		return SendClientMessage(playerid,red,"{F81414}|-{F3FF02} You cant escape your punishment. You Are Still In Jail -|");
	}
Edited.
Reply
#3

Quote:
Originally Posted by Mr.Faqahat
Посмотреть сообщение
Under OnPlayerSpawn(playerid)
Код:
	if(AccInfo[playerid][Jailed] == 1) {
	    SetTimerEx("JailPlayer",3000,0,"d",playerid);
		return SendClientMessage(playerid,red,"{F81414}|-{F3FF02} You cant escape your punishment. You Are Still In Jail -|");
	}
Edited.
That won't reput players in jail after reconnect to the server
Reply
#4

Quote:
Originally Posted by NickTaSpy
Посмотреть сообщение
That won't reput players in jail after reconnect to the server
Well, just add a "SetPlayerPos" line or Jail(playerid, 10000); (if you have an method for jailing players, just an example)
Reply
#5

I don't know how that system works. The firsts posts should be fine adding the teleports and jail command, but before that you have to figure a system to save the player stats, in special the jail status and set it to "VALUE" and update this "VALUE" when disconnecting the server.
Reply
#6

And which is the easiest way to save the remaining jail time/jail status into a file?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)