SendClientMessage Error
#1

Error :
(293) : warning 202: number of arguments does not match definition
pawn Код:
#define SCM SendClientMessage
290: new pname[MAX_PLAYER_NAME];
291: GetPlayerName(killerid, pname, sizeof(pname));
292: GivePlayerMoney(playerid, -500);
293: SCM(playerid, COLOR_GREEN, "[Killed]: Player %s has killed you! You've lost 500 Cash!", pname);
Reply
#2

You need to format the string before using those %s's and %d's...
SendClientMessage is to send a string..
format is to put these variables and other strings inside it.
pawn Код:
new pname[MAX_PLAYER_NAME], string[128];
GetPlayerName(killerid, pname, sizeof(pname));
GivePlayerMoney(playerid, -500);
format(string, sizeof(string), "[Killed]: Player %s has killed you! You've lost 500 Cash!", pname);
SCM(playerid, COLOR_GREEN, string); // sending the formatted string..
Reply
#3

thanks
EDIT : Fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)