Someone know how to make an ooc chat?
#1

Yo! I really wanna know how to make an ooc chat.

It's like you type /b ''Tekst''
And evreyone can see it.

Thanks.
Reply
#2

You make all like /b CMD only type SendClientMessageToAll(color, text[]); and then all will see your text..
Reply
#3

Copy /ooc (/o) from any godfather gamemode, and put it on yours.
Reply
#4

PHP код:
//----------------------------------[ooc]-----------------------------------------------
    
if(strcmp(cmd"/ooc"true) == || strcmp(cmd"/o"true) == 0// 
    
{
        if(
IsPlayerConnected(playerid))
        {
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"** You havent logged in yet !");
                return 
1;
            }
            if ((
noooc) && PlayerInfo[playerid][pAdmin] < 1)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"** The OOC channel has been disabled by an Admin !");
                return 
1;
            }
            if(
PlayerInfo[playerid][pMuted] == 1)
            {
                
SendClientMessage(playeridTEAM_CYAN_COLOR"You cannot speak, you have been silenced");
                return 
1;
            }
            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(playeridCOLOR_GRAD2"USAGE: (/o)oc [OOC chat]");
                return 
1;
            }
            if(
PlayerInfo[playerid][pAdmin] == 0)
            {
                
format(stringsizeof(string), "(( %s ))", (result));
            }
            else
            {
                
format(stringsizeof(string), "[[ %s ]]", (result));
            }
               
SendPlayerMessageToAll(playeridstring);
            new 
year,month,day;
            
getdate(yearmonthday);
            new 
hourminutesecond;
            
gettime(hour,minute,second);
            
format(stringsizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (OOC): (%s)",day,month,year,hour,minute,secondsendernameresult);
            
PublicLog(string);
        }
        return 
1;
    } 
Reply
#5

See this topic: https://sampforum.blast.hk/showthread.php?tid=242732
Reply
#6

Quote:
Originally Posted by Pz
Посмотреть сообщение
Copy /ooc (/o) from any godfather gamemode, and put it on yours.

Quote:
Originally Posted by Petru_Me
Посмотреть сообщение
PHP код:
//----------------------------------[ooc]-----------------------------------------------
    
if(strcmp(cmd"/ooc"true) == || strcmp(cmd"/o"true) == 0// 
    
{
        if(
IsPlayerConnected(playerid))
        {
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"** You havent logged in yet !");
                return 
1;
            }
            if ((
noooc) && PlayerInfo[playerid][pAdmin] < 1)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"** The OOC channel has been disabled by an Admin !");
                return 
1;
            }
            if(
PlayerInfo[playerid][pMuted] == 1)
            {
                
SendClientMessage(playeridTEAM_CYAN_COLOR"You cannot speak, you have been silenced");
                return 
1;
            }
            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(playeridCOLOR_GRAD2"USAGE: (/o)oc [OOC chat]");
                return 
1;
            }
            if(
PlayerInfo[playerid][pAdmin] == 0)
            {
                
format(stringsizeof(string), "(( %s ))", (result));
            }
            else
            {
                
format(stringsizeof(string), "[[ %s ]]", (result));
            }
               
SendPlayerMessageToAll(playeridstring);
            new 
year,month,day;
            
getdate(yearmonthday);
            new 
hourminutesecond;
            
gettime(hour,minute,second);
            
format(stringsizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (OOC): (%s)",day,month,year,hour,minute,secondsendernameresult);
            
PublicLog(string);
        }
        return 
1;
    } 

This is copy-pasted, he doesn't have thoose variables, it will not work for him!

This is a better code:
pawn Код:
CMD:b( playerid, params[ ] )
{
    if( isnull( params ) )
        return SendClientMessage( playerid, 0xAAAAAA, "Usage /b [TEXT]" );
    new str[ 128 ], name[ 24 ];
    GetPlayerName( playerid, name, 24 );
    format( string, sizeof string, "[OOC][%i]%s: %s", playerid, name, params );
    return SendClientMessageToAll( string );
}
Don't have ZCMD? Here is a strcmp version:
pawn Код:
if( !strcmp( cmdtext, "/b", true, 2 ) )
{
    if( !cmdtext[ 2 ] )
        return SendClientMessage( playerid, 0xAAAAAA, "Usage /b [TEXT]" );
    new str[ 128 ], name[ 24 ];
    GetPlayerName( playerid, name, 24 );
    format( str, sizeof str, "[OOC][%i]%s: %s", playerid, name, cmdtext[ 2 ] );
    return SendClientMessageToAll( 0xAAAAAA, str );
}
You can change the colors.
Reply
#7

Quote:
Originally Posted by Petru_Me
Посмотреть сообщение
PHP код:
//----------------------------------[ooc]-----------------------------------------------
    
if(strcmp(cmd"/ooc"true) == || strcmp(cmd"/o"true) == 0// 
    
{
        if(
IsPlayerConnected(playerid))
        {
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"** You havent logged in yet !");
                return 
1;
            }
            if ((
noooc) && PlayerInfo[playerid][pAdmin] < 1)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"** The OOC channel has been disabled by an Admin !");
                return 
1;
            }
            if(
PlayerInfo[playerid][pMuted] == 1)
            {
                
SendClientMessage(playeridTEAM_CYAN_COLOR"You cannot speak, you have been silenced");
                return 
1;
            }
            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(playeridCOLOR_GRAD2"USAGE: (/o)oc [OOC chat]");
                return 
1;
            }
            if(
PlayerInfo[playerid][pAdmin] == 0)
            {
                
format(stringsizeof(string), "(( %s ))", (result));
            }
            else
            {
                
format(stringsizeof(string), "[[ %s ]]", (result));
            }
               
SendPlayerMessageToAll(playeridstring);
            new 
year,month,day;
            
getdate(yearmonthday);
            new 
hourminutesecond;
            
gettime(hour,minute,second);
            
format(stringsizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (OOC): (%s)",day,month,year,hour,minute,secondsendernameresult);
            
PublicLog(string);
        }
        return 
1;
    } 
You have copied the raven's Roleplay /ooc
Reply
#8

Quote:
Originally Posted by rive-sud
Посмотреть сообщение
You have copied the raven's Roleplay /ooc
Why the hell are you bumping this Topic ?, Look at the Last Post's Date.
Reply
#9

Quote:
Originally Posted by rive-sud
Посмотреть сообщение
You have copied the raven's Roleplay /ooc
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)