SA-MP Forums Archive
Is this correct? - 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: Is this correct? (/showthread.php?tid=626352)



Is this correct? - eikzdej - 14.01.2017

http://pastebin.com/raw/2bHhymXw

If someone tell me which line is wrong. Please provide a fix for it. thank you!


Re: Is this correct? - jamesbond007 - 14.01.2017

line 1: Error, this is a private paste. If this is your private paste, please login to Pastebin first.


Re: Is this correct? - eikzdej - 14.01.2017

Quote:
Originally Posted by jamesbond007
Посмотреть сообщение
line 1: Error, this is a private paste. If this is your private paste, please login to Pastebin first.
Hahah! Wait let me fix it.


Re: Is this correct? - jamesbond007 - 14.01.2017

whats the problem? does it compile? are u forgetting to call mysql_tquery on query2?


Re: Is this correct? - eikzdej - 14.01.2017

The connection of sql is successful, but the real problem is the data is not saved in sql

Here's the script.

http://pastebin.com/raw/D64RnmAR

And also I want to removed the Password Hash.


Re: Is this correct? - Lordzy - 14.01.2017

Quote:
Originally Posted by eikzdej
Посмотреть сообщение
The connection of sql is successful, but the real problem is the data is not saved in sql

Here's the script.

http://pastebin.com/raw/D64RnmAR

And also I want to removed the Password Hash.
Why wouldn't you want to hash your passwords? Post your MySQL logs so that we can know what's the cause or else it'll be a mess to look into your whole script.


Re: Is this correct? - eikzdej - 14.01.2017

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
Why wouldn't you want to hash your passwords? Post your MySQL logs so that we can know what's the cause or else it'll be a mess to look into your whole script.
Here: http://pastebin.com/raw/k4jGVMKW


Re: Is this correct? - Lordzy - 14.01.2017

pawn Код:
mysql_format(mysql, query, sizeof(query),
                "INSERT INTO `account_data` (`Name`, `Password`, `IP`) VALUES ('%e', '%e', '%e')", playername, Account[playerid][Password], playerip);
            mysql_format(mysql, query2, sizeof(query2),
                "INSERT INTO `character_data` (`Name`, `Admin_Level`, `VIP_Level`, `Character_Level`, `Money`, `Skin`, `Health`, `Armour`, `PosX`, `PosY`, `PosZ`, `PosA`) VALUES ('%e', 0, 0, %d, %d, %d, 100.00, 0.00, %f, %f, %f, %f)", playername, STARTING_LEVEL, STARTING_MONEY, STARTING_SKIN, STARTING_SPAWN_X, STARTING_SPAWN_Y, STARTING_SPAWN_Z, STARTING_SPAWN_A);
            mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
You must increase your "query" array size. It's getting out of bounds here. Secondly, you need to query twice since you're formatting it twice here. You need to insert into two tables, so after your first format, query it and then format the second one for the next query.


Re: Is this correct? - eikzdej - 14.01.2017

Код:
           mysql_format(mysql, query, sizeof(query),
				"INSERT INTO `account_data` (`Name`, `Password`, `IP`) VALUES ('%e', '%e', '%e')", playername, Account[playerid][Password], playerip);
			mysql_format(mysql, query2, sizeof(query2),
				"INSERT INTO `character_data` (`Name`, `Admin_Level`, `VIP_Level`, `Character_Level`, `Money`, `Skin`, `Health`, `Armour`, `PosX`, `PosY`, `PosZ`, `PosA`) VALUES ('%e', 0, 0, %d, %d, %d, 100.00, 0.00, %f, %f, %f, %f)", playername, STARTING_LEVEL, STARTING_MONEY, STARTING_SKIN, STARTING_SPAWN_X, STARTING_SPAWN_Y, STARTING_SPAWN_Z, STARTING_SPAWN_A);
            mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
            mysql_tquery(mysql, query2, "OnAccountRegister", "i", playerid);
I did like this, but still not working. And also I increase the query array size to 512


Re: Is this correct? - iLearner - 14.01.2017

Delete the mysql_log file & start the server and try to register & show us fresh log file.