SA-MP Forums Archive
Register problem - 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: Register problem (/showthread.php?tid=487073)



Register problem - anou1 - 11.01.2014

Hi,


I have a problem with my register system
When I register for the first time, and I walk, normally, when I disconnect, It saves my position.
But It doesnt, I have to disconnect/reconnect, and then it will save my position next time I disconnect.


Register point= A
I don't know if I'm clear but, When I register, it spawn me for exemple at point A, I walk to point B and disconnect.
When I reconnect it spawns me at point A. But if I walk to point B and then disconnect, when I will reconnect, it will spawn me at the good place.


So there's a problem with my register system I think, but where ?


I can't find how to solve this. Please help me.

Pastbin: http://pastebin.com/2RwHC3j9


If you need the entire pastbin, just tell me.


Re: Register problem - anou1 - 12.01.2014

UP please, I can't solve this


Re: Register problem - anou1 - 12.01.2014

Sorry for the UP, but I got some new informations:


Код:
        case 2: //register dialog
        {
            if(!response) return Kick(playerid); //if they clicked Quit, we will kick them
            if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "S'enregistrer", "Ton mot de passe doit faire plus de 6 caractиres !", "S'enregistrer", "Quitter");
			if(strlen(inputtext) > 24) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "S'enregistrer", "Ton mot de passe doit faire moins de 24 caractиres !", "S'enregistrer", "Quitter");
            //strlen checks a lenght of a string. so if player types their password that is lower than 6, we tell them; Your password must be at least 6 characters long!
            WP_Hash(pInfo[playerid][Password], 129, inputtext); //hashing inputtext
            mysql_format(mysql, query, sizeof(query), "INSERT INTO `joueurs` (`Username`, `Password`, `IP`, `Admin`, `VIP`, `Argent`, `posX` ,`posY`, `posZ`, `Interieur`, `World`, `Skin`, `Niveau`) VALUES ('%e', '%s', '%s', 0, 0, 1000, 1527.5634, -1738.9218, 13.5469, 0, 0, 26, 1)", Name[playerid], pInfo[playerid][Password], IP[playerid]);
            //Now let's create a new row and insert player's information in it
            mysql_tquery(mysql, query, "", "");
            //let's execute the query
			printf("%f %f %f %d ",pInfo[playerid][posX], pInfo[playerid][posY], pInfo[playerid][posZ], pInfo[playerid][Argent]);
			SetSpawnInfo( playerid, 0, 26, 1527.5634,-1738.9218,13.5469, 0.0, 0, 0, 0, 0, 0, 0 );
			SetPlayerScore(playerid,pInfo[playerid][Niveau]);
			TogglePlayerSpectating(playerid, 0);
			SpawnPlayer(playerid);
        }

On the printf I can see on my console "0 0 0 0"

But before with a query, I've updated the informations. So The information has not been recovered right ?

How could I solve this please ?

Cause now, I'm stuck.


Thank you.