SA-MP Forums Archive
Sometimes teleports, sometimes - not.. - 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: Sometimes teleports, sometimes - not.. (/showthread.php?tid=89215)



Sometimes teleports, sometimes - not.. - SiJ - 31.07.2009

Hey,

I use DUDB and sometimes when I connect to my server it doesn't teleports me to location which is saved on disconnect.
When I disconnect I can see that position is saved correctly in the file..

Here's my code:

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetTimerEx("PutAtPos",2000,false,"d",playerid);
//......
}

//And the public PutAtPos is:
public PutAtPos(playerid)
{
    if (IsPlayerConnected(playerid))
    {
        if (dUserINT(PlayerName(playerid)).("x")!=0)
        {
            SetPlayerPos(playerid,
                    float(dUserINT(PlayerName(playerid)).("x")),
                float(dUserINT(PlayerName(playerid)).("y")),
                float(dUserINT(PlayerName(playerid)).("z")));
 // Debug*:
            printf("PutAtPos: x:%f y:%f z:%f",dUserINT(PlayerName(playerid)).("x"),dUserINT(PlayerName(playerid)).("y"),dUserINT(PlayerName(playerid)).("z"));

                SetPlayerInterior(playerid,(dUserINT(PlayerName(playerid)).("interior")));
                SetCameraBehindPlayer(playerid);
        }
        else
        {
          SetPlayerFacingAngle(playerid,135.1189);
          SetPlayerPos(playerid,-1406.1509,-305.5294,14.1484);
          SetCameraBehindPlayer(playerid);
          SetPlayerInterior(playerid,0);
        }
    TextDrawShowForPlayer(playerid,Text:Textdraw0);
    }
    return 1;
}
* - I tried debugging it and it prints in console x:0.000000 y:0.000000 z:0.000000 BUT teleports me to location which is saved in the file...

So what's wrong with this?


Re: Sometimes teleports, sometimes - not.. - SiJ - 31.07.2009

Hello? Anybody?


Re: Sometimes teleports, sometimes - not.. - Correlli - 31.07.2009

dUserINT is to get an integer, use dUserFLOAT.