03.04.2017, 23:08
Hello guys im trying to adapt this tutorial in r33 mysql plugin.
I know both r33 and that tutorial is too much old but i want to spend some time on it as im a noob on scripting im trying to understand too.
I will share my code and what it was in tutorial and we can go on if anyone wants to help.
My Code:
i dont know if this cache_get_row_count will work because we didnt use any cached string by the cache function how can i fix that?
also
i dont know what on earth this code means or how it works(wth sscanf?) and i cant translate it to new type codes.
I know both r33 and that tutorial is too much old but i want to spend some time on it as im a noob on scripting im trying to understand too.
I will share my code and what it was in tutorial and we can go on if anyone wants to help.
My Code:
Код:
new Query[80],pName[24]; GetPlayerName(playerid,pName,24); mysql_format(Myhandle,Query,sizeof(Query),"SELECT Username FROM Users WHERE Username = '%d'",pName); mysql_tquery(Myhandle,Query); if (cache_get_row_count() != 0) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Welcome to SS-RP. Please Login.", "", "Login", "Cancel"); } else if (cache_get_row_count() == 0) { ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Welcome to SS-RP. Please Register.", "", "Register", "Cancel"); }
also
Код:
mysql_fetch_row_format(Query, "|"); sscanf(Query, "e<p<|>s[24]s[23]i>", PInfo[playerid]); mysql_free_result(); GivePlayerMoney(playerid,PInfo[playerid][Money]);