30.06.2009, 22:24
Okay, so I was woundering how I would script in where when people log/crash they would save their position and when the log back in they would spawn where they logged out.
public OnPlayerDisconnect(playerid, reason)
{
if(reason == 0)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
dini_FloatSet(thefile, "CrashX", X);
dini_FloatSet(thefile, "CrashY", Y);
dini_FloatSet(thefile, "CrashZ", Z);
return 1;
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
new Float:X, Float:Y, Float:Z;
X = dini_Float(thefile, "CrashX");
Y = dini_Float(thefile, "CrashY");
Z = dini_Float(thefile, "CrashZ");
SetPlayerPos(playerid, X, Y, Z);
return 1;
}
Originally Posted by James_Alex
use the dini include
and use this code pawn Код:
|
Originally Posted by NiGhTWoLFy
Quote:
Y = dini_Float(thefile, "CrashY"); Z = dini_Float(thefile, "CrashZ");" ? ? |