SA-MP Forums Archive
Saving spawn location with dini - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Saving spawn location with dini (/showthread.php?tid=144671)



Saving spawn location with dini - Dolph - 28.04.2010

I am pretty new to dini, so I wondered if anyone could help me?


What I want: That it saves the player location on disconnect, and then spawns them at that place
when they logged in.

What I have done so far:

pawn Код:
dini_IntSet(file,"location", logged[playerid]);
- under OnPlayerDC

pawn Код:
logged[playerid] = dini_Int(file,"location");
- under login

pawn Код:
dini_IntSet(file,"location",0 );
- under register


I have no idea if I have done anything wrong, if so, please help me out.


Thanks in advance.


Re: Saving spawn location with dini - Dolph - 28.04.2010

As I said, im quite new, So I dont know where to put the stuff.


Re: Saving spawn location with dini - park4bmx - 02.05.2010

Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
To save this you can save each coord as one number:

new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
dini_FloatSet(file, "SpawnX", X);
dini_FloatSet(file, "SpawnY", Y);
dini_FloatSet(file, "SpawnZ", Z);


Then when you load it use this:

new

Float:X = dini_Float(file, "SpawnX"),
Float:Y = dini_Float(file, "SpawnY"),
Float:Z = dini_Float(file, "SpawnZ");

SetPlayerPos(playerid, X, Y, Z);



There are great things you can do with dini :P

Hope that helps
Thank man saved my day