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(playerid, killerid, reason)
{
DeadPlayer[playerid] = 0;
SetPlayerColor(playerid, COLOR_DEAD);
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
TextDrawHideForPlayer(playerid,Clock);
TextDrawHideForPlayer(playerid, DaysOfWeek);
TextDrawHideForPlayer(playerid, FpsAndPing[playerid]);
TextDrawHideForPlayer(playerid, ZoneName[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(playerid, issuerid, Float: amount, weaponid, bodypart)
{
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:kx, Float:ky, Float:kz,
string[156],
WeaponName[24],
VictimName[MAX_PLAYER_NAME],
KillerName[MAX_PLAYER_NAME];
// killer coordinates variables
GetPlayerPos(issuerid, kx, ky, kz);
// their positions and distance between them
new Float: PfPDistance = GetPlayerDistanceFromPoint(playerid, kx, ky, kz);
GetPlayerName(playerid, VictimName, sizeof (VictimName));
GetPlayerName(issuerid, KillerName, sizeof (KillerName));
GetWeaponName(weaponid, WeaponName, sizeof (WeaponName));
format(string, sizeof(string), "%s (%i) Killed %s (%i) - %s (%s) From %0.2fm Away.", KillerName, issuerid, VictimName, playerid, WeaponName, bodypart, PfPDistance);
SendClientMessageToAll(0x9D000096, string);
}
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(playerid, issuerid, Float: amount, weaponid, bodypart)
{
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:kx, Float:ky, Float:kz,
string[156],
WeaponName[24],
VictimName[MAX_PLAYER_NAME],
KillerName[MAX_PLAYER_NAME];
// killer coordinates variables
GetPlayerPos(issuerid, kx, ky, kz);
// their positions and distance between them
new Float: PfPDistance = GetPlayerDistanceFromPoint(playerid, kx, ky, kz);
GetPlayerName(playerid, VictimName, sizeof (VictimName));
GetPlayerName(issuerid, KillerName, sizeof (KillerName));
GetWeaponName(weaponid, WeaponName, sizeof (WeaponName));
format(string, sizeof(string), "%s (%i) Killed %s (%i) - %s (%s) From %0.2fm Away.", KillerName, issuerid, VictimName, playerid, WeaponName, bodypart, PfPDistance);
SendClientMessageToAll(playerid, 0x9D000096, string);
}
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 -_- ...