CMD:setoffrobrank(playerid, params[]) {
new
mString[112],
pName[24],
Amount,
DBResult:Result,
Query[90]
;
if(PlayerInfo[playerid][AdminLevel] < 4) return SendClientMessage(playerid, -1, "{FFFFFF}* {00C0FF}You're not a high enough level to use this command!");
if(sscanf(params, "s[24]i", pName, Amount)) return SendClientMessage(playerid, COLOR_NOTES, "USAGE: /setoffrobrank [UserName] [Amount]");
format(Query, sizeof(Query), "SELECT * FROM `USERS` WHERE `NAME` = '%s'", pName);
Result = db_query(CnR,Query);
if(!db_num_rows(Result))
{
format(mString, sizeof(mString), "ERROR: No account(s) with '%s' has been found.", pName);
SendClientMessage(playerid, COLOR_NOTES2, mString);
return 1;
}
else
{
format(Query, sizeof(Query), "UPDATE `USERS` WHERE `NAME` = '%s' SET `ROB` = '%i'", pName, Amount);
Result = db_query(CnR, Query);
if(Result)
{
format(mString, sizeof(mString), "NOTE: %s's rob-rank has been successfully set to %i!", pName, Amount);
SendClientMessage(playerid, COLOR_NOTES, mString);
}
else
{
format(mString, sizeof(mString), "NOTE: %s's rob-rank has NOT been set to %i!", pName, Amount);
SendClientMessage(playerid, COLOR_NOTES2, mString);
}
db_free_result(Result);
}
mString = "\0", Query = "\0", pName = "\0";
return 1;
}
UPDATE `USERS` SET `ROB` = '%i' WHERE `NAME` = '%s'
Try:
Код:
UPDATE `USERS` SET `ROB` = '%i' WHERE `NAME` = '%s' |