need to save facing angle virtual world and interior
#1

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

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 )
Reply
#3

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
Reply
#4

deleted
Reply
#5

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
Reply
#6

it helped alot ty man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)