SA-MP Forums Archive
need to save facing angle virtual world and interior - 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)
+--- Thread: need to save facing angle virtual world and interior (/showthread.php?tid=366715)



deleted - Joe Vagos - 07.08.2012

i need to save facing angle virtual world and interior using dini so could any one help me


Re: need to save facing angle virtual world and interior - Ranama - 07.08.2012

https://sampwiki.blast.hk/wiki/GetPlayerVirtualWorld
https://sampwiki.blast.hk/wiki/GetPlayerInterior
https://sampwiki.blast.hk/wiki/GetPlayerFacingAngle

And save them to your database/didi/whatever

Hope that helped(searching the wiki can be helpful )


Respuesta: need to save facing angle virtual world and interior - ThePhenix - 07.08.2012

Use Samp_debug on your GTA Directory, Select the position that you want, then type /Save.

Read it to more information:

https://sampwiki.blast.hk/wiki/GetPlayerFacingAngle


deleted - Joe Vagos - 07.08.2012

deleted


Re: need to save facing angle virtual world and interior - Jstylezzz - 07.08.2012

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new file[128], pname[MAX_PLAYER_NAME];
new Float:x, Float:y, Float:z,Float:angle;//we add a float for angle here
new interior,vworld;//we will store the values in here
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\SavePos\\%s.ini", pname);
if(!dini_Exists(file))
dini_Create(file);
GetPlayerPos(playerid, x, y, z);
interior = GetPlayerInterior(playerid);//here we get the interior of the player, and we store it in our variable
vworld = GetPlayerVirtualWorld(playerid);//here we get the world of the player, and we store it in our variable
GetPlayerFacingAngle(playerid,angle);//here we get the angle, and store it in our float
dini_FloatSet(file, "posX", x);
dini_FloatSet(file, "posY", y);
dini_FloatSet(file, "posZ", z);
dini_FloatSet(file, "angle",angle);//here we get the float, that we previously filled with the angle value, and we save it
dini_IntSet(file, "interior",interior);//here we save the interior with the data collected above
dini_IntSet(file, "vworld",vworld);//save for virtual world, we collect the data and save it
return 1;
}
public OnPlayerSpawn(playerid)
{
new file[128], pname[MAX_PLAYER_NAME];
new Float:x, Float:y, Float:z,Float:angle;//we create a float for our angle again
new vworld,interior;//we create vars again
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\SavePos\\%s.ini", pname);
x = dini_Float(file, "posX");
y = dini_Float(file, "posY");
z = dini_Float(file, "posZ");
angle = dini_Float(file, "angle");//here we read the data from the file, and load the value into our float
interior = dini_Int(file, "interior");//here we load the data in the variables we created earlier
vworld = dini_Int(file, "vworld");//here we load the data in the variables we created earlier
SetPlayerPos(playerid, x, y, z);
SetPlayerFacingAngle(playerid,angle);//here we set the angle that we loaded before.
SetPlayerInterior(playerid,interior);//self explanitory, we set the interior with the data collected above
SetPlayerVirtualWorld(playerid,vworld);//self explanitory, we set the virtual world with the data collected above
return 1;
}
read my comments, i explained what we do, so you can make things like this yourself..
hope i helped


Re: need to save facing angle virtual world and interior - Joe Vagos - 07.08.2012

it helped alot ty man