06.05.2017, 01:17
I have this command, when I remove the overflow it works perfectly although can go over string limit of 'MAX_PLAYER_NAME' - 24.
This crashes the server, so i'm just starting to add these overflow things in to all my commands although this particular command just keep showing the scp...
Also am I using an outdated sscanf?
my version: https://pastebin.com/jew8sFh2
This crashes the server, so i'm just starting to add these overflow things in to all my commands although this particular command just keep showing the scp...
PHP код:
forward OnAccountUnsuspended(adminID);
public OnAccountUnsuspended(adminID) {
new rows;
cache_get_row_count(rows);
if(rows) {
} else return SendError(playerid, "Couldn't find the selected account.");
return 1;
}
COMMAND:unsuspend(playerid, params[]) {
if(!PlayerInfo[playerid][aAdmin] && !PlayerInfo[playerid][aHelper]) return SendError(playerid, CANT_USE_CMD);
new iPlayer[MAX_PLAYER_NAME];
if(sscanf(params, "s[" #MAX_PLAYER_NAME "]", iPlayer)) return SCP(playerid, "< Full_Name >");
if(!IsPlayerConnected(GetPlayerId(iPlayer))) {
new iQuery[159]; mysql_format(Pipeline, iQuery, sizeof(iQuery), "SELECT `ID`, `AccountID`, `CharName` FROM `pInfo` WHERE `CharName` = '%e' LIMIT 1", iPlayer);
mysql_tquery(Pipeline, iQuery, "OnAccountUnsuspended", "d", playerid);
} else return SendError(playerid, CANT_FIND_PLAYER);
return 1;
}
my version: https://pastebin.com/jew8sFh2