18.08.2018, 13:47
In your command, although you may need to adapt the following code to suit your gamemode's variables and database.
Then somewhere in your code, the "OnCheckPhoneNumber" or whatever name you'll change it to
Код:
mysql_format(your_myql_handle, query, sizeof(query), "SELECT * FROM `your_table_name_here` WHERE `phoneNumbervariablename` = '%d' LIMIT 1", number); mysql_pquery(your_mysql_handle, query, "OnCheckPhoneNumber", "i", playerid);
Код:
forward OnCheckPhoneNumber(playerid); public OnCheckPhoneNumber(playerid) { new rows; cache_get_row_count(rows); // get the amount of rows from the query if(rows > 0) //if the amount of rows is greater than 0, so there is someone that has this same phone number, then { // generate a new number phone } return 1; }