Saving spawn location with dini
#1

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.
Reply
#2

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)