Command is not working.
#1

Well, i had made a topic about that, but i removed it.
Okay, i have a command in my Roleplay server that is not working, i can't find the mistake in the code.
The command is /o
This command is Global Out Of Character Chat, when you are typing something like /o Hello people, it must be shown for all the players, but my command it's not working i don't know why.

Example for these people who don't know what is this command for.
When you are typing something normal in the chat like in other servers (Freeroam, DM etc...) everyone can read it, but in Roleplay servers you have to type /o [text] if you want everyone to read it. Hope you understand what i mean.
(Sorry for my bad English)

The command.

PHP код:
}
CMD:o(playeridparams[])
{
    if(
gPlayerLogged{playerid} == 0)
    {
        
SendClientMessageEx(playeridCOLOR_GREY"You're not logged in.");
        return 
1;
    }
    if ((
noooc) && (PlayerInfo[playerid][pAdmin] < && EventKernel[EventCreator] != playerid && !OOCPower[playerid] && PlayerInfo[playerid][pHelper] < 4))
    {
        
SendClientMessageEx(playeridCOLOR_RED"   The OOC Global Channel has been disabled by Royal Gaming Roleplay Staff");
        return 
1;
    }
    if(
gOoc[playerid])
    {
        
SendClientMessageEx(playeridTEAM_CYAN_COLOR"   You have disabled OOC Chat, re-enable with /togooc!");
        return 
1;
    }
    if(
isnull(params)) return SendClientMessageEx(playeridCOLOR_WHITE"USAGE: (/o)oc [ooc chat]");
    if(
PlayerInfo[playerid][pAdmin] == 1)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( Server Moderator %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
    }
    else if(
PlayerInfo[playerid][pAdmin] == 2)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( {808000}Junior Admin{FFFFFF} %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
    }
    else if(
PlayerInfo[playerid][pAdmin] == 3)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( {008080}General Admin{FFFFFF} %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
    }
    else if(
PlayerInfo[playerid][pAdmin] == 4)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( {FFFF00}Senior Admin{FFFFFF} %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
    }
    else if(
PlayerInfo[playerid][pAdmin] == 1337)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( {FF00FF}Head Admin{FFFFFF} %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
    }
    else if(
PlayerInfo[playerid][pAdmin] == 1338)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( {FF0000}Admin Director{FFFFFF} %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
    }
    else if(
PlayerInfo[playerid][pAdmin] == 99998)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( {00FFFF}Community Manager{FFFFFF} %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
    }
    else if(
PlayerInfo[playerid][pAdmin] == 99999)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( {00FF00}Community Owner{FFFFFF} %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
    }
    else if(
PlayerInfo[playerid][pHelper] == 2)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( Community Advisor %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
        return 
1;
    }
    else if(
PlayerInfo[playerid][pHelper] == 3)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( Senior Advisor %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
        return 
1;
    }
    else if(
PlayerInfo[playerid][pHelper] == 4)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( Chief Advisor %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
        return 
1;
    }
    else if(
PlayerInfo[playerid][pAdmin] < && PlayerInfo[playerid][pHelper] <= 2)
    {
        new 
string[128];
        
format(stringsizeof(string), "(( %s: %s ))"GetPlayerNameEx(playerid), params);
        
OOCOff(COLOR_OOC,string);
        return 
1;
    }
    return 
1
Reply
#2

You are formatting the messages but never sending it, on bottom add
pawn Код:
SendClientMessageToAll(-1, string);
Unless that is what OOCOff is.

EDIT: OOCOff, does that send a client message or something? Maybe the issue is with that.
Reply
#3

Quote:
Originally Posted by Nathan_Taylor
Посмотреть сообщение
You are formatting the messages but never sending it, on bottom add
pawn Код:
SendClientMessageToAll(-1, string);
Unless that is what OOCOff is.

EDIT: OOCOff, does that send a client message or something? Maybe the issue is with that.
Okay, am going to test it.
Reply
#4

Well, is working thank you, +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)