global message errors
#1

trying to make a clientmessage but im getting 2 type miss match errors cant figure it out, im sure it is something simple

should be

/g hi

== Tanker305:hi ==
pawn Код:
C:\Documents and Settings\Mark\Desktop\SA-MP .3a Server\gamemodes\desertwindbase.pwn(273) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Mark\Desktop\SA-MP .3a Server\gamemodes\desertwindbase.pwn(279) : error 035: argument type mismatch (argument 1)
pawn Код:
if(!strcmp(cmdtext, "/g", true, 3))
  {
  if(cmdtext[2] == 0)
    {
     SendClientMessage(playerid, COLOR_G, "USAGE: /(g)lobal <message>"); // error
     return 1;
    }
    new str[128];
        GetPlayerName(playerid, str, sizeof(str));
    format(str, sizeof(str), "== %s:%s ==", str, cmdtext[3]);
        SendClientMessageToAll(COLOR_G, str); // error
    return 1;
}
return 0;
Reply
#2

what is COLOR_G defined as?
Reply
#3

#define COLOR_G #BCEE68
Reply
#4

Код:
new Name[MAX_PLAYER_NAME], str[128];

GetPlayerName(playerid, Name, sizeof(Name));
format(str, sizeof(str), "== %s:%s ==", Name, cmdtext[3]);
Quote:
Originally Posted by [LCG
TANKER ]
#define COLOR_G #BCEE68
There's your problem
Reply
#5

Quote:
Originally Posted by [LCG
TANKER ]
#define COLOR_G #BCEE68
change to
pawn Код:
#define COLOR_G 0xBCEE68AA
Reply
#6

figures dumb me used wrong color format

i cant seam to get it to work, /g works but im unable to send the msg i get a unknown command error
Reply
#7

Quote:
Originally Posted by lrZ^ aka LarzI
Quote:
Originally Posted by [LCG
TANKER ]
#define COLOR_G #BCEE68
change to
pawn Код:
#define COLOR_G 0xBCEE68AA
I still don't understand, why you use AA as alpha? Too many people may think it's the max value of a color channel but it isn't. The max value is FF (255). AA is 170, and this mean nothing. I agree that this have no effect in chat messages, but you have to learn it once and for all, AA is not the max value of a channel .

I also agree that this might be useless to post this, so please forgive me, i'm just trying to teach how to use things properly.
Reply
#8

I do know that FF is higher than AA (CC is min value, isn'tit?) but I've always used AA now it's a just a so called "routine" to use it
Reply
#9

still no luck on fixing it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)