SA-MP Forums Archive
[Help] i need help please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] i need help please (/showthread.php?tid=280089)



[Help] i need help please - Fredy_Cole - 30.08.2011

Hi , i need some help (RP server)

people Complain that they wepon doesent saved after exit of the game.

i need to do that when someone get out from the game
his weapon will be saved for the next time he will get in.

and i need one more help
that when someone get crash from the server
he will spawn in the same place he got the crash

sorry about my english

Thanks!


Re: [Help] i need help please - Fredy_Cole - 31.08.2011

UP
Plase Help


Re: [Help] i need help please - Coffeemonster - 31.08.2011

You need to save the X,Y,Z and the weapon ID's to the PlayerInfo enum and the player's account in OnPlayerLogout or Disconnect or something like that. Then load them and give the player the weapons in their login, this depends on your gamemode and it's saving system.


Re: [Help] i need help please - Kayaque - 31.08.2011

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.


Re: [Help] i need help please - Fredy_Cole - 31.08.2011

Quote:
Originally Posted by Kayaque
Посмотреть сообщение
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.
i got this
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;
}
}


Re: [Help] i need help please - Fredy_Cole - 01.09.2011

UP - Help