[Help] i need help please
#1

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!
Reply
#2

UP
Plase Help
Reply
#3

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.
Reply
#4

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.
Reply
#5

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;
}
}
Reply
#6

UP - Help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)