Jailing person on Spawn - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Jailing person on Spawn (
/showthread.php?tid=455283)
Jailing person on Spawn -
chubz - 01.08.2013
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;
}
Re: Jailing person on Spawn -
DeMoX - 01.08.2013
Do you have a code that save jailing stats when the player get jailed?
Re: Jailing person on Spawn -
dEcooR - 01.08.2013
Do you saving your stats with dini or y_ini?
Re: Jailing person on Spawn -
chubz - 01.08.2013
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!!
Re: Jailing person on Spawn -
chubz - 01.08.2013
Quote:
Originally Posted by dEcooR
Do you saving your stats with dini or y_ini?
|
I Save with Dini.
Re: Jailing person on Spawn -
dEcooR - 01.08.2013
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");
Re: Jailing person on Spawn -
chubz - 02.08.2013
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!
Re: Jailing person on Spawn -
chubz - 02.08.2013
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