08.01.2012, 05:03
What is wrong with this code? The trunk won't open.
pawn Код:
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;
}