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 Float  X, Float  Y, Float  Z
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
|
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.