OnPlayerDeathMessage Query -
borg747 - 07.08.2012
I have one problem with my OnPlayerDeathMessage code.
The problem is that when a player parks over another player and does not get out, the death icon would show as a Helicopter Blades (50) instead of (49) Vehicle .
Here's the code:
Код:
case 49:
{
reasonMsg = "Vehicle Collision";
}
case 50:
{
if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
switch (GetVehicleModel(GetPlayerVehicleID(killerid)))
{
case 417, 425, 447, 465, 469, 487, 488, 497, 501, 548, 563:
{
reasonMsg = "Helicopter Blades";
}
default:
{
reasonMsg = "Vehicle Collision";
}
}
}
else
{
reasonMsg = "Vehicle Collision";
}
Note: When the player is hit by a car and dies, it shows the appropriate message.
Re: OnPlayerDeathMessage Query -
Misiur - 07.08.2012
Get yourself some more debug:
pawn Код:
case 50: {
print("Kill cause 50 called");
if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
new vid = GetVehicleModel(GetPlayerVehicleID(killerid));
printf("Killer is a driver of car model %d", vid);
switch (vid)
{
case 417, 425, 447, 465, 469, 487, 488, 497, 501, 548, 563: {
print("Killer got to tha choppa");
reasonMsg = "Helicopter Blades";
}
default: {
print("Killer is in a car, boat or some other non-choppa stuff");
reasonMsg = "Vehicle Collision";
}
}
}
else
{
print("Killer is not a driver");
reasonMsg = "Vehicle Collision";
}
}
Re: OnPlayerDeathMessage Query -
borg747 - 07.08.2012
I tested your code, ran the debug, and everything is supposed to be fine.
Maybe the heli blade icon when parked over is an sa-mp bug?
Re: OnPlayerDeathMessage Query -
Misiur - 07.08.2012
Well, do you have in OnPlayerDeath something like
pawn Код:
SendDeathMessage(killerid, playerid, reason);
? If yes, you must change reason to 49 to get correct icon
Re: OnPlayerDeathMessage Query -
borg747 - 07.08.2012
Hey,
I did as you said:
Код:
case 49: {
print("Kill cause 50 called");
if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
new vid = GetVehicleModel(GetPlayerVehicleID(killerid));
printf("Killer is a driver of car model %d", vid);
switch (vid)
{
case 417, 425, 447, 465, 469, 487, 488, 497, 501, 548, 563: {
print("Killer got to tha choppa");
reasonMsg = "Helicopter Blades";
}
default: {
print("Killer is in a car, boat or some other non-choppa stuff");
reasonMsg = "Vehicle Collision";
}
}
}
else
{
print("Killer is not a driver");
reasonMsg = "Vehicle Collision";
}
}
case 51:
{
if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
switch (GetVehicleModel(GetPlayerVehicleID(killerid)))
{
case 425:
{
reasonMsg = "Hunter Rockets";
}
case 432:
{
reasonMsg = "Rhino Turret";
}
case 520:
{
reasonMsg = "Hydra Rockets";
}
default:
{
reasonMsg = "Explosion";
}
}
}
else
{
reasonMsg = "Explosion";
}
}
default:
{
reasonMsg = "Unknown";
}
}
But then I got the 'unknown' reason and also the heli-blades icon.
Re: OnPlayerDeathMessage Query -
borg747 - 08.08.2012
Can anyone else help me? I would really like to get this fixed.