Last kill does not work
#4

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:

PHP код:
if(killerid != INVALID_PLAYER_ID)
     {
          new 
string[156],WeaponName[24],VictimName[MAX_PLAYER_NAME],KillerName[MAX_PLAYER_NAME];
          
GetPlayerName(playeridVictimNamesizeof (VictimName));
          
GetPlayerName(killeridKillerNamesizeof (KillerName));
          
GetWeaponName(GetPlayerWeapon(killerid), WeaponNamesizeof (WeaponName));
          
format(stringsizeof(string),"you were killed by %s with weapons %s",KillerName,WeaponName);
          
SendClientMessageEx(COLOR_YELLOW,playerid,string);
          
format(stringsizeof(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(playeridVictimNamesizeof (VictimName)); 
        
GetPlayerName(killeridKillerNamesizeof (KillerName));
        
GetWeaponName(GetPlayerWeapon(killerid), WeaponNamesizeof (WeaponName)); 
        
SendClientMessageEx(playeridCOLOR_YELLOW"you were killed by %s with weapons %s",KillerName,WeaponName);
        
SendClientMessageEx(killeridCOLOR_YELLOW"you killed %s with weapons %s",VictimName,WeaponName);
    } 
Plus you switched playerid with the color (Syntax: "SendClientMessage(playerid, color, const message[])" ) and it's the same for SendClientMessageEx
Reply


Messages In This Thread
Last kill does not work - by skiplovebra - 22.09.2018, 03:48
Re: Last kill does not work - by NaS - 22.09.2018, 04:48
Re: Last kill does not work - by skiplovebra - 22.09.2018, 05:07
Re: Last kill does not work - by TheToretto - 22.09.2018, 10:36

Forum Jump:


Users browsing this thread: 2 Guest(s)