16.06.2016, 20:40
I used this tutorial(https://sampforum.blast.hk/showthread.php?tid=574714) so to convert my script to mysql however,I got a problem that i can register only one account with the ID 0 and when I try to register with another accounts it lets me register and login but the account is created in the database.
This on responding to register dialog
and this is my OnAccountRegister
This on responding to register dialog
Code:
GetPlayerName(playerid, playername, sizeof(playername)); GetPlayerIp(playerid, playerip, sizeof(playerip)); WP_Hash(Player[playerid][Password], 129, inputtext); mysql_format(koneksi, query, sizeof(query), "INSERT INTO `users` (`Name`, `Password`, `IP`, `Bankcash`, `Money`) VALUES ('%e', '%e', '%e' ,50000, 30000)", playername, Player[playerid][Password], playerip); mysql_tquery(koneksi, query, "OnAccountRegister", "i", playerid);
Code:
forward OnAccountRegister(playerid); public OnAccountRegister(playerid) { Player[playerid][pIDs] = cache_insert_id(); printf("[Registration] New account registered. Database ID: [%d]", Player[playerid][pIDs]); return true; }