Upon server restart
#1

When the server restarts and you're still logged in, your coords get reset to 0.00000.
I got told it's a SA:MP bug and there's a work-around with a timer?

Is this true? If so, how?

Regards.
Reply
#2

It doesn't sets your coordinates to the default 0.0000 etc, it just teleports you to the beach at Los Santos.
0 coords are referring to the middle of the San Andreas map, at Blueberry - next to the farm.

Since you're basically restarting the server, using a saving method won't help you out since it'll get reseted upon the reset; try to use the SetPlayerPos(...) function upon connecting to the server instead.
PHP код:
public OnPlayerConnect(playerid)
{
    
SetPlayerPos(playeridXYZ); // enter floats to the X/Y/Z
    
return 1;

Reply
#3

Quote:
Originally Posted by Income
Посмотреть сообщение
It doesn't sets your coordinates to the default 0.0000 etc, it just teleports you to the beach at Los Santos.
0 coords are referring to the middle of the San Andreas map, at Blueberry - next to the farm.
Wrong!
It teleports me to Blueberry(Default coords at 0.00000)

Meh, I'll try it.
Reply
#4

Quote:
Originally Posted by Jernu
Посмотреть сообщение
Wrong!
It teleports me to Blueberry(Default coords at 0.00000)

Meh, I'll try it.
That is a fact, how can I be wrong? In your case, you get teleported to Blueberry somehow.
Reply
#5

If you use a saving method for your coordinates upon OnPlayerDisconnect, and the server crashes or restarts, then they're most likely going to save as '0.00' for each coordinate, therefore placing you in your last saved coordinates (0, 0, 0) under OnPlayerSpawn... In this case, you will need to use a timer that gets the player's position every so often, and save that to their file rather than just using OnPlayerDisconnect. If it's not necessary, than I suggest removing it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)