SA-MP Forums Archive
Staff Position wont save - 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: Staff Position wont save (/showthread.php?tid=547372)



Staff Position wont save - Oldyman - 22.11.2014

I did script a new staff position like , it works and everything fine
but when a player relogs , the staff position dosent save
what can i do in this case?


Re: Staff Position wont save - James Bob - 22.11.2014

Under OnPlayerDisconnect do you have it there? so it'll save there player file or anything similar.


Re: Staff Position wont save - UltraScripter - 22.11.2014

The Save :
pawn Код:
new Pos[20];
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
format(Pos, sizeof(Pos), "=", x, y, z);
dini_Set(yourfile, "Pos", x, y, z);
OnPlayerSpawn

pawn Код:
new pPos;
pPos = dini_Int(yourfile, "=");
SetPlayerPos(playerid, pPos);
Hope That Helped! .


Re: Staff Position wont save - UltraScripter - 22.11.2014

sorry i did mistake
delete
pawn Код:
dini_Set(yourfile, "Pos", x, y, z);
and replace
pawn Код:
dini_Set(yourfile, "Pos", Pos);



Re: Staff Position wont save - Oldyman - 22.11.2014

It's actually a staff position , Moderator defined as "pModerator"
The script is already done everything is working except this one , it dosent save


Re: Staff Position wont save - UltraScripter - 22.11.2014

Show us the ode then!:.


Re: Staff Position wont save - Oldyman - 02.12.2014

i did the following but still the same:
Код:
stock SaveChar(playerid)
{
	if(IsPlayerConnected(playerid))
	{
		dini_IntSet(file, "Moderator", PlayerInfo[playerid][pModerator]);
	}
}
stock LoadChar(playerid)
{
	PlayerInfo[playerid][pModerator] = dini_Int(file, "Moderator");
}
Lemme give you more details , somehow im just trying to develop my own gamemode so this staff position would save in the user file "scriptfiles/users/user.ini" , somehow it dosent save everything is correct and its commands are working but when u relog it dosent save
Assigning + /q = coming back without the position


Re: Staff Position wont save - Oldyman - 06.12.2014

Anyone?