Help me position - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me position (
/showthread.php?tid=220984)
Help me position -
GeonMake - 04.02.2011
how i do when i join againe on server get myself back on the position were when i get out
Re: Help me position -
Steven Paul - 04.02.2011
using SetPlayerPos and GetPlayerPos on OnPlayerConnect and OnPlayerDisconnect
Re: Help me position -
Steven Paul - 04.02.2011
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]);
Re: Help me position -
GeonMake - 04.02.2011
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.
Re: Help me position -
newarvuti - 05.02.2011
I am experiencing same problem and the position does not get saved.