31.01.2014, 22:00
Hey guys, my /o command won't work, here is the code.
PHP код:
}
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 && !OOCPower[playerid] && PlayerInfo[playerid][pHelper] < 4))
{
SendClientMessageEx(playerid, COLOR_RED, " The OOC Global Channel has been disabled by Admins");
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), "(( Server Moderator %s: %s ))", GetPlayerNameEx(playerid), params);
OOCOff(COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pAdmin] == 2)
{
new string[128];
format(string, sizeof(string), "(( {808000}Junior Admin{FFFFFF} %s: %s ))", GetPlayerNameEx(playerid), params);
OOCOff(COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pAdmin] == 3)
{
new string[128];
format(string, sizeof(string), "(( {008080}General Admin{FFFFFF} %s: %s ))", GetPlayerNameEx(playerid), params);
OOCOff(COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pAdmin] == 4)
{
new string[128];
format(string, sizeof(string), "(( {FFFF00}Senior Admin{FFFFFF} %s: %s ))", GetPlayerNameEx(playerid), params);
OOCOff(COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pAdmin] == 1337)
{
new string[128];
format(string, sizeof(string), "(( {FF00FF}Head Admin{FFFFFF} %s: %s ))", GetPlayerNameEx(playerid), params);
OOCOff(COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pAdmin] == 1338)
{
new string[128];
format(string, sizeof(string), "(( {FF0000}Admin Director{FFFFFF} %s: %s ))", GetPlayerNameEx(playerid), params);
OOCOff(COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pAdmin] == 99998)
{
new string[128];
format(string, sizeof(string), "(( {00FFFF}Community Manager{FFFFFF} %s: %s ))", GetPlayerNameEx(playerid), params);
OOCOff(COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pAdmin] == 99999)
{
new string[128];
format(string, sizeof(string), "(( {00FF00}Community Owner{FFFFFF} %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][pHelper] == 3)
{
new string[128];
format(string, sizeof(string), "(( Senior Advisor %s: %s ))", GetPlayerNameEx(playerid), params);
OOCOff(COLOR_OOC,string);
return 1;
}
else if(PlayerInfo[playerid][pHelper] == 4)
{
new string[128];
format(string, sizeof(string), "(( Chief Advisor %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;
}