Help with disconnect Save Position
#1

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;
}
Reply
#2

What's the problem with this code?
Reply
#3

Код:
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]);
Reply
#4

Код:
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;
}
Reply
#5

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.
Reply
#6

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);
Reply
#7

Such a silly mistake.
THANK YOU
Reply
#8

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

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)