10.11.2012, 12:14
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):
now everything should work properly.
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);
}
}