SA-MP Forums Archive
OnPlayerDeath Message - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerDeath Message (/showthread.php?tid=634520)



OnPlayerDeath Message - JuzDoiT - 20.05.2017

hello how do i show the death message to all players same as picture ? anyone script it for me ?




here is my onplayerdeath

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
DeadPlayer[playerid] = 0;
    
SetPlayerColor(playeridCOLOR_DEAD);
    
PlayerInfo[killerid][pKills]++;
    
PlayerInfo[playerid][pDeaths]++;
    
TextDrawHideForPlayer(playerid,Clock);
    
TextDrawHideForPlayer(playeridDaysOfWeek);
    
TextDrawHideForPlayer(playeridFpsAndPing[playerid]);
    
TextDrawHideForPlayer(playeridZoneName[playerid]);
    
HideTDs(playerid);
    return 
1;




Re: OnPlayerDeath Message - JuzDoiT - 20.05.2017

hey show me guide how you can . and i can edit it alone ..


Re: OnPlayerDeath Message - JasonRiggs - 20.05.2017

Send a Client Message to All with text "%s was killed by %s with a %s (%s)", PlayerName(playerid), KillerName(killerid), Reason, BodyPart, I'm pretty sure that the text i sent isnt a right one, but it's something similar to it..


Re: OnPlayerDeath Message - YouHack - 20.05.2017

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. 



Re: OnPlayerDeath Message - JuzDoiT - 20.05.2017

thank you bro


Re: OnPlayerDeath Message - JuzDoiT - 20.05.2017

Quote:
Originally Posted by YouHack
Посмотреть сообщение
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(playerid0x9D000096string);
    }
    return 
1;
}
// code may have some kind of errors + idk if bodypart returns an integer or string. 
how to use that?


Re: OnPlayerDeath Message - YouHack - 21.05.2017

Depends on how you'll use it, if you don't know how to copy-paste, I'm outta here .


Re: OnPlayerDeath Message - Jerry12 - 21.05.2017

Quote:
Originally Posted by YouHack
Посмотреть сообщение
Depends on how you'll use it, if you don't know how to copy-paste, I'm outta here .
First the code which you have sent isn't similar to his wanted script so don't copy paste from samp wiki if you don't know how to copy.


Re: OnPlayerDeath Message - Kane - 21.05.2017

Why would you use OnPlayerTakeDamage to send death messages? Just use OnPlayerDeath.


Re: OnPlayerDeath Message - YouHack - 21.05.2017

@Arthur, The code should work, and @Jerry12. No it isn't from sa-mp wiki, I wrote the code for him. did you just register to reply with useless replies? and even, If you're trying to help here, you should fix my code and re-post it here to help him.
People these days -_- ...