Posts: 220
Threads: 116
Joined: Feb 2015
Reputation:
0
hey show me guide how you can . and i can edit it alone ..
Posts: 851
Threads: 33
Joined: Jul 2016
Reputation:
0
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..
Posts: 293
Threads: 20
Joined: Jan 2017
20.05.2017, 18:20
(
Последний раз редактировалось YouHack; 21.05.2017 в 15:17.
)
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.
Posts: 293
Threads: 20
Joined: Jan 2017
Depends on how you'll use it, if you don't know how to copy-paste, I'm outta here .
Posts: 10
Threads: 0
Joined: May 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.
Posts: 824
Threads: 6
Joined: Sep 2012
Reputation:
0
Why would you use OnPlayerTakeDamage to send death messages? Just use OnPlayerDeath.
Posts: 293
Threads: 20
Joined: Jan 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 -_- ...