SA-MP Forums Archive
Saving and loading a player's position and then spawning using onplayerrequestclass. - 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: Saving and loading a player's position and then spawning using onplayerrequestclass. (/showthread.php?tid=350834)



Saving and loading a player's position and then spawning using onplayerrequestclass. - Unfriendly - 13.06.2012

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


Re: Saving and loading a player's position and then spawning using onplayerrequestclass. - SnG.Scot_MisCuDI - 14.06.2012

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


Re: Saving and loading a player's position and then spawning using onplayerrequestclass. - Unfriendly - 14.06.2012

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?


Re: Saving and loading a player's position and then spawning using onplayerrequestclass. - JhnzRep - 14.06.2012

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


Re: Saving and loading a player's position and then spawning using onplayerrequestclass. - Unfriendly - 14.06.2012

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


Re: Saving and loading a player's position and then spawning using onplayerrequestclass. - SnG.Scot_MisCuDI - 14.06.2012

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


Re: Saving and loading a player's position and then spawning using onplayerrequestclass. - JhnzRep - 14.06.2012

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


Re: Saving and loading a player's position and then spawning using onplayerrequestclass. - Unfriendly - 14.06.2012

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


Re: Saving and loading a player's position and then spawning using onplayerrequestclass. - Unfriendly - 14.06.2012

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?


Re: Saving and loading a player's position and then spawning using onplayerrequestclass. - Kindred - 14.06.2012

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.