OnPlayerDeath Message
#1

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;

Reply
#2

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

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..
Reply
#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
#5

thank you bro
Reply
#6

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?
Reply
#7

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

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.
Reply
#9

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

@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 -_- ...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)