SA-MP Forums Archive
Someone know how to make an ooc chat? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Someone know how to make an ooc chat? (/showthread.php?tid=247738)



Someone know how to make an ooc chat? - Knocc_Out - 10.04.2011

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

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

Thanks.


Re: Someone know how to make an ooc chat? - P!x3L - 10.04.2011

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


Re: Someone know how to make an ooc chat? - Pz - 10.04.2011

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


Re: Someone know how to make an ooc chat? - Petru_Me - 10.04.2011

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;
    } 



Re: Someone know how to make an ooc chat? - Kwarde - 10.04.2011

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


Re: Someone know how to make an ooc chat? - Mean - 10.04.2011

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.


Re : Re: Someone know how to make an ooc chat? - rive-sud - 22.08.2011

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


Re: Re : Re: Someone know how to make an ooc chat? - =WoR=G4M3Ov3r - 22.08.2011

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.


Re: Re : Re: Someone know how to make an ooc chat? - [MWR]Blood - 22.08.2011

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