OnPlayerDeathMessage Query
#1

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

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";
    }
}
Reply
#3

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

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

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

Can anyone else help me? I would really like to get this fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)