destroy vehicle
#3

the callback don't have the parameter : "playerid" which means you can't use functions that require the id of the player.
So to fix this you'll need to store the playerid in array and then use it when you need it(when the vehicle die\explode):
pawn Код:
new pid[MAX_PLAYERS]; // Array that will hold the playerid
public OnPlayerConnect(playerid)
{
    pid[playerid] = playerid;// here we store the playerid in the pid array
    return 1;
}
public OnVehicleDeath(vehicleid)
{
         if(vehicleid==CEM[pid][createdvehid])  // here we use it,if the vehicleid equals the vehicleid of the player,the vehicle will destroy
         {
                   DestroyVehicle(vehicleid);
         }
}
now everything should work properly.
Reply


Messages In This Thread
destroy vehicle - by Virus. - 10.11.2012, 11:27
Re: destroy vehicle - by SKAzini - 10.11.2012, 11:58
Re: destroy vehicle - by Skillet` - 10.11.2012, 12:14
Re: destroy vehicle - by Virus. - 10.11.2012, 13:18
Re: destroy vehicle - by SKAzini - 10.11.2012, 20:32

Forum Jump:


Users browsing this thread: 1 Guest(s)