OnPlayerDeath Message
#4

Enjoy
PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    new 
Float:oldhealth// victim health before taking damage
    
GetPlayerHealth(playerid,oldhealth); // victim health before taking damage
    
new currenthp oldhealth amount// calculating current health after taking damage
    
if(currenthp == 0.0) {
        new 
            
Float:kxFloat:kyFloat:kz,
            
string[156],
            
WeaponName[24],
            
VictimName[MAX_PLAYER_NAME],
            
KillerName[MAX_PLAYER_NAME];
        
// killer coordinates variables
        
GetPlayerPos(issueridkxkykz);
        
// their positions and distance between them
        
new FloatPfPDistance GetPlayerDistanceFromPoint(playeridkxkykz);
        
GetPlayerName(playeridVictimNamesizeof (VictimName));
        
GetPlayerName(issueridKillerNamesizeof (KillerName));
        
GetWeaponName(weaponidWeaponNamesizeof (WeaponName));
        
format(stringsizeof(string), "%s (%i) Killed %s (%i) - %s (%s) From %0.2fm Away."KillerNameissueridVictimNameplayeridWeaponNamebodypartPfPDistance);
        
SendClientMessageToAll(0x9D000096string);
    }
    return 
1;
}
// code may have some kind of errors + idk if bodypart returns an integer or string. 
Reply


Messages In This Thread
OnPlayerDeath Message - by JuzDoiT - 20.05.2017, 17:09
Re: OnPlayerDeath Message - by JuzDoiT - 20.05.2017, 17:16
Re: OnPlayerDeath Message - by JasonRiggs - 20.05.2017, 17:24
Re: OnPlayerDeath Message - by YouHack - 20.05.2017, 18:20
Re: OnPlayerDeath Message - by JuzDoiT - 20.05.2017, 20:20
Re: OnPlayerDeath Message - by JuzDoiT - 20.05.2017, 20:49
Re: OnPlayerDeath Message - by YouHack - 21.05.2017, 15:15
Re: OnPlayerDeath Message - by Jerry12 - 21.05.2017, 19:00
Re: OnPlayerDeath Message - by Kane - 21.05.2017, 19:40
Re: OnPlayerDeath Message - by YouHack - 21.05.2017, 23:00

Forum Jump:


Users browsing this thread: 1 Guest(s)