Saving and loading a player's position and then spawning using onplayerrequestclass.
#1

Okay this might be a stupid question.

But, anyway. I've got my login/register system setup and I've got a script written to save the player's coordinates, virtual world, and interior ID upon disconnect.

How do I load this info from the .ini file and use it with SetSpawnInfo in OnPlayerConnect?

Also; I'm using Y_INI
Reply
#2

Read: https://sampforum.blast.hk/showthread.php?tid=175565
Reply
#3

Quote:
Originally Posted by SnG.Scot_MisCuDI
Посмотреть сообщение
Thank you for the reply.
I'm reading it currently, however I'm still having trouble understanding exactly what I need to do.

Can you help me out by pointing me in the right section on that forum?
IE: What part do I specifically need to be looking at?
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=273088 <--- best tutorial on y_ini I've seen so far.
Reply
#5

What I'm needing to know specifically is how to define arguments in SetSpawnInfo with the enum i have setup for the pos x, etc.

Basically I need to know how to load the xyz positions from the ini file.
Like this: SetSpawnInfo(playerid, pos-x, pos-y, pos-z, etc etc);
pos-x pos-y pos-z being whatever is written in the file
Reply
#6

i know what your talking about but i only know dini. idk how to load a single part of the file instead of the whole thing with y_ini.. only dini sorry
Reply
#7

May I see your enum? Or we can do this over teamviewer?
Reply
#8

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
May I see your enum? Or we can do this over teamviewer?
Do you have skype?
my username is ChuckH92
Reply
#9

Quote:
Originally Posted by SnG.Scot_MisCuDI
Посмотреть сообщение
i know what your talking about but i only know dini. idk how to load a single part of the file instead of the whole thing with y_ini.. only dini sorry
Well hey man, thanks for at least giving me a link!
And, this is a longshot, but I used to know a girl that lived in Gilbert Arizona. Name was Brittany Russell.
Had three brothers and one sister.
Sister was Nicole, brothers were Tj, Nate, and Stephen.

They were homeschooled.

You wouldn't happen to know them, would you?
Reply
#10

pawn Код:
public OnPlayerSpawn(playerid)
{
    new Float:x, Float:y, Float:z;
    INI_Float("", x); // In between the " 's, put the name that you titled your position.  i.g. you save the file as positionx, so you load positionx.
    INI_Float("", y);
    INI_Float("", z);
    SetPlayerPos(playerid, x, y, z);
    return 1;
}
Untested. Plus, if you can't seem to figure out what you put between the quotation marks, show me how you save the position.

Never did it like this before, but I think it would work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)