10.05.2018, 18:53
PHP код:
SendDeathMessageEx(playerid, killerid, reason)
{
new string[128], playername[MAX_PLAYER_NAME], killername[MAX_PLAYER_NAME], weaponn[24], modelid;
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
if (reason != INVALID_REASON && !IsPlayerNPC(killerid)) {
modelid = killerid != INVALID_PLAYER_ID ? GetPlayerState(killerid) == PLAYER_STATE_DRIVER ? GetVehicleModel(GetPlayerVehicleID(killerid)) : 0 : 0;
if (reason == 31) {
switch (modelid) {
case 447: weaponn = "Sparrow Machine Gun";
case 464: weaponn = "RC Baron Machine Gun";
case 476: weaponn = "Rustler Machine Gun";
default: weaponn = "M4";
}
}
else if (reason == 37) {
weaponn = "Fire";
}
else if (reason == 38) {
switch (modelid) {
case 425: weaponn = "Hunter Machine Gun";
default: weaponn = "Minigun";
}
}
else if (reason == 50) {
switch (modelid) {
case 417, 425, 447, 465, 469, 487, 488, 497, 501, 548, 563: weaponn = "Helicopter";
default: {
weaponn = "Collision";
reason = 49;
}
}
}
else if (reason == 51) {
switch (modelid) {
case 425: weaponn = "Hunter Missile";
case 432: weaponn = "Rhino Turret";
case 520: weaponn = "Hydra Missile";
default: weaponn = "Explosion";
}
}
else {
format(weaponn, 24, "%s", WeaponName[reason]);
}
if (killerid != INVALID_PLAYER_ID) {
GetPlayerName(killerid, killername, MAX_PLAYER_NAME);
format(string, 128, "* %s[%d] has been killed by %s[%d] (%s).", playername,playerid, killername,killerid, weaponn);
}
else format(string, 128, "* %s[%d] has died (%s).", playername,playerid, weaponn);
}
else {
format(string, 128, "* %s[%d] has died (%s).", playername,playerid, WeaponName[sizeof(WeaponName)-1]);
}
SendClientMessageToAll2(COLOR_WHITE, string);
SendDeathMessage(killerid, playerid, reason);
}