Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/offmakeadmin", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pAdmin] > 5)
- {
- 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}Folosire:{FFFFFF} /offmakeadmin [NUMELE-EXACT]");
- return 1;
- }
- new Query[256];
- format(Query, sizeof(Query), "SELECT `username` FROM `players` WHERE username = '%s' AND Admin > 0 LIMIT 1", (result));
- mysql_query(string);
- mysql_store_result();
- if(!mysql_num_rows())
- {
- format(string, sizeof(string), "Nu este nimeni cu numele %s inregistrat/cu admin!", (result));
- mysql_free_result();
- return SendClientMessage(playerid, 0xEF5C5CFF, string);
- }
- else if(mysql_num_rows() != 0)
- {
- format(Query, sizeof(Query), "UPDATE `players` SET `Admin` = 0 WHERE username = '%s'", (result));
- mysql_query(string);
- mysql_store_result();
- format(string, sizeof(string), "{0066FF}[Info:] {FFFFFF}%s nu mai este admin!", (result));
- ABroadCast(0xa9c4e4FF, string, 1);
- mysql_free_result();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement