SA-MP Forums Archive
dcmd_o > dcmd_( ?? - 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: dcmd_o > dcmd_( ?? (/showthread.php?tid=92493)



dcmd_o > dcmd_( ?? - introzen - 20.08.2009

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 =)


Re: dcmd_o > dcmd_( ?? - MenaceX^ - 20.08.2009

You already did I guess?


Re: dcmd_o > dcmd_( ?? - introzen - 20.08.2009

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


Re: dcmd_o > dcmd_( ?? - MenaceX^ - 20.08.2009

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


Re: dcmd_o > dcmd_( ?? - introzen - 20.08.2009

Anyone else?


Re: dcmd_o > dcmd_( ?? - MenaceX^ - 20.08.2009

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



Re: dcmd_o > dcmd_( ?? - Hiitch - 20.08.2009

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


Re: dcmd_o > dcmd_( ?? - kaisersouse - 20.08.2009

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



Re: dcmd_o > dcmd_( ?? - MenaceX^ - 20.08.2009

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


Re: dcmd_o > dcmd_( ?? - introzen - 20.08.2009

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