23.10.2016, 21:34
Hello, i have made an ask system where admins can check last asks.
Now the problem is that when i execute delete ask it wont do anything.
Here is my code.
Now the problem is that when i execute delete ask it wont do anything.
Here is my code.
Код:
COMMAND:dask(playerid,params[]) { if(IsPlayerAdmin(playerid)){ if(isnull(params)) return SendClientMessage(playerid,-1,"usage /dask [name]"); new Query[250]; mysql_format(MySQLPipeline, Query, sizeof(Query),"SELECT * FROM `asks` WHERE `Name` = '%e'",params); // read player account mysql_tquery(MySQLPipeline, Query, "Deleteask", "i", playerid); // to read if player account exist } else return SendClientMessage(playerid,-1,"ERROR:You should be rcon to use this command"); return 1; } forward Deleteask(playerid); public Deleteask(playerid) { new rows, fields; cache_get_data(rows, fields, MySQLPipeline); if(rows) { new Query[250],Name1[MAX_PLAYER_NAME+1]; cache_get_field_content(0, "Name", Name1, MySQLPipeline, sizeof(Name1)); format(Query, 100, "DELETE FROM `ask` WHERE `Name` = '%s'", Name1); mysql_tquery(MySQLPipeline, Query, "", ""); SendClientMessage(playerid,-1,"Ask Successfully Deleted"); } if(!rows) { return SendClientMessage(playerid,-1,"Name Not Exist on database"); } return 1; }