CMD:trunk(playerid)
{
new engine,lights,alarm,doors,bonnet,boot,objective, Float:X, Float:Y, Float:Z, string[90];
for(new vid = 0; vid < MAX_VEHICLES; vid++){
if(vid != INVALID_VEHICLE_ID) {
GetVehiclePos(vid, X, Y, Z);
if(!IsPlayerInRangeOfPoint(playerid, 5, X, Y, Z)) return 1;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
if(boot == VEHICLE_PARAMS_ON){
SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
format(string, sizeof(string), "closes the trunk of %s.", GetVehicleName(vid));
return PlayerActionMsg(playerid, string);
}
SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
format(string, sizeof(string), "opens the trunk of %s.", GetVehicleName(vid));
return PlayerActionMsg(playerid, string);
}
}
return 1;
}
https://sampforum.blast.hk/showthread.php?tid=305771
Try my include -> it has everything connected to vehicles (boot, boonet, doors, etc.) |
if (strcmp("close", option, true, 5) == 0){
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
if(boot == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR:] The trunk is already closed.");
SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
format(string, sizeof(string), "closes the trunk of %s.", GetVehicleName(vid));
return PlayerActionMsg(playerid, string);
}
public OnVehicleSpawn(vehicleid)
{
new engine,lights,alarm,doors,bonnet,boot,objective
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,0,objective);
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
new engine,lights,alarm,doors,bonnet,boot,objective
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
return 1;
}