How do I save a players pos and make it their spawn?
#1

How do I save a players position when they disconnect, and when they spawn, it spawns them at that position? It's like San Andreas Roleplay.
Reply
#2

well i have a san fierro team deathmatch server that does the exact thing you want I just dont know if its the gamemode you want.AnyWay If you want it take it
Reply
#3

Where would I go to find this code? I found some of it under OnPlayerDisconnect.
Reply
#4

Quote:
Originally Posted by Richy_Bugger
Where would I go to find this code? I found some of it under OnPlayerDisconnect.
i put the AMX and the PWN for you At my Attachments
Reply
#5

Quote:
Originally Posted by Richy_Bugger
Where would I go to find this code? I found some of it under OnPlayerDisconnect.
You need to save their pos at their userfile.Ill give u an example:

pawn Код:
//Lets say that this is ur playerinfo system
enum pinfo
{
//Here is ur other defines
Float:pPos_x, //for the x coord
Float:pPos_y, //for the y coord
Float:pPos_z, //for the z coord
Float:pPos_A, //for the facing angle
};
new PlayerInfo[MAX_PLAYERS][pInfo];

Now to the OnPlayerDisconnect u should at this:
pawn Код:
GetPlayerPos(playerid, PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]);
GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPos_A]);
//Done all coordinates are saved
Now to spawn at this pos, u need to add this lines to OnPlayerSpawn.If u already use other spawn coords u need to delete them.
pawn Код:
SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPos_A]);
I hope that will help
Reply
#6

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)