22.09.2018, 10:36
SendClientMessageEx is in general a function in which you can format & send the message in the same line, which means you don't have to format it in a string then send it... So I suggest you to change your code into this:
Plus you switched playerid with the color (Syntax: "SendClientMessage(playerid, color, const message[])" ) and it's the same for SendClientMessageEx
PHP код:
if(killerid != INVALID_PLAYER_ID)
{
new string[156],WeaponName[24],VictimName[MAX_PLAYER_NAME],KillerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, VictimName, sizeof (VictimName));
GetPlayerName(killerid, KillerName, sizeof (KillerName));
GetWeaponName(GetPlayerWeapon(killerid), WeaponName, sizeof (WeaponName));
format(string, sizeof(string),"you were killed by %s with weapons %s",KillerName,WeaponName);
SendClientMessageEx(COLOR_YELLOW,playerid,string);
format(string, sizeof(string),"you killed %s with weapons %s",VictimName,WeaponName);
SendClientMessageEx(COLOR_YELLOW,killerid,string);
}
PHP код:
if(killerid != INVALID_PLAYER_ID)
{
new WeaponName[24],VictimName[MAX_PLAYER_NAME],KillerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, VictimName, sizeof (VictimName));
GetPlayerName(killerid, KillerName, sizeof (KillerName));
GetWeaponName(GetPlayerWeapon(killerid), WeaponName, sizeof (WeaponName));
SendClientMessageEx(playerid, COLOR_YELLOW, "you were killed by %s with weapons %s",KillerName,WeaponName);
SendClientMessageEx(killerid, COLOR_YELLOW, "you killed %s with weapons %s",VictimName,WeaponName);
}