30.07.2016, 20:15
(
Последний раз редактировалось ubunttu; 31.07.2016 в 00:22.
)
Someone could help me to fix it? See if player exist in MYSQL DB?
Why every time is going to:
Even if this player exist...
What i'm doing worng?
CODE:
Why every time is going to:
Код:
else { QuemReferenciou(playerid); SendClientMessage(playerid, COLOR_LIGHTRED, "THIS PLAYER IS NOT FOUND!"); }
What i'm doing worng?
CODE:
Код:
else if(dialogid == 28) { new nlocalreffer[30]; if(!response) { SendClientMessage(playerid, -1, "YOU SELECT NO... SO NO ONE REFFER YOU!"); nlocalreffer = "Empty"; reffer[playerid] = nlocalreffer; firstlogin[playerid] = false; ChangeClass(playerid); } else if(response) { if(!strlen(inputtext)) { SendClientMessage(playerid, -1, "YOU DONT WRITE A NAME... SO NO ONE REFFER YOU!"); nlocalreffer = "Empty"; reffer[playerid] = nlocalreffer; firstlogin[playerid] = false; ChangeClass(playerid); } else { format(nlocalreffer, sizeof nlocalreffer, inputtext); if(!strcmp(nlocalreffer, PlayerName(playerid), true)) { SendClientMessage(playerid, COLOR_LIGHTRED, "YOU CAN NOT PUT YOUR OWN NAME!"); QuemReferenciou(playerid); return 1; } else { // sucesso new Nameid[30], refferquery[160]; format(nlocalreffer, sizeof nlocalreffer, inputtext); mysql_format(ConnectMYSQL, refferquery, sizeof refferquery, "SELECT `Username` FROM accounts WHERE Username = '%s' LIMIT 1", Nameid); mysql_tquery(ConnectMYSQL, refferquery, "CheckRefferExist", "iss", playerid, Nameid, nlocalreffer); } } } }
Код:
forward CheckRefferExist(playerid, nrinput[30]); public CheckRefferExist(playerid, nrinput[30]) { if(cache_get_row_count(ConnectMYSQL) == 1) { reffer[playerid] = nrinput; new string[80]; format(string, sizeof(string), "Your reffer: %s!", reffer[playerid] ); SendClientMessage(playerid, COLOR_LIGHTRED, string); firstlogin[playerid] = false; ChangeClass(playerid); } else { QuemReferenciou(playerid); SendClientMessage(playerid, COLOR_LIGHTRED, "THIS PLAYER IS NOT FOUND!"); } return 1; }
Код:
forward QuemReferenciou(playerid); public QuemReferenciou(playerid) { ShowPlayerDialog(playerid,28, DIALOG_STYLE_INPUT, "Reffer", "A player from the server called you here to play?\nNo? Leave this question blank box\nYes? Insert him name inside box!\n\n\nCall people to play here and earn rewards when your guest get some experience points\n====================================\n10 exp = 5.000$\n30 exp = 15.000$\n60 exp = 30.000$\n100 exp = 1 VIP days\n150 exp = 3 VIP days\n300 exp = 7 VIP days\n====================================", "Yes", "No"); }