27.07.2016, 07:44
Код:
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\filterscripts\MySql.pwn(73) : error 035: argument type mismatch (argument 1) C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\filterscripts\MySql.pwn(74) : error 017: undefined symbol "mysql_store_result" C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\filterscripts\MySql.pwn(75) : error 017: undefined symbol "mysql_num_rows" C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\filterscripts\MySql.pwn(77) : error 017: undefined symbol "string" C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\filterscripts\MySql.pwn(77) : error 017: undefined symbol "string" C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\filterscripts\MySql.pwn(77) : error 029: invalid expression, assumed zero C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\filterscripts\MySql.pwn(77) : fatal error 107: too many error messages on one line
Код:
new Query[200],pName[24]; GetPlayerName(playerid,pName,24); format(Query,sizeof(Query),"SELECT `Username` FROM `users` WHERE `Username` = '%s' LIMIT 1",pName); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() != 0)//if number of rows is different from 0 then continue { format(string,sizeof(string),"Zdravo, %s! \nTvoj nalog je registrovan.\nMolimo unesite lozinku za prijavu!",pName); ShowPlayerDialog(playerid,0,DIALOG_STYLE_INPUT,"Lo g in",string,"Login",""); } else { format(string,sizeof(string),"Zdravo, %s! \nTvoj nalog nije registrovan. \nRegistrujte se da bi ste nastavili!",pName); ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Re gister",string,"Register",""); } mysql_free_result();
Код:
stock LoginPlayer(playerid,const password[]) { new EscapedText[60]; mysql_real_escape_string(password, EscapedText); format(Query,sizeof(Query),"SELECT * FROM `users` WHERE `Username` = '%s' AND `Password` = '%s'",GetPName(playerid),EscapedText); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() != 0) { SendClientMessage(playerid,green,"Uspesno si se prijavio!"); LoadStats(playerid); } else { SendClientMessage(playerid,red,"Pogresna lozinka!"); Kick(playerid); } mysql_free_result(); return 1; } stock LoadStats(playerid) { new pName[24],Query[80]; GetPlayerName(playerid,pName,24); format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `Username` = '%s' ", pName); mysql_query(Query); mysql_store_result(); mysql_fetch_row_format(Query, "|"); sscanf(Query, "e<p<|>s[24]s[23]i>", PInfo[playerid]); mysql_free_result(); GivePlayerMoney(playerid,PInfo[playerid][Money]); return 1; }