OOC chat and Normal Chat -
RoneyRemington - 23.02.2010
Can some make or give me a link to a system or script add-on that will make it so /o is OOC chat and just normal text is only for players near you?
Thank you if you do.
,Roney_Remington
Re: OOC chat and Normal Chat -
Norn - 23.02.2010
Quote:
Originally Posted by RoneyRemington
Can some make or give me a link to a system or script add-on that will make it so /o is OOC chat and just normal text is only for players near you?
Thank you if you do.
,Roney_Remington
|
Look in the useful functions page theres a few functions that would make that possible.
Re: OOC chat and Normal Chat -
Jawz - 23.02.2010
why not just use /b
if(strcmp(cmd, "/b", true) == 0)//local ooc (Jawz edition)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
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: /b [local ooc chat]");
return 1;
}
if(PlayerInfo[playerid][pMaskuse] == 1)
{
format(string, sizeof(string), "(( Stranger Says: %s ))", result);
}
else
{
format(string, sizeof(string), "(( [%i] %s Says: %s ))", playerid, sendername, result);
}
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
printf("%s", string);
}
return 1;
}
and if you want the command to be /o then just change the command simple!
Re: OOC chat and Normal Chat -
Onyx09 - 23.02.2010
Epic
Re: OOC chat and Normal Chat -
Norn - 23.02.2010
Quote:
Originally Posted by Jawz
why not just use /b
if(strcmp(cmd, "/b", true) == 0)//local ooc (Jawz edition)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
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: /b [local ooc chat]");
return 1;
}
if(PlayerInfo[playerid][pMaskuse] == 1)
{
format(string, sizeof(string), "(( Stranger Says: %s ))", result);
}
else
{
format(string, sizeof(string), "(( [%i] %s Says: %s ))", playerid, sendername, result);
}
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
printf("%s", string);
}
return 1;
}
and if you want the command to be /o then just change the command simple!
|
Yeh and that will work without all the functions necessary, think before you post.
Re: OOC chat and Normal Chat -
RoneyRemington - 23.02.2010
wh functions would i need for the /b thing?
Re: OOC chat and Normal Chat -
Joe Staff - 23.02.2010
pawn Code:
public OnGameModeInit()
{
LimitGlobalChatRadius(10.0);
return 1;
}
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!cmdtext[1])return 0;
if(!strcmp(cmdtext[1],"ooc",true,3))
{
new tmp[192];
GetPlayerName(playerid,tmp,24);
format(tmp,192,"(( %s: %s ))",tmp,cmdtext[5]);
SendClientMessageToAll(0xFF4444FF,tmp);
return 1;
}
return 0;
}