public OnVehicleDeath(vehicleid, killerid)
#5

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
pawn Код:
new id, playerid = 12; //<--- or the ID you wish to use other than 12..
id = GetPlayerVehicleID(playerid);
But why do you wanna use that?
OnVehicleDeath already gives you the vehicle id..

OnVehicleDeath(vehicleid /* <--this one */, killerid)
I wanna use that so i can make this code get the playerids vehicleid to remove these objects, or else it removes the objects for all players if i use "vehicleid" instead of "id"
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{

    new i;//New i which defines our playerid..
    for(i = 0; i < MAX_PLAYERS; i ++)// i = 0 and is less than MAX_PLAYERS, increase 0 and loop untill you get to MAX_PLAYERS and return 1..
    {
        if(IsPlayerConnected(i) && GetPlayerVehicleID(i) == vehicleid)//If the player id is connected and there vehicle id = the vehicleid that was destroyed..
        {
            DestroyObject(VehicleBomb[vehicleid][0]);
            DestroyObject(VehicleBomb[vehicleid][1]);
            VehicleFire[vehicleid] = 0;
        }
    }
    return 1;
}
Reply


Messages In This Thread
public OnVehicleDeath(vehicleid, killerid) - by cruising - 13.01.2012, 11:41
Re: public OnVehicleDeath(vehicleid, killerid) - by iPLEOMAX - 13.01.2012, 11:45
Re: public OnVehicleDeath(vehicleid, killerid) - by Voldemort - 13.01.2012, 11:47
Re: public OnVehicleDeath(vehicleid, killerid) - by iPLEOMAX - 13.01.2012, 11:51
Re: public OnVehicleDeath(vehicleid, killerid) - by cruising - 13.01.2012, 11:53
Re: public OnVehicleDeath(vehicleid, killerid) - by cruising - 13.01.2012, 11:57
Re: public OnVehicleDeath(vehicleid, killerid) - by Voldemort - 13.01.2012, 12:03
Re: public OnVehicleDeath(vehicleid, killerid) - by cruising - 13.01.2012, 12:11

Forum Jump:


Users browsing this thread: 1 Guest(s)