Closed ghost closed 9 years ago
Sorry but you misunderstood me. You should change the return type of paremters, insted of function.
from: int GetVehicleParamsEx([in] int vehicleid, [out] bool engine, [out] bool lights, [out] bool alarm, [out] bool doors, [out] bool bonnet, [out] bool boot, [out] bool objective);
to:
bool GetVehicleParamsEx([in] int vehicleid, [out] int engine, [out] int lights, [out] int alarm, [out] int doors, [out] int bonnet, [out] int boot, [out] int objective);
See here: https://github.com/kurta999/YSF/blob/YSF_/src/Functions.cpp#L87
Please do the same thing with:
SetVehicleParamsEx SetVehicleParamsCarDoors SetVehicleParamsCarWindows
These callbacks need to accept VEHICLE_PARAMS_UNSET, then them won't do anything. Where I need this? Vehicle streamer for streamer plugin.
Thanks.
I don't think you can set vehicle params to 'unset' right? wouldn't that be rather pointless?
Any function with 'VehicleParam' in it has 3 return types for their parameters.
-1, 0 and 1.
But the functions themselves only return true or false if the vehicle exists or not.
The parameter types for the getters are already int pointers, he's talking about the setters now.
In PAWN you too use int to get vehicle door parameters, get door will return -1 and you will set it to -1 too and nothing will happen. I want to do that in C, now I need to convert char variables to bool because of this function.
So you can set vehicle parameters to "unset"? That makes no sense...
Yea, thats what I'm saying.
Any vehicle funciton in sa-mp that has 'param' in it, carries '-1, 0 and 1' 'VEHICLE_PARAM_UNSET (OFF, ON)' in there parameters... Only function that doesn't carry this is 'SetVehicleParamsForPlayer'.
Another example :D
I want to onvehicle engine, but I don't want to touch ex. objective and other parameters. Then I would just set engine to 1 and leave another 6 parameter as unset because I don't want to change them.
OK, it's probably not as bad as I thought. But still, I think it could be done without adding VEHICLE_PARAM_UNSET - just call GetVehicleParamsEx and pass back the values it returned for those params that you don't want to change.
Thank you!!!
GetVehicleParamsEx can return as VEHICLE_PARAMS_UNSET (-1), when vehicle params hasn't been set.
Please fix this.
http://wiki.sa-mp.com/wiki/GetVehicleParamsEx