01.06.2012, 17:18
hey guys,
im stuck at a problem...
ok so i saw that ingame when a vehicle blows up and dissapears the neons are still there..., so i thought, lets add the delete things at the onvehicledeath... but the problem is.. it doesnt knows playerid.. so i get error undefined symbol playerid... hmm anyways check this code:
should i use killerid? or wont that work?
also if that isnt working please tell me how to fix this,
also how can i make that all the unmanned cars are getting destroyed?, i mean well not all the vehicles, i mean onkly the spawned vehicles a PLAYER spawned, not the cars that are in ongamemodeinit...
anyone knwos how to make this?
i have this but it doesnt works...
ongamemodeinit timer:
anyone knows? 

greets niels
im stuck at a problem...
ok so i saw that ingame when a vehicle blows up and dissapears the neons are still there..., so i thought, lets add the delete things at the onvehicledeath... but the problem is.. it doesnt knows playerid.. so i get error undefined symbol playerid... hmm anyways check this code:
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
//remove neon
DestroyObject(GetPVarInt(playerid, "neon"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon1"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon2"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon3"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon4"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon5"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon6"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon7"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon8"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon9"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon10"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon11"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon12"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "neon13"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "interior"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "interior1"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "back"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "back1"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "front"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "front1"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "undercover"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "undercover1"));
DeletePVar(playerid, "Status");
HasCar[playerid] = 0;
return 1;
}
also if that isnt working please tell me how to fix this,
also how can i make that all the unmanned cars are getting destroyed?, i mean well not all the vehicles, i mean onkly the spawned vehicles a PLAYER spawned, not the cars that are in ongamemodeinit...
anyone knwos how to make this?
i have this but it doesnt works...
pawn Код:
stock VehicleCheck(vehicleid)
{
for(new i = 0; i < MAX_PLAYERS; i++) //All players
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER || GetPlayerState(i) == PLAYER_STATE_PASSENGER)
{
if(GetPlayerVehicleID(i) == vehicleid)
{
DestroyVehicle(vehicleid);
return 1;
}
}
}
return 0;
}
pawn Код:
forward DestroyEmptyCars(vehicleid);
public DestroyEmptyCars(vehicleid)
{
VehicleCheck(vehicleid);
return 1;
}
// the timer that is at ongamemodeinit:
SetTimer("DestroyEmptyCars", 45000, 1);


greets niels