Help cmd color /me
#1

this is cmd in my script:
command(me, playerid, params[])
{
new Message[128], string[ 128 ];
if( sscanf( params, "z", Message) )
{
SendClientMessage( playerid, WHITE, "SYNTAX: /me [action]" );
}
else
{
if(strlen(Message) < 1 || !IsPlayerConnectedEx( playerid ) )
{
return 1;


How to change color cmd /me to color purple?
Reply
#2

Try This Out

Код:
command(me, playerid, params[])
{
new Message[128], string[ 128 ];
if( sscanf( params, "z", Message) )
{
SendClientMessage( playerid, 0x6600FF, "SYNTAX: /me [action]" );
}
else
{
if(strlen(Message) < 1 || !IsPlayerConnectedEx( playerid ) )
{
return 1;
Or you can add
Код:
#define PURPLE 0x6600FF
to the top of your script, and change this line:
Код:
SendClientMessage( playerid, 0x6600FF, "SYNTAX: /me [action]" );
to this:
Код:
SendClientMessage( playerid, PURPLE, "SYNTAX: /me [action]" );
Hope this helps
Reply
#3



Look at image that i tick

How to change that to color PURPLE?
Reply
#4

Код:
    if(!strcmp(cmdtext, "/me", true, 3))
    {
        if(!cmdtext[3])return SendClientMessage(playerid, WHITE, "USAGE: /me [action]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        SendClientMessageToAll(0x6600FF, str);
        return 1;
    }
Reply
#5

Camacron THIS ERROR


C:\Documents and Settings\p\Desktop\indo\gamemodes\VortexRoleplay.p wn(15670) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\p\Desktop\indo\gamemodes\VortexRoleplay.p wn(15672) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\p\Desktop\indo\gamemodes\VortexRoleplay.p wn(15672) : warning 215: expression has no effect
C:\Documents and Settings\p\Desktop\indo\gamemodes\VortexRoleplay.p wn(15672) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\p\Desktop\indo\gamemodes\VortexRoleplay.p wn(15672) : error 029: invalid expression, assumed zero
C:\Documents and Settings\p\Desktop\indo\gamemodes\VortexRoleplay.p wn(15672) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#6

pawn Код:
if (strcmp("/Me", cmdtext, true, 3) == 0)
    {
        if(!cmdtext[3]) return SendClientMessage(playerid, 0xAA3333AA, "Correct Usage : /Me <Action>.");
        new string[256], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string, sizeof(string), "* %s %s ", pName, cmdtext[4]);
        SendClientMessageToAll(0xC2A2DAAA, string);
        return 1;
    }
Not tested.
Reply
#7

@Basicz error again

hmm please help me
Reply
#8

pawn Код:
command(me, playerid, params[])
{
new Message[128], string[ 128 ];
if( sscanf( params, "z", Message) )
{
SendClientMessage( playerid, 0xC2A2DAAA, "SYNTAX: /me [action]" );
}
else
{
if(strlen(Message) < 1 || !IsPlayerConnectedEx( playerid ) )
{
return 1;
Should works.

EDIT:
Camacorn's code and my code works fine for me.
Reply
#9

@basicz that's work but when /me action that color blue.


look my picture that i tick change to color PURPLE


Sorry my english bad
Reply
#10

Try this code:

pawn Код:
command(me, playerid, params[])
{
    if(sscanf(params, "s", params)) return SendClientMessage(playerid, COLOR_RED, "SINTAX: /me [action]");
    new Msg[128], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(Msg, sizeof(Msg), "* %s: %s", pName, params);
    SendClientMessageToAll(0x6600FF, Msg);
    return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)