25.10.2010, 11:16
Register dialog and function its here, MYSQL tables.
MYSQL Configration its ok because i can open in phpmyadmin account and i can login to game. But i cant register in game. If i register, doing "Islem Tamamlandi / Done" but not INSERT tables to values.
PHP код:
if(dialogid == 14600)
{
if(response)
{
if(!strlen(inputtext)) //If the player doesn't enter a pass
{
ShowPlayerDialog(playerid, 14600, DIALOG_STYLE_INPUT , "Kayit Ol", "Hesabiniz sistemimizde kayıtlı değil, lьtfen kayıt olun.", "Kayit Ol", "Iptal");
SendClientMessage(playerid, 0xF60000AA, "[R]: Lutfen sifrenizi giriniz.");
}
new PIP[50];
new Query[200], Pname[24];
GetPlayerName(playerid, Pname, 24); //Players name
new escpname[24], escpass[100];
mysql_real_escape_string(inputtext, escpass);
mysql_real_escape_string(Pname, escpname); //escapes the string so you cant MySQL inject
GetPlayerIp(playerid, PIP, 50); //Players IP
format(Query, sizeof(Query), "INSERT INTO `oyuncular` (`oyuncuadi`, `sifre`, `adminlevel`, `viplevel`, `score`, `onlinesure`, `jailsure`, `olumsayisi`, `killsayisi`, `para`, IP) VALUES ('%s', '%s', 0, 0, 0, 0, 0, 0, 0, 0, '%s')", escpname, escpass, PIP); //Insert string
mysql_query(Query); //Queries
GameTextForPlayer(playerid, "~g~Islem Tamamlandi", 2000, 3);
SendClientMessage(playerid, 0x0000D9AA, "[R] Kaydiniz yapildi ve hesabiniza giris yapildi.");
SetPVarInt(playerid, "Logged", 1);
}
}