03.01.2013, 10:04
Hey guys. So, I have a car script, and wanna create function which will destroy vehicle after she death (becouse without destroying it appears in spawn).
Okay. I was creating destroy script in callback OnVehicleDeath like this:
But then i get errors about playerid, becouse OnVehicleDeath cannot read playerid......
I was trying to create script like this
But after destroying, vehicles is disappears for all server players.
Please help!
Okay. I was creating destroy script in callback OnVehicleDeath like this:
PHP код:
if(CreateCar[playerid] != -1)
{
DestroyVehicle(CreateCar[playerid]);
CreateCar[playerid] = -1;
}
I was trying to create script like this
PHP код:
public OnVehicleDeath(vehicleid, killerid)
{
for(new playerid;playerid<MAX_PLAYERS;playerid++)
{
if(CreateCar[playerid] != -1)
{
DestroyVehicle(CreateCar[playerid]);
CreateCar[playerid] = -1;
}
}
return 1;
}
Please help!