31.01.2014, 21:12
Hi, the accounts didn't save in the database why?? This is my OnDialogReponse:
pawn Code:
if(dialogid == DIALOG_REGISTER)
{
if(!response)
{
SendClientMessage(playerid, COLOR_DARKRED, "Ai primit kick pentru ca nu ai introdus nicio parola.");
Kick(playerid);
}
if(response)
{
if(strlen(inputtext) <= 4)
{
new pName[24];
new string[164];
GetPlayerName(playerid, pName, 24);
SendClientMessage(playerid, COLOR_DARKRED, "Parola ta trebuie sa fie mai mare de 4 caractere.");
format(string, sizeof(string), "Welcome to the server, %s!\nPlease enter your paassword to register!", pName);
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", string, "Register", "Cancel");
}
else
{
new EscapedText[60];
new Query[80];
new pName[24];
GetPlayerName(playerid, pName, 24);
mysql_real_escape_string(inputtext, EscapedText);
format(Query, sizeof(Query), "INSERT INTO `conturi` (Password, Username, Level, AdminLevel, Job, HelperLevel, Money) VALUES ('%s', '%s', 1, 0, 0, 0, 10000)", EscapedText, pName);
mysql_query(Query);
GivePlayerMoney(playerid, 10000);
SetPlayerScore(playerid, 1);
SetPlayerColor(playerid, COLOR_WHITE);
SpawnPlayer(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "Bine ai venit pe Flame RPG.");
SendClientMessage(playerid, COLOR_YELLOW, "Daca ai nevoie de ajutor foloseste /n si un helper te va ajuta.");
SendClientMessage(playerid, COLOR_YELLOW, "Foloseste /help pentru a vedea o lista cu comenzile server-ului.");
SendClientMessage(playerid, COLOR_YELLOW, "Daca ai o problema tehnica foloseste /report si un admin te va ajuta.");
}
}
}