SetPlayerPos not working properly!
#1

Hey all .
I have got a problem again.
When i use 'SetPlayerPos', it always teleports me to location 0.0000, 0.0000, 0.0000 (somewhere underground near farm, los santos). Heres the code:

Код:
new Float:px, Float:py, Float:pz, Float:aa;
px = dini_Float(file,"PosX");
py = dini_Float(file,"PosY");
pz = dini_Float(file,"PosZ");
aa = dini_Float(file,"Angle");
SetPlayerPos(playerid,px,py,pz);
SetPlayerFacingAngle(playerid,aa);
Everything is proper and file is opening and closing. And no warnings or errors.

P.S. I use dini cause i like it . So please dont tell about that.

Regards
Electrux
Reply
#2

show us your saving pos code and your teleport code in full
Reply
#3

Here is saving:

Код:
new file[50], Float:px, Float:py, Float:pz, Float:aa;
GetPlayerPos(playerid,px,py,pz);
GetPlayerFacingAngle(playerid,aa);
format(file,sizeof(file),"/implocations/%d.dat",index);
dini_Create(file);
dini_Set(file,"Name","Name");
dini_FloatSet(file,"PosX",px);
dini_FloatSet(file,"PosY",py);
dini_FloatSet(file,"PosZ",pz);
dini_FloatSet(file,"Angle",aa);
Here is loading:
Код:
CMD:teleporttoidfile(playerid,params[])
{
new index,file[50];
if(sscanf(params,"i",index)) return SCM(playerid,COLOR_RED,"Usage: teleporttoid [ID of file (like 0, 1, 2, 4 etc.)]");
format(file,sizeof(file),"/implocations/%d.dat",index);
new Float:px, Float:py, Float:pz, Float:aa;
px = dini_Float(file,"PosX");
py = dini_Float(file,"PosY");
pz = dini_Float(file,"PosZ");
aa = dini_Float(file,"Angle");
SetPlayerPos(playerid,px,py,pz);
SetPlayerFacingAngle(playerid,aa);
SCM(playerid,COLOR_RED,"Done!!");
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)