17.02.2018, 14:34
Hello i am creating a command which deletes a players pincode.
The command works like this:
My question is, how do i check if the player table exists? so i can return a message like this player does not exist.
The command works like this:
PHP код:
if(!IsPlayerAdmin(playerid)) return ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Oops...", "You are not authorized to use this command", "OK", "");
if(strlen(params) <2) return SendClientMessage(playerid, -1, "USAGE: /deletepincode [PlayerName]");
new DBResult:CLEAR_RESULT;
new szQuery[128];
format(szQuery, sizeof(szQuery), "delete from `PINCODES` where `PlayerName` = '%s'", DB_Escape(params));
CLEAR_RESULT = db_query(PIN_DATABASE, szQuery);
db_free_result(CLEAR_RESULT);