Something wrong in my login/register system
#1

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

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

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?
Reply
#4

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

And where exactly I have write this?
Reply
#6

Where ever the player logins in.
Reply
#7

https://imgur.com/a/b0uWDdW

stock Login
{
......
}

Here?
Reply
#8

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

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
Reply
#10

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


Forum Jump:


Users browsing this thread: 2 Guest(s)