Spawning in blueberry near a farm....
#1

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
Reply
#2

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.
Reply
#3

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.
Reply
#4

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

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
Reply
#6

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.
Reply
#7

Some people are still spawning in blueberry sometimes....
Reply
#8

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.
Reply
#9

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)