SA-MP Forums Archive
Help with disconnect Save Position - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with disconnect Save Position (/showthread.php?tid=154409)



Help with disconnect Save Position - Tyler_Idy - 13.06.2010

I need help fixing this...

Код:
public OnPlayerDisconnect(playerid, reason)
{
	new pName[24], PlayerFile[50];
	new Float:PX, Float:PY, Float:PZ;
	
	GetPlayerName(playerid, pName, sizeof(pName));
	format(PlayerFile, sizeof(PlayerFile), "SFRP/users/%s.ini", pName);
	
	GetPlayerPos(playerid, PX, PY, PZ);
	
	PlayerInfo[playerid][PlayerX] = PX;
	PlayerInfo[playerid][PlayerY] = PY;
	PlayerInfo[playerid][PlayerZ] = PZ;
	
	dini_IntSet(PlayerFile, "PlayerX", PlayerInfo[playerid][PlayerX]);
	dini_IntSet(PlayerFile, "PlayerY", PlayerInfo[playerid][PlayerY]);
	dini_IntSet(PlayerFile, "PlayerZ", PlayerInfo[playerid][PlayerZ]);
	dini_IntSet(PlayerFile, "Spawn", 2);
	
	return 1;
}



Re: Help with disconnect Save Position - DJDhan - 13.06.2010

What's the problem with this code?


Re: Help with disconnect Save Position - Tyler_Idy - 13.06.2010

Код:
C:\Users\Administrator\Documents\SA-MP Server\gamemodes\SFRP.pwn(111) : warning 213: tag mismatch
C:\Users\Administrator\Documents\SA-MP Server\gamemodes\SFRP.pwn(112) : warning 213: tag mismatch
C:\Users\Administrator\Documents\SA-MP Server\gamemodes\SFRP.pwn(113) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
These lines

Код:
dini_IntSet(PlayerFile, "PlayerX", PlayerInfo[playerid][PlayerX]);
	dini_IntSet(PlayerFile, "PlayerY", PlayerInfo[playerid][PlayerY]);
	dini_IntSet(PlayerFile, "PlayerZ", PlayerInfo[playerid][PlayerZ]);



Re: Help with disconnect Save Position - DJDhan - 13.06.2010

Код:
public OnPlayerDisconnect(playerid, reason)
{
	new pName[24], PlayerFile[50];
	new Float:PX, Float:PY, Float:PZ;
	
	GetPlayerName(playerid, pName, sizeof(pName));
	format(PlayerFile, sizeof(PlayerFile), "SFRP/users/%s.ini", pName);
	
	GetPlayerPos(playerid, PX, PY, PZ);
	
	PlayerInfo[playerid][PlayerX] = PX;
	PlayerInfo[playerid][PlayerY] = PY;
	PlayerInfo[playerid][PlayerZ] = PZ;
	
	dini_FloatSet(PlayerFile, "PlayerX", PlayerInfo[playerid][PlayerX]);
	dini_FloatSet(PlayerFile, "PlayerY", PlayerInfo[playerid][PlayerY]);
	dini_FloatSet(PlayerFile, "PlayerZ", PlayerInfo[playerid][PlayerZ]);
	dini_IntSet(PlayerFile, "Spawn", 2);
	
	return 1;
}



Re: Help with disconnect Save Position - Tyler_Idy - 13.06.2010

Okay, now ive goten al little father but I got stuck again....

Код:
public OnPlayerDisconnect(playerid, reason)
{
	new pName[24], PlayerFile[50];
	new Float:PX, Float:PY, Float:PZ;
	
	GetPlayerName(playerid, pName, sizeof(pName));
	format(PlayerFile, sizeof(PlayerFile), "SFRP/users/%s.ini", pName);
	
	GetPlayerPos(playerid, PX, PY, PZ);
	
111	dini_FloatSet(PlayerFile, "PlayerX", PX;
112	dini_FloatSet(PlayerFile, "PlayerY", PY;
113	dini_FloatSet(PlayerFile, "PlayerZ", PZ;
	
	dini_IntSet(PlayerFile, "Spawn", 2);
	
	return 1;
}
And the errors are:

Код:
C:\Users\Administrator\Documents\SA-MP Server\gamemodes\SFRP.pwn(111) : error 001: expected token: ",", but found ";"
C:\Users\Administrator\Documents\SA-MP Server\gamemodes\SFRP.pwn(112) : error 001: expected token: ",", but found ";"
C:\Users\Administrator\Documents\SA-MP Server\gamemodes\SFRP.pwn(113) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.



Re: Help with disconnect Save Position - DJDhan - 13.06.2010

Wait a minute, you missed brackets at the end. See my post again.

EDIT: That's not the code I gave.


PS:
Код:
dini_FloatSet(PlayerFile, "PlayerX", PX);
dini_FloatSet(PlayerFile, "PlayerY", PY);
dini_FloatSet(PlayerFile, "PlayerZ", PZ);



Re: Help with disconnect Save Position - Tyler_Idy - 13.06.2010

Such a silly mistake.
THANK YOU



Re: Help with disconnect Save Position - DJDhan - 13.06.2010

Quote:
Originally Posted by Tyler_Idy
Such a silly mistake.
THANK YOU
Lol, Glad to help.


Re: Help with disconnect Save Position - Jefff - 13.06.2010

Ehm why U using here this? ;o
Код:
	PlayerInfo[playerid][PlayerX] = PX;
	PlayerInfo[playerid][PlayerY] = PY;
	PlayerInfo[playerid][PlayerZ] = PZ;
shortly
Код:
	dini_FloatSet(PlayerFile, "PlayerX", PX);
	dini_FloatSet(PlayerFile, "PlayerY", PY);
	dini_FloatSet(PlayerFile, "PlayerZ", PZ);