Код:
public OnVehicleSpawn(vehicleid) {
#if defined DEBUG
printf("[debug] OnVehicleSpawn(%d)", vehicleid);
#endif
switch(GetVehicleModel(vehicleid)) {
case 427, 428, 432, 601, 528: SetVehicleHealth(vehicleid, 5000.0); // Enforcer, Securicar, Rhino, SWAT Tank, FBI truck - this is the armour plating dream come true.
}
if(vehicleid != 509 && vehicleid != 481 && vehicleid != 510)
{
SetVehicleParamsEx(vehicleid, 0, 0, 0, 0, 0, 0, 0);
if(IsPackerCar(vehicleid))
{
if(IsWoodVeh[vehicleid])
{
IsWoodVeh[vehicleid] = 0;
if(IsValidDynamicObject(WoodOnVeh[vehicleid]))
{
DestroyDynamicObject(WoodOnVeh[vehicleid]);
}
}
}
if(IsGasCar(vehicleid))
{
if(IsGasOnVeh[vehicleid])
{
IsGasOnVeh[vehicleid] = 0;
if(IsValidDynamicObject(GasOnVeh[vehicleid]))
{
DestroyDynamicObject(GasOnVeh[vehicleid]);
}
}
}
foreach(new i: Player)
{
if(vehicleid == PlayerInfo[i][pVeh])
{
if(PlayerInfo[i][vLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
ChangeVehiclePaintjob(PlayerInfo[i][pVeh], PlayerInfo[i][vPJ]);
SetVehicleVirtualWorld(PlayerInfo[i][pVeh], PlayerInfo[i][pVehVW]);
for(new x=0; x<14; i++)
{
AddVehicleComponent(PlayerInfo[i][pVeh], PlayerInfo[i][pVehMod][x]);
}
}
if(vehicleid == PlayerInfo[i][pVVeh])
{
if(PlayerInfo[i][vvLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
ChangeVehiclePaintjob(PlayerInfo[i][pVVeh], PlayerInfo[i][vvPJ]);
SetVehicleVirtualWorld(PlayerInfo[i][pVVeh], PlayerInfo[i][pVVehVW]);
for(new x=0; x<14; i++)
{
AddVehicleComponent(PlayerInfo[i][pVVeh], PlayerInfo[i][pVVehMod][x]);
}
}
if(vehicleid == RentCarKey[i])
{
if(RentCarLock[i] == 1) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
}
}
}
return 1;
}