22.07.2009, 21:45
Can somebody help me to make a script to return the same place before crash
Thanks
Thanks
Originally Posted by Ben147
I cannot find it ://////
|
public OnPlayerDisconnect(playerid, reason)
{
if(reason == 3)
{
new str[256], plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
format(str, sizeof(str), "%s.ini", plname);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
dini_IntSet(str, "crashed", 1);
dini_FloatSet(str, "X", X);
dini_FloatSet(str, "Y", Y);
dini_FloatSet(str, "Z", Z);
return 1;
}
return 0;
}
public OnPlayerRequestSpawn(playerid)
{
new str[256], plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
format(str, sizeof(str), "%s.ini", plname);
if(dini_Int(str, "crashed") == 1)
{
SetPlayerPos(playerid, dini_Float(str, "X"), dini_Float(str, "Y"), dini_Float(str, "Z"));
GameTextForPlayer(playerid, "~r~crahsed. ~w~returning to your last position", 10000, 1);
dini_IntSet(str, "crashed", 0);
return 1;
}
return 0;
}