31.07.2009, 19:53
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:
* - 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?
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;
}
So what's wrong with this?