15.02.2014, 09:28
Код:
YCMD:setadminoff(playerid, params[],help) { if(PlayerData[playerid][Admin] < 6) return SendClientMessage(playerid, COLOR_WHITE, AdminOnly); new level,vname[25],query[128]; if(sscanf(params, "s[25]i", vname, level)) return SendUsage(playerid,"/setadminoff <Exact Name> <level>"); if(level > 6 || level < 0) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Invalid admin level."); mysql_format(SQL, query, 128, "SELECT `id` FROM `users` WHERE LOWER(username) = LOWER('%s') LIMIT 1",vname); mysql_tquery(SQL, query, "AdminOff", "s[25]ii", vname,level,playerid); return 1; } function AdminOff(vname[],level,playerid) { new str[128], string[128]; if(cache_num_rows() == 0) return SendClientMessage(playerid, COLOR_WHITE,"{FFFFCC}Error: [MYSQL]Player doesn't exist."); format(string, sizeof(string), "You have promoted %s to a level %d admin. (offline)", vname,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "AdmCmd: %s has promoted %s to a level %d admin. (offline)", PlayerData[playerid][Name], vname,level); ABroadCast(COLOR_LIGHTBLUE, string, 1); mysql_format(SQL, str,128,"UPDATE `users` SET `Admin`='%d' WHERE `username`='%s' LIMIT 1",level,vname); mysql_tquery(SQL, str, "", ""); return 1; }
Quote:
mysql_tquery ERROR callback parameter count does not match format specifier length |