13.12.2012, 04:36
Ok this was my last resort.
Our script has ALWAYS compiled just fine. Then we discovered a security flaw in one of the Admin commands.
One thing is missing from here, and I hate to say it, but the admin restriction wasn't added. (Not my fault, actually)
I've tried in many ways to add the Admin Level restriction to where only a set admin level would use this command, and no matter what, either the pawno compiler crashes, or it throws me errors in other lines of the script that have nothing to do with this command. (Which is why I hate coding in the first place, but i do try)
So here's the thing, if(PlayerInfo[playerid][pAdmin] >= 1) should be added, but whenever I do it, Pawno Crashes
Any help would be greatly appreciated
Our script has ALWAYS compiled just fine. Then we discovered a security flaw in one of the Admin commands.
Код:
if(strcmp(cmd, "/unban", true) == 0) { if(IsPlayerConnected(playerid)) { new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[128]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Usage:{FFFFFF} /unban [EXACT_NAME]"); return 1; } new Query[256]; format(Query, sizeof(Query), "SELECT `username` FROM `players` WHERE username = '%s' AND Registered = -999 LIMIT 1", (result)); mysql_query(Query); mysql_store_result(); if(!mysql_num_rows()) { format(string, sizeof(string), "Nobody with the name %s is banned!", (result)); mysql_free_result(); return SendClientMessage(playerid, 0xDC0C0CFF, string); } else if(mysql_num_rows() != 0) { format(Query, sizeof(Query), "UPDATE `players` SET `Registered` = 1 WHERE username = '%s'", (result)); mysql_query(Query); mysql_store_result(); format(string, sizeof(string), "{DC0C0C}[Info:] {FFFFFF}%s got unbanned!", (result)); ABroadCast(0xa9c4e4FF, string, 1); mysql_free_result(); } } }
I've tried in many ways to add the Admin Level restriction to where only a set admin level would use this command, and no matter what, either the pawno compiler crashes, or it throws me errors in other lines of the script that have nothing to do with this command. (Which is why I hate coding in the first place, but i do try)
So here's the thing, if(PlayerInfo[playerid][pAdmin] >= 1) should be added, but whenever I do it, Pawno Crashes
Any help would be greatly appreciated