SA-MP Forums Archive
Positions problem. - 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: Positions problem. (/showthread.php?tid=217786)



Positions problem. - GaB1TzZzu - 28.01.2011

I have this on OnPlayerDisconnect()
pawn Код:
GetPlayerPos(playerid, PlayerInfo[playerid][pCrashPos_x], PlayerInfo[playerid][pCrashPos_y], PlayerInfo[playerid][pCrashPos_z]);
and this on OnPlayerLogin()

pawn Код:
GetPlayerPos(playerid, PlayerInfo[playerid][pCrashPos_x], PlayerInfo[playerid][pCrashPos_y], PlayerInfo[playerid][pCrashPos_z]);

The problem: When i login it will respawned me on the hospital..

I have a SpawnType, too.


Re: Positions problem. - viKKmaN - 28.01.2011

If you save the position when player disconnects, then you should set the position when player logs in.
It spawns you inside your hospital because when you login you save the position again instead of setting it.


Re: Positions problem. - Luis- - 28.01.2011

pawn Код:
SetPlayerPos(playerid, PlayerInfo[playerid][pCrashPos_x], PlayerInfo[playerid][pCrashPos_y], PlayerInfo[playerid][pCrashPos_z]);
Use this under OnPlayerLogin.


Re: Positions problem. - GaB1TzZzu - 29.01.2011

Quote:
Originally Posted by viKKmaN
Посмотреть сообщение
If you save the position when player disconnects, then you should set the position when player logs in.
It spawns you inside your hospital because when you login you save the position again instead of setting it.
Daca imi poti zice pe romana ar fi mai bine ca te-as intelege cu mai multa usurinta.



@-Luis: I have already that in OnPlayerLogin()


Re: Positions problem. - Biesmen - 29.01.2011

Try this code:

OnPlayerDisconnect
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PlayerInfo[playerid][pCrashPos_x] = x;
PlayerInfo[playerid][pCrashPos_y] = y;
PlayerInfo[playerid][pCrashPos_z] = z;
OnPlayerLogin
pawn Код:
SetPlayerPos(playerid, PlayerInfo[playerid][pCrashPos_x], PlayerInfo[playerid][pCrashPos_y], PlayerInfo[playerid][pCrashPos_z]);



Re: Positions problem. - GaB1TzZzu - 29.01.2011

I tried, look what problem i have..

When i log in, i will respawn at that coords, and after i will respawn at hospital..Is something like..

First time: SetplayerPos .... and after SpawnPlayer ..

I can't understand. I can make screenshot's if you want.


Re: Positions problem. - Biesmen - 29.01.2011

Well, if you logged off and you died, it will spawn at the hospital.

Try this, start the server, when you get ejected out of the hospital, walk to somewhere. Then log off by typing /q. Then reboot the server and check where you spawn now.


Re: Positions problem. - GaB1TzZzu - 29.01.2011

Same problem. I respawned at that position, and after i was in bed.. at hospital.


Re: Positions problem. - GaB1TzZzu - 29.01.2011

ScreenShots:
/imageshack/img253/2245/samp769v.png -> there I logged out. [/q]
/imageshack/img689/8580/samp770h.png -> after i log in
/imageshack/img534/9007/samp771.png -> after i log in
/imageshack/img20/4953/samp772.png -> after i log in
/imageshack/img714/3189/samp773l.png -> after i log in


Re: Positions problem. - Infamous - 29.01.2011

Are you setting the interior when you login also?