SA-MP Forums Archive
Spawning in blueberry near a farm.... - 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: Spawning in blueberry near a farm.... (/showthread.php?tid=67414)



Spawning in blueberry near a farm.... - kevin433 - 01.03.2009

Hi,
I try to make a system where you will spawn at the place where you had a timeout. I save the players timeout position in a file. When he connects and the file exists, it will be loaded and he spawns, then the server sets his Player Pos. But my problem is, that sometimes, the player spawns in Blueberry. I think that the file don't get loaded soimetimes, but i'm not sure. I work on this some weeks now fix the bug. But i don't find any wrong in the code.....


http://pastebin.ca/1350212


Re: Spawning in blueberry near a farm.... - GunnerZ - 01.03.2009

I think that its not saving the last coordinates properly. So therefore, you're spawning at 0,0,0 which is in the centre of that farm.


Re: Spawning in blueberry near a farm.... - kevin433 - 01.03.2009

we (my Team and I) tried something before. Someone did a TimeOut many times and then we downloaded the TimeOut file. we opened it and saw that everything was normal, all coordinates where there.


Re: Spawning in blueberry near a farm.... - beckzy - 01.03.2009

If a player has timed GetPlayerPos will return 0, 0, 0 because the player is no longer connected.


Re: Spawning in blueberry near a farm.... - kevin433 - 01.03.2009

The server gets his position every 10 seconds, the confusing the is, that it works to save the position without 0.0,0.0,0.0


Re: Spawning in blueberry near a farm.... - GunnerZ - 01.03.2009

pawn Код:
public TOSaving()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
           if(gPlayerLogged[i]==1 && gPlayerSpawned[i] == 1)
            {
                new string3[32];
                new pname3[MAX_PLAYER_NAME];
                GetPlayerName(i, pname3, sizeof(pname3));
                format(string3, sizeof(string3), "/Timeouts/%s.timeout", pname3);
                if(fexist(string3))
                {
                    dini_FloatSet(string3, "TOX",TimeOutInfo[i][tPosX]);
                    dini_FloatSet(string3, "TOY",TimeOutInfo[i][tPosY]);
                    dini_FloatSet(string3, "TOZ",TimeOutInfo[i][tPosZ]);
                }
           }
       }
    }
    return 1;
}

I guess you can sort the indentation out.


Re: Spawning in blueberry near a farm.... - kevin433 - 03.03.2009

Some people are still spawning in blueberry sometimes....


Re: Spawning in blueberry near a farm.... - Austin_Lynn - 03.03.2009

Quote:
Originally Posted by kevin433
Some people are still spawning in blueberry sometimes....
Yes, this is a very common bug. you will also find that sometimes sertain commands will send you to that farm.
add me on MSN and I will try to help.


Re: Spawning in blueberry near a farm.... - Michael_K - 10.03.2009

sometimes the gamemode is crashing when a player has logged in
you can see this when you walk like you are fat


Re: Spawning in blueberry near a farm.... - Austin_Lynn - 11.03.2009

Quote:
Originally Posted by Michael_K
sometimes the gamemode is crashing when a player has logged in
you can see this when you walk like you are fat
Yeah but what does this have to do with spawning in blueberry every time.
I also suggest if you made your self a faction leader that that faction has a spawn point.