dcmd_o > dcmd_( ??
#1

Hey everyone..

I got this command:

pawn Код:
dcmd_o(playerid,params[])
{
  new pName[MAX_PLAYER_NAME],string[256];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),"((%s: %s))",pName,params[0]);
    if(OOCChat == 1)
    {
        SendClientMessageToAll(0xD0F3D4AA,string);
    }
    else if(OOCChat == 0) return SendClientMessage(playerid,COLOR_DARKRED,"OOC CHAT DISABLED");
    return 1;
}
I want it to be " ( " instead of " /o "...

How do you make that? =/

Thanks =)
Reply
#2

You already did I guess?
Reply
#3

Quote:
Originally Posted by MenaceX^
You already did I guess?
dcmd_( doesn't work...
Reply
#4

Oh sorry then I can't help. I don't use dcmd, never did though.
Reply
#5

Anyone else?
Reply
#6

try strcmp?
btw. I suggest you to do this:
pawn Код:
if(!OOCHat) return SendClientMessage(playerid,color,"OOC chat is disabled.");
else
{
  w/e
Reply
#7

Do you think maybe you can do it as a strcmp command instead of using DCMD?
Reply
#8

OnPlayerText, if text[0] == '(' and !text[1] then fire off your command but return 0 at the end so the ( doesnt show up in chat.

Код:
if(text[0] == '(' && !text[1])
{
    new pName[MAX_PLAYER_NAME],string[256];
	GetPlayerName(playerid,pName,sizeof(pName));
	format(string,sizeof(string),"((%s: %s))",pName,params[0]);
	if(OOCChat == 1)
	{
		SendClientMessageToAll(0xD0F3D4AA,string);
	}
	else if(OOCChat == 0) return SendClientMessage(playerid,COLOR_DARKRED,"OOC CHAT DISABLED");
	return 0;
}
Reply
#9

But he needs it as a command.
Also the lenght of your string is wasted.
Reply
#10

Quote:
Originally Posted by kaisersouse
OnPlayerText, if text[0] == '(' and !text[1] then fire off your command but return 0 at the end so the ( doesnt show up in chat.

Код:
if(text[0] == '(' && !text[1])
{
    new pName[MAX_PLAYER_NAME],string[256];
	GetPlayerName(playerid,pName,sizeof(pName));
	format(string,sizeof(string),"((%s: %s))",pName,params[0]);
	if(OOCChat == 1)
	{
		SendClientMessageToAll(0xD0F3D4AA,string);
	}
	else if(OOCChat == 0) return SendClientMessage(playerid,COLOR_DARKRED,"OOC CHAT DISABLED");
	return 0;
}
It didn't work... All that showed up was:

Kjang_Munjitsu: ( (text)


Current code:
pawn Код:
if(text[0] == '(' && !text[1])
    {
        if(PlayerInfo[playerid][pShowName] == 0)
        {
            format(string,sizeof(string),"%s:(( %s ))",pName,text[0]);
            ProxDetector(10.0,playerid,string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
        }
        else if(PlayerInfo[playerid][pShowName] == 1)
        {
            format(string,sizeof(string),"Unknown says:(( %s ))",text[0]);
            ProxDetector(10.0,playerid,string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
        }
        return 0;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)