14.03.2010, 06:40
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.
Originally Posted by Richy_Bugger
Where would I go to find this code? I found some of it under OnPlayerDisconnect.
|
Originally Posted by Richy_Bugger
Where would I go to find this code? I found some of it under OnPlayerDisconnect.
|
//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];
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
SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPos_A]);