OnVehicleDeath Problem
#1

Why my OnVehicleDeath doesn't work? Nothing appears when that vehicle destroys:

pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{

    if(vehicleid == BuyInfernus)
    {
    SendClientMessage(killerid,COLOR_ELGGREEN, "Your Infernus has been destroyed!");
    OwningInfernus[killerid] = 0;
    }
    else if(vehicleid == BuySavanna)
    {
    SendClientMessage(killerid,COLOR_ELGGREEN, "Your Savanna has been destroyed!");
    OwningSavanna[killerid] = 0;
    }
    else if(vehicleid == BuyManana)
    {
    SendClientMessage(killerid,COLOR_ELGGREEN, "Your Manana has been destroyed!");
    OwningManana[killerid] = 0;
    }
    else if(vehicleid == BuyHuntley)
    {
    SendClientMessage(killerid,COLOR_ELGGREEN, "Your Huntley has been destroyed!");
    OwningHuntley[killerid] = 0;
    }
    if(vehicleid == BuySultan)
    {
    SendClientMessage(killerid,COLOR_ELGGREEN, "Your Sultan has been destroyed!");
    OwningSultan[killerid] = 0;
    }
  return 1;
}
Reply
#2

Not tested, but I think that the killerid is the one which destroyed the car and if you rolled yourself on the roof to make it burn, it will be INVALID_PLAYER_ID
Reply
#3

Quote:
Originally Posted by dice7
Not tested, but I think that the killerid is the one which destroyed the car and if you rolled yourself on the roof to make it burn, it will be INVALID_PLAYER_ID
Thanks, I'll try it

EDIT: It didnt work :S
Reply
#4

OnVehicleDeath just doesn't work in pawno
Reply
#5

Quote:
Originally Posted by ekeleke
OnVehicleDeath just doesn't work in pawno
I dont think so (Correct me if i am wrong)
Reply
#6

Debug the 'killerid' variable to check if it's the same as your playerid. If not, then you'll need a new system
Reply
#7

Quote:
Originally Posted by ekeleke
OnVehicleDeath just doesn't work in pawno
Why shouldn't it work? Why the callback is made then?
Reply
#8

Quote:
Originally Posted by ekeleke
OnVehicleDeath just doesn't work in pawno
This callback was broken in 0.1 version, but it works in 0.2 and 0.3 just fine.
Reply
#9

if(vehicleid == BuyInfernus)

What's BuyInfernus?
Reply
#10

Quote:
Originally Posted by Finn
if(vehicleid == BuyInfernus)

What's BuyInfernus?
It's an vehicle defined to a BuyInfernus variable.

Example:
pawn Код:
new
    BuyInfernus;

public OnGameModeInit()
{
  BuyInfernus = AddStaticVehicle(model_ID, xPos, yPos, zPos, angle, primary_color_ID, secondary_color_ID);
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)