Spawning in under the map in Blueberry!!!
#1

Hey I'm having a problem when once the user logs in it spawns them under the map in Blueberry and doesn't spawn them at where there co-ordinates are saved. I think it's something to do with the fact that the user has to click spawn instead of it auto spawning, but i could be wrong. ANY help would be appreciated. This is a hurdle that I need to jump.
Reply
#2

It means its cords are 0,0,0 o_O show your OnPlayerSpawn(playerid);
Reply
#3

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(JustLogged[playerid] == 1 && PlayerInfo[playerid][New] == 0)
    {
        SetPlayerPos(playerid, PlayerInfo[playerid][Pos][0], PlayerInfo[playerid][Pos][1], PlayerInfo[playerid][Pos][2]);
        SetPlayerFacingAngle(playerid, PlayerInfo[playerid][Pos][3]);
        JustLogged[playerid] = 0;
        {
            SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
        }
    }
    else
    {
        if(PlayerInfo[playerid][New] && gTeam[playerid] == TEAM_TRUCKER)
        {
            new RandPos = random(sizeof(TruckerSpawnPositions));
            SetPlayerPos(playerid, TruckerSpawnPositions[RandPos][0], TruckerSpawnPositions[RandPos][1], TruckerSpawnPositions[RandPos][2]);
            SetPlayerFacingAngle(playerid, TruckerSpawnPositions[RandPos][3]);
            PlayerInfo[playerid][New] = 0;
        }
    }
    return 1;
}
Reply
#4

Are Player Pos are saving and loading correctly ?
Reply
#5

As far as I know yes they save properly, the co-ordinates are there when they disconnect they just don't seem to load.
Reply
#6

Ok i've narrowed it down to this line

pawn Код:
SetPlayerPos(playerid, PlayerInfo[playerid][Pos][0], PlayerInfo[playerid][Pos][1], PlayerInfo[playerid][Pos][2]);
Anyone see the problem?
Reply
#7

pawn Код:
public SaveUser(playerid)
{
    if(IsLogged[playerid] == 0) return 0;
   
    GetPlayerHealth(playerid, PlayerInfo[playerid][Health]);
    GetPlayerArmour(playerid, PlayerInfo[playerid][Armour]);
    GetPlayerPos(playerid, PlayerInfo[playerid][Pos][0], PlayerInfo[playerid][Pos][1], PlayerInfo[playerid][Pos][2]);
    GetPlayerFacingAngle(playerid, PlayerInfo[playerid][Pos][3]);
   
    PlayerInfo[playerid][Money] = GetPlayerMoney(playerid);
    PlayerInfo[playerid][Skin] = GetPlayerSkin(playerid);
   
    dini_IntSet(Userfile, "Admin", PlayerInfo[playerid][Admin]);
    dini_IntSet(Userfile, "Money", PlayerInfo[playerid][Money]);
    dini_IntSet(Userfile, "Skin", PlayerInfo[playerid][Skin]);
    dini_IntSet(Userfile, "New", PlayerInfo[playerid][New]);
   
    if(PlayerInfo[playerid][Health] != 0) dini_FloatSet(Userfile, "Health", PlayerInfo[playerid][Health]);
    if(PlayerInfo[playerid][Armour] != 0) dini_FloatSet(Userfile, "Armour", PlayerInfo[playerid][Armour]);
    if(PlayerInfo[playerid][Pos][0] != 0) dini_FloatSet(Userfile, "X", PlayerInfo[playerid][Pos][0]);
    if(PlayerInfo[playerid][Pos][1] != 0) dini_FloatSet(Userfile, "Y", PlayerInfo[playerid][Pos][1]);
    if(PlayerInfo[playerid][Pos][2] != 0) dini_FloatSet(Userfile, "Z", PlayerInfo[playerid][Pos][2]);
    if(PlayerInfo[playerid][Pos][3] != 0) dini_FloatSet(Userfile, "R", PlayerInfo[playerid][Pos][3]);
    return 1;
}
Sorry for tripple post :L but if this helps...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)