31.08.2011, 10:52
Quote:
Sorry to announce that saving on disconnect is difficult. Atleast in my opinion. You can read about it GetPlayerWeaponData to try and learn. You also need to remember to load them on login / spawn whatever.
For the crash part, thats not that hard. go to OnPlayerDisconnect, then use 'case' switch. I believe your other players got different spawn points, so we would want only this feature for those who crashed. Now, case 0 is crashing. So if you do like case 0: { GetPlayerPos(etc.. } and load the normal spawning point of case 1. Would perhaps be good of you saved which way the player disconnected last. |
SetPlayerSpawn:
if(PlayerInfo[playerid][pCrashed] == 1)
{
if(TutTime[playerid] == 0 && PlayerInfo[playerid][pTut] == 1 && RegistrationStep[playerid] == 0 && AfterTutorial[playerid] == 0 && FirstSpawn[playerid] == 1)
{
SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z] + 1);
return 1;
}
}