CMD: o(playerid, params[]) { if(gPlayerLogged{playerid} == 0) { SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in."); return 1; } if ((noooc) && (PlayerInfo[playerid][pAdmin] < 2 && EventKernel[EventCreator] != playerid && PlayerInfo[playerid][pDonateRank] < 6 && !OOCPower[playerid] && PlayerInfo[playerid][pHelper] < 4)) { SendClientMessageEx(playerid, COLOR_GRAD2, " The OOC channel has been disabled by an Admin!"); return 1; } if(gOoc[playerid]) { SendClientMessageEx(playerid, TEAM_CYAN_COLOR, " You have disabled OOC Chat, re-enable with /togooc!"); return 1; } if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/o)oc [ooc chat]"); if(PlayerInfo[playerid][pAdmin] == 1) { new string[128]; format(string, sizeof(string), "(( Moderator %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); } else if(PlayerInfo[playerid][pAdmin] >= 2) { new string[128]; format(string, sizeof(string), "(( Administrator %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); } else if(PlayerInfo[playerid][pAdmin] >= 999999) { new string[128]; format(string, sizeof(string), "(( Server Owner %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); } else if(PlayerInfo[playerid][pHelper] >= 2) { new string[128]; format(string, sizeof(string), "(( Community Advisor %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); return 1; } else if(PlayerInfo[playerid][pDonateRank] == 6) { new string[128]; format(string, sizeof(string), "(( Special Moderator %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); return 1; } else if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pHelper] <= 2) { new string[128]; format(string, sizeof(string), "(( %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); return 1; } return 1; } |
else if(PlayerInfo[playerid][pAdmin] >= 2)
else if(2 <= PlayerInfo[playerid][pAdmin] < 999999)
else if(PlayerInfo[playerid][pAdmin] >= 2)
{
new string[128];
format(string, sizeof(string), "(( Administrator %s: %s ))", GetPlayerNameEx(playerid), params);
OOCOff(COLOR_OOC,string);
}
CMD: o(playerid, params[]) { new AdminRank; AdminRank = PlayerInfo[playerid][pAdmin]; if(gPlayerLogged{playerid} == 0) { SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in."); return 1; } if ((noooc) && (PlayerInfo[playerid][pAdmin] < 2 && EventKernel[EventCreator] != playerid && PlayerInfo[playerid][pDonateRank] < 6 && !OOCPower[playerid] && PlayerInfo[playerid][pHelper] < 4)) { SendClientMessageEx(playerid, COLOR_GRAD2, " The OOC channel has been disabled by an Admin!"); return 1; } if(gOoc[playerid]) { SendClientMessageEx(playerid, TEAM_CYAN_COLOR, " You have disabled OOC Chat, re-enable with /togooc!"); return 1; } if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/o)oc [ooc chat]"); if(PlayerInfo[playerid][pAdmin] == 1) { new string[128]; format(string, sizeof(string), "(( Moderator %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); } else if(PlayerInfo[playerid][pAdmin] >= 2) { new string[128]; format(string, sizeof(string), "(( Administrator %s Level %i: %s ))", GetPlayerNameEx(playerid), AdminRank params); OOCOff(COLOR_OOC,string); } else if(PlayerInfo[playerid][pAdmin] >= 999999) { new string[128]; format(string, sizeof(string), "(( Server Owner %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); } else if(PlayerInfo[playerid][pHelper] >= 2) { new string[128]; format(string, sizeof(string), "(( Community Advisor %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); return 1; } else if(PlayerInfo[playerid][pDonateRank] == 6) { new string[128]; format(string, sizeof(string), "(( Special Moderator %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); return 1; } else if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pHelper] <= 2) { new string[128]; format(string, sizeof(string), "(( %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); return 1; } return 1; }
Code: CMD: o(playerid, params[]) { new AdminRank; AdminRank = PlayerInfo[playerid][pAdmin]; if(gPlayerLogged{playerid} == 0) { SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in."); return 1; } if ((noooc) && (PlayerInfo[playerid][pAdmin] < 2 && EventKernel[EventCreator] != playerid && PlayerInfo[playerid][pDonateRank] < 6 && !OOCPower[playerid] && PlayerInfo[playerid][pHelper] < 4)) { SendClientMessageEx(playerid, COLOR_GRAD2, " The OOC channel has been disabled by an Admin!"); return 1; } if(gOoc[playerid]) { SendClientMessageEx(playerid, TEAM_CYAN_COLOR, " You have disabled OOC Chat, re-enable with /togooc!"); return 1; } if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/o)oc [ooc chat]"); if(PlayerInfo[playerid][pAdmin] == 1) { new string[128]; format(string, sizeof(string), "(( Moderator %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); } else if(PlayerInfo[playerid][pAdmin] >= 2) { new string[128]; format(string, sizeof(string), "(( Administrator %s Level %i: %s ))", GetPlayerNameEx(playerid), AdminRank params); OOCOff(COLOR_OOC,string); } else if(PlayerInfo[playerid][pAdmin] >= 999999) { new string[128]; format(string, sizeof(string), "(( Server Owner %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); } else if(PlayerInfo[playerid][pHelper] >= 2) { new string[128]; format(string, sizeof(string), "(( Community Advisor %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); return 1; } else if(PlayerInfo[playerid][pDonateRank] == 6) { new string[128]; format(string, sizeof(string), "(( Special Moderator %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); return 1; } else if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pHelper] <= 2) { new string[128]; format(string, sizeof(string), "(( %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); return 1; } return 1; } EDIT: Wait, What do you want? I edited your code, so the admin rank shows up in the message |
else if(PlayerInfo[playerid][pAdmin] >= 999999)
{
new string[128];
format(string, sizeof(string), "(( Server Owner %s: %s ))", GetPlayerNameEx(playerid), params);
OOCOff(COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pAdmin] >= 2)
{
new string[128];
format(string, sizeof(string), "(( Administrator %s Level %i: %s ))", GetPlayerNameEx(playerid), AdminRank params);
OOCOff(COLOR_OOC,string);
}
if(2 <= PlayerInfo[playerid][pAdmin] < 99999)
Your problem comes from the fact that this code pawn Code: else if(PlayerInfo[playerid][pAdmin] >= 999999) { new string[128]; format(string, sizeof(string), "(( Server Owner %s: %s ))", GetPlayerNameEx(playerid), params); OOCOff(COLOR_OOC,string); } will never be read if you are an administrator, because if you are, this one pawn Code: else if(PlayerInfo[playerid][pAdmin] >= 2) { new string[128]; format(string, sizeof(string), "(( Administrator %s Level %i: %s ))", GetPlayerNameEx(playerid), AdminRank params); OOCOff(COLOR_OOC,string); } will be considered as "true" before. To fix it, replace your condition for admin level 2+ by this one : pawn Code: if(2 <= PlayerInfo[playerid][pAdmin] < 99999) |
stock GetAdminName(playerid)
{
new ret[16 + 1];
switch (Player[playerid][AdminLevel])
{
case 0:format(ret, sizeof(ret), "Player");
case 1:format(ret, sizeof(ret), "Moderator");
case 2 ... 999998:format(ret, sizeof(ret), "Administrator");
case 999999:format(ret, sizeof(ret), "Server Owner");
}
return ret;
}
CMD:o(playerid, params[])
{
new
message[144],
s[24 + 1],
phelper = PlayerInfo[playerid][pHelper],
padmin = PlayerInfo[playerid][pAdmin],
pdonator = PlayerInfo[playerid][pDonateRank];
if(gPlayerLogged{playerid} == 0) return SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in!");
if(noooc) return SendClientMessageEx(playerid, COLOR_GRAD2, "The OOC Channel has been disabled by an admin!"); // Change it back to whatever you had if you need it, didnt see the concept behind it and thought it was useless XD
if(gOoc[playerid]) return SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "You have disabled the OOC chat. Re-enable it with /togooc!");
if(sscanf(params, "%s", message)) return SendClientMessageEx(playerid, COLOR_GRAD2, "Usage: /ooc [message");
if(padmin != 0)
{
format(s, sizeof(s), "%s %s: %s", GetAdminName(playerid), GetPlayerNameEx(playerid), message);
}
else if(phelper >= 2)
{
format(s, sizeof(s), "Community Advisor %s: %s", GetPlayerNameEx(playerid), message);
}
else if(donator == 6)
{
format(s, sizeof(s), "Special Moderator %s: %s", GetPlayerNameEx(playerid), message);
}
SendClientMessageToAll(COLOR_OOC, s);
}
C:\Users\James\Desktop\Second Life Gaming RP\SLRP.pwn(1294) : error 017: undefined symbol "Player" C:\Users\James\Desktop\Second Life Gaming RP\SLRP.pwn(1294) : error 029: invalid expression, assumed zero C:\Users\James\Desktop\Second Life Gaming RP\SLRP.pwn(1294) : error 029: invalid expression, assumed zero C:\Users\James\Desktop\Second Life Gaming RP\SLRP.pwn(1294) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
stock GetAdminName(playerid) { new ret[16 + 1]; switch (Player[playerid][AdminLevel]) { case 0:format(ret, sizeof(ret), "Player"); case 1:format(ret, sizeof(ret), "Server Moderator"); case 2:format(ret, sizeof(ret), "Junior Administrator"); case 3:format(ret, sizeof(ret), "General Administrator"); case 4:format(ret, sizeof(ret), "Senior Administrator"); case 5:format(ret, sizeof(ret), "Head Administrator"); case 6:format(ret, sizeof(ret), "Server Manager"); case 7:format(ret, sizeof(ret), "Server Co-Owner"); case 8:format(ret, sizeof(ret), "Server Owner"); } return ret; } |