Help me position
#1

how i do when i join againe on server get myself back on the position were when i get out
Reply
#2

using SetPlayerPos and GetPlayerPos on OnPlayerConnect and OnPlayerDisconnect
Reply
#3

use this

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 and add 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]);
Reply
#4

C:\Users\Enache\Desktop\ps.pwn(289 : warning 213: tag mismatch
C:\Users\Enache\Desktop\ps.pwn(4144) : warning 213: tag mismatch
C:\Users\Enache\Desktop\ps.pwn(12611) : warning 219: local variable "mod" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Header size: 11132 bytes
Code size: 1722344 bytes
Data size: 6849848 bytes
Stack/heap size: 16384 bytes; estimated max. usage=4136 cells (16544 bytes)
Total requirements: 8599708 bytes

3 Warnings.
Reply
#5

I am experiencing same problem and the position does not get saved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)