24.10.2017, 15:54
Hello, I work to a commnad that applied only for offline users, i have something like this:
But i don't know if i need to use mysql_real_escape_string(id, escape); if i already call the function using mysql_tquery. Or to use in the function
Basically, the commnad i used to change didn't call any function it was just a command and now I want to call a function to be more quickly when I use this function from somewhere else.
If someone can help, please post here.
Код:
CMD:auninviteoff(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first."); if(PlayerInfo[playerid][pAdmin] >= 4) { new id, fp, reason, string[MAX_STRING]; if(sscanf(params, "s[30]is[64]", id, fp, reason)) return SCM(playerid, -1, "Usage: /auninviteoff [name] [fp] [reason]"); mysql_real_escape_string(id, escape); mysql_format(SQL, string, sizeof string, "SELECT * FROM `users` WHERE `name` = '%s'", escape); mysql_tquery(SQL, string, "doUninviteAdminOff", "dsds", playerid, id, fp, reason); } return 1; }
Код:
function doUninviteAdminOff(playerid, id, fp, reason[]) { mysql_real_escape_string(id, escape); }
If someone can help, please post here.