05.06.2011, 02:47
Hello, i am kind of trying to do a register, login system on mys server, and i have a problem, because when it checks the player, it doesn't change SaskYra = 0 it changes it to 1, but i am not registered, and then it shows me the login dialog. Here's the script:
onplayerconnect
bottom of script
Dialog response, its after agreeing to server rules.
The server somehow sets SaskYra to 1, but i am not registered... Could you help me fix this, or make another way? :/
onplayerconnect
Код:
GetPlayerName(playerid, ZStats[playerid][Vardas], MAX_PLAYER_NAME); if(CheckAccountExists(ZStats[playerid][Vardas])) SaskYra[playerid] = 1; else SaskYra[playerid] = 0;
Код:
CheckAccountExists(account[]) { new string[128]; format(string, sizeof(string), "SELECT * FROM Saskaitos WHERE Vardas = '%s'", account); mysql_query(string); mysql_store_result(); new value; value = mysql_num_rows(); mysql_free_result(); return value; }
Код:
if(dialogid == 0) //Jei dialogid bus lygus 0 { new vardas[MAX_PLAYER_NAME], string[180]; GetPlayerName(playerid, vardas, sizeof(vardas)); if(response) { if(SaskYra[playerid] == 1) { format(string, sizeof(string), "{FFFFFF}Zaidejas {FFAF00}%s {FFFFFF}yra registruotas.\n{FFFFFF}Iveskite slaptazodi noredami prisijungti:",vardas); ShowPlayerDialog(playerid,200,DIALOG_STYLE_INPUT,"{A3E4FF}Prisijungimas",string,"Prisijungti","Atsaukti"); } else if(SaskYra[playerid] == 0) { format(string, sizeof(string), "{FFFFFF}Zaidejo {FFAF00}%s {FFFFFF}registracija.\n{FFFFFF}Iveskite norima slaptazodi:",vardas); ShowPlayerDialog(playerid,201,DIALOG_STYLE_INPUT,"{A3E4FF}Registracija",string,"Registruotis","Atsaukti"); } } else { SendClientMessage(playerid, raudona, "[FunZoneLT]>> Jus turite sutikti su taisyklemis, pries zaidziant!"); Kick(playerid); } }