Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Mysql creating accounts problem

$
0
0
I used this tutorial(http://forum.sa-mp.com/showthread.php?t=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
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);

and this is my OnAccountRegister
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;
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>