Warning with sendclientmessage?
#1

Can u guys help me with this sendclientmessage error?
Warning what's shown:
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition

Cmd:
HTML Code:
SendClientMessage(playerid, -1, "*"COL_YELLOW" You have given %s "COL_WHITE"%i"COL_GREEN" %s", PlayerName(playerid), amount, string);
Reply
#2

You can't format in SendPlayerMessage.. You can only send message without any usage of %s %d..
You can do it this way
PHP Code:
new string[128];
format(stringsizeof(string), "*"COL_YELLOW" You have given %s "COL_WHITE"%i"PlayerName(playerid), amount);
SendClientMessage(playerid, -1string); 
Reply
#3

PHP Code:
new str[120];
format(strsizeof(str), "*"COL_YELLOW" You have given %s "COL_WHITE"%i"COL_GREEN""PlayerName(playerid), amount,);
SendClientMessage(playerid, -1str); 
Reply
#4

Are the above strings even 100 characters long?

PHP Code:
new str[90]; // 90 is enuf 
format(strsizeof(str), "*"COL_YELLOW" You have given %s "COL_WHITE"%i"PlayerName(playerid), amount,); // no need to use COLOR_GREEN...
SendClientMessage(playerid, -1str); 
Reply
#5

Quote:
Originally Posted by Yaa
View Post
PHP Code:
new str[120];
format(strsizeof(str), "*"COL_YELLOW" You have given %s "COL_WHITE"%i"COL_GREEN""PlayerName(playerid), amount,);
SendClientMessage(playerid, -1str); 
Thanks, worked!
Reply
#6

The above code worked, but you are wasting 20+ unused memory. Optimization should be your higher priority than a code that works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)