SetPlayerPos not working properly!
#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


Messages In This Thread
SetPlayerPos not working properly! - by electrux - 04.01.2013, 15:05
Re: SetPlayerPos not working properly! - by Opah - 04.01.2013, 15:11
Re: SetPlayerPos not working properly! - by electrux - 04.01.2013, 15:39

Forum Jump:


Users browsing this thread: 2 Guest(s)