23.07.2014, 12:41
Hi all!
THIS IS VERY URGENT I HAVE TO OPEN MY SERVER AT 16:00
I have inserted a system for respawning in the same position of logging out.
But when I log out, the server saves Y and Z coords, but no X.
Example:
X= 0 Y= 121.2 Z= 5.28
How I can resolve this?
Thanks.
Here's the code.
PLEASE THIS IS VERY URGENT! HELP ME! THANKS
THIS IS VERY URGENT I HAVE TO OPEN MY SERVER AT 16:00
I have inserted a system for respawning in the same position of logging out.
But when I log out, the server saves Y and Z coords, but no X.
Example:
X= 0 Y= 121.2 Z= 5.28
How I can resolve this?
Thanks.
Here's the code.
pawn Код:
enum pInfo,
Float: pUltimaX,
Float: pUltimaY,
Float: pUltimaZ,
//... other things
public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][pUltimaX] = 0;
PlayerInfo[playerid][pUltimaY] = 0;
PlayerInfo[playerid][pUltimaZ] = 0;
//... other things
public OnPlayerDisconnect(playerid)
{
PlayerInfo[playerid][pUltimaX] = UltimaX;
PlayerInfo[playerid][pUltimaY] = UltimaY;
PlayerInfo[playerid][pUltimaZ] = UltimaZ;
PlayerInfo[playerid][pUltimaX] = Float: UltimaX;
PlayerInfo[playerid][pUltimaY] = Float: UltimaY;
PlayerInfo[playerid][pUltimaZ] = Float: UltimaZ;
//other things...
public OnPlayerRegister(playerid)
{
format(var, 32, "pUltimaX=%.1f\n", PlayerInfo[playerid][pUltimaX]);fwrite(hFile, var);
format(var, 32, "pUltimaY=%.1f\n", PlayerInfo[playerid][pUltimaY]);fwrite(hFile, var);
format(var, 32, "pUltimaZ=%.1f\n", PlayerInfo[playerid][pUltimaZ]);fwrite(hFile, var);
//other things...
public OnPlayerLogin(playerid)
if( strcmp( key , "UltimaX" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pUltimaX] = floatstr( val ); }
if( strcmp( key , "UltimaY" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pUltimaY] = floatstr( val ); }
if( strcmp( key , "UltimaZ" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pUltimaZ] = floatstr( val ); }
//other things...