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) == 0 || strcmp(cmd, "/o", true) == 0) //
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "** You havent logged in yet !");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "** The OOC channel has been disabled by an Admin !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_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(playerid, COLOR_GRAD2, "USAGE: (/o)oc [OOC chat]");
return 1;
}
if(PlayerInfo[playerid][pAdmin] == 0)
{
format(string, sizeof(string), "(( %s ))", (result));
}
else
{
format(string, sizeof(string), "[[ %s ]]", (result));
}
SendPlayerMessageToAll(playerid, string);
new year,month,day;
getdate(year, month, day);
new hour, minute, second;
gettime(hour,minute,second);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (OOC): (%s)",day,month,year,hour,minute,second, sendername, result);
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) == 0 || strcmp(cmd, "/o", true) == 0) //
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "** You havent logged in yet !");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "** The OOC channel has been disabled by an Admin !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_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(playerid, COLOR_GRAD2, "USAGE: (/o)oc [OOC chat]");
return 1;
}
if(PlayerInfo[playerid][pAdmin] == 0)
{
format(string, sizeof(string), "(( %s ))", (result));
}
else
{
format(string, sizeof(string), "[[ %s ]]", (result));
}
SendPlayerMessageToAll(playerid, string);
new year,month,day;
getdate(year, month, day);
new hour, minute, second;
gettime(hour,minute,second);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (OOC): (%s)",day,month,year,hour,minute,second, sendername, result);
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) == 0 || strcmp(cmd, "/o", true) == 0) //
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "** You havent logged in yet !");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "** The OOC channel has been disabled by an Admin !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_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(playerid, COLOR_GRAD2, "USAGE: (/o)oc [OOC chat]");
return 1;
}
if(PlayerInfo[playerid][pAdmin] == 0)
{
format(string, sizeof(string), "(( %s ))", (result));
}
else
{
format(string, sizeof(string), "[[ %s ]]", (result));
}
SendPlayerMessageToAll(playerid, string);
new year,month,day;
getdate(year, month, day);
new hour, minute, second;
gettime(hour,minute,second);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (OOC): (%s)",day,month,year,hour,minute,second, sendername, result);
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
|