SA-MP Forums Archive
Something wrong in my login/register system - 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: Something wrong in my login/register system (/showthread.php?tid=655539)



Something wrong in my login/register system - Heress - 23.06.2018

How I can fix this?
https://imgur.com/a/blAoZz3

all my code:
https://pastebin.com/FJi1C4bC

When player register all fine, but when login, position saving and load don't work



Sorry for bad English, I'm from Lithuania


Re: Something wrong in my login/register system - div - 23.06.2018

OnPlayerDisconnect,

Use this

new Float:pX, Float:pY, Float:pZ
GetPlayerPos(playerid, pX, pY, pZ)

Then save them individually in the ENUM pX, pY, pZ

dini_intset(Accounts, "pX", pX)
dini_intset(Accounts, "pY", pY)


^ like this

and when a PLAYER CONNECTS



SetPlayerPos(playerid, pX, pY, pZ);


Just giving you example, because i don't know much about Y_INI or DINI, could've handled MySQL.


Re: Something wrong in my login/register system - Heress - 23.06.2018

Quote:
Originally Posted by div
Посмотреть сообщение
OnPlayerDisconnect,

Use this

new FloatX, FloatY, FloatZ
GetPlayerPos(playerid, pX, pY, pZ)

Then save them individually in the ENUM pX, pY, pZ

dini_intset(Accounts, "pX", pX)
dini_intset(Accounts, "pY", pY)


^ like this

and when a PLAYER CONNECTS



SetPlayerPos(playerid, pX, pY, pZ);


Just giving you example, because i don't know much about Y_INI or DINI, could've handled MySQL.
Can You show me how it looks in pawno?


Re: Something wrong in my login/register system - RowdyrideR - 23.06.2018

you actually need to load your position from the files when logging in...

i guess its

Код:
Float:dini_Float(const filename[], const key[]);
On player login so the player actually spawns in that position.


Re: Something wrong in my login/register system - Heress - 23.06.2018

And where exactly I have write this?


Re: Something wrong in my login/register system - RowdyrideR - 23.06.2018

Where ever the player logins in.


Re: Something wrong in my login/register system - Heress - 24.06.2018

https://imgur.com/a/b0uWDdW

stock Login
{
......
}

Here?


Re: Something wrong in my login/register system - GTLS - 24.06.2018

Saving of Location should be done under OnPlayerDisconnect not at the place where he logs in.


Re: Something wrong in my login/register system - Heress - 24.06.2018

Quote:
Originally Posted by GTLS
Посмотреть сообщение
Saving of Location should be done under OnPlayerDisconnect not at the place where he logs in.
Like this?:
https://imgur.com/a/gvaRsO6


Re: Something wrong in my login/register system - GTLS - 24.06.2018

Quote:
Originally Posted by Heress
Посмотреть сообщение
https://imgur.com/a/b0uWDdW

stock Login
{
......
}

Here?
Yes there, but dini_float is a already defined function inside dini. You dont have to re-declare it. Also, if you want to continue using dini, I'd suggest use Gammix's version of Dini2. Its way faster with same syntax.

https://sampforum.blast.hk/showthread.php?tid=611399 - This is the Gammix's Dini2.inc


Quote:

I was clear with "Loading" the position not saving...

Sorry about that, miss read.