Jailing person on Spawn
#1

Hey Guys i have this script that i someone leaves the server while in jail it saves that he is when he logs back in and if jail == 1 he is sent to jail and timer starts pleaze have a look and could u guys tell me whats wrong with it i cant find anything...

Код:
public OnPlayerSpawn(playerid)
{
       if(PlayerInfo[playerid][Jailed] == 1)
        {
	SetPlayerPos(playerid, 264.6288,77.5742,1001.0391);
	SetPlayerInterior(playerid, 6);
	TextDrawShowForPlayer(playerid,CountDownTD);
	JailTimer[playerid] = SetTimerEx("CountDown", 1000, true, "i", playerid);
        }
      return 1;
}
Reply
#2

Do you have a code that save jailing stats when the player get jailed?
Reply
#3

Do you saving your stats with dini or y_ini?
Reply
#4

Quote:
Originally Posted by DeMoX
Посмотреть сообщение
Do you have a code that save jailing stats when the player get jailed?
Yeah i do and ive tested it by /jail the player agian and if i /jail a player already in jail it tells me hes already in jail so thats how i know when i spawn i type /jail and it tells me hes in jail but really i spawn back from where i left off and timer does not show!!
Reply
#5

Quote:
Originally Posted by dEcooR
Посмотреть сообщение
Do you saving your stats with dini or y_ini?
I Save with Dini.
Reply
#6

So lets go onplayerdisconect

Код:
new file[64];
format(file,64,"your files/%s",PlayerName(playerid));
dini_IntSet(file,"Jailed",PlayerInfo[playerid][Jailed]);
and onplayerconnect

Код:
new file[64];
format(file,64,"your files/%s",PlayerName(playerid));
PlayerInfo[playerid][Jailed] = dini_Int(file,"Jailed");
Reply
#7

Quote:
Originally Posted by chubz
Посмотреть сообщение
I Save with Dini.
Quote:
Originally Posted by dEcooR
Посмотреть сообщение
So lets go onplayerdisconect

Код:
new file[64];
format(file,64,"your files/%s",PlayerName(playerid));
dini_IntSet(file,"Jailed",PlayerInfo[playerid][Jailed]);
and onplayerconnect

Код:
new file[64];
format(file,64,"your files/%s",PlayerName(playerid));
PlayerInfo[playerid][Jailed] = dini_Int(file,"Jailed");
yeah thats how ive done it but thats not a problem i test if it saves by typing /jail to the player id and it tells me hes already jailed meaning it does save and jailed already equals 1 when he spawns!
Reply
#8

HEYYYYYY guys Dont worry about it i fixed it ended up being an error with my stats when they were being loaded forgot to put in something THANKS SO MUCH for all your help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)