17.08.2011, 23:07
Seems like when I fix one problem, another appears.
I'm wondering why this code still allows everyone to use the command, even if their not RCON or set as admin from playerfile:
Also seems like this /ooc and /controlOOC are bugged, it allows me to use /controlooc even as normal player and it doesn't even disable the channel :S.
And I have this on top of the GM:
Also yes, I do have an enum and that stuff for Admin etc with register and login blabla, like this:
I'm wondering why this code still allows everyone to use the command, even if their not RCON or set as admin from playerfile:
Код:
CMD:setvip(playerid, params[]) { new id, lvl, string[128], string2[128]; if(IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 3) { if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_RED, "Usage: /setvip [ID] [Level]"); else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid ID"); else if(lvl > 3) return SendClientMessage(playerid, COLOR_RED, "Correct levels: 1 | 2 | 3"); else pInfo[id][VIP] = lvl; format(string, sizeof(string), "%s has set you to VIP level %d!", GetName(playerid), lvl); SendClientMessage(id, COLOR_RED, string); format(string2, sizeof(string2), "You have set %s to VIP level %d!", GetName(id), lvl); SendClientMessage(playerid, COLOR_RED, string2); } else { SendClientMessage(playerid, COLOR_RED, "You are not authorized to use this command!"); } return 1; }
Quote:
CMD(playerid, params[]) { if ((NO_OOC) && pInfo[playerid][Admin] < 1) { SendClientMessage(playerid, COLOR_RED, "The OOC channel has been disabled by an Admin!"); return 1; } new string[128], playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playernam e)); if (isnull(params)) return SendClientMessage(playerid, COLOR_RED, "{C0C0C0}USAGE: /o < message >"); format(string, sizeof(string), "(( GLOBAL OOC: %s: %s", playername, params); SendClientMessageToAll(COLOR_OOC, string); return 1; } // DISABLE OOC CMD:controlooc(playerid, params[]) { if (pInfo[playerid][Admin] >= 2 && (!NO_OOC)) { NO_OOC = 1; SendClientMessageToAll(COLOR_RED, "The OOC Chat channel has been disabled by an Admin!"); } else if (pInfo[playerid][Admin] >= 2 && (NO_OOC)) { NO_OOC = 0; SendClientMessageToAll(COLOR_RED, "The OOC Chat channel has been enabled by an Admin!"); } else { SendClientMessage(playerid, COLOR_RED, "You are not authorized!"); } return 1; } |
Quote:
new NO_OOC = 1; |
Код:
enum iDetails { Pass, Cash, Score, Admin, VIP, Kills, Deaths, Online, Float:pLastX, Float:pLastY, Float:pLastZ }; new pInfo[MAX_PLAYERS][iDetails];