samp-stdlib
samp-stdlib copied to clipboard
More INVALID constants
Add commonly used INVALID constants, taken from here:
#define INVALID_SKIN_ID -1
#define INVALID_MODEL_ID -1
#define INVALID_CHECKPOINT_ID -1
#define INVALID_MAPICON_ID -1
#define INVALID_PICKUP_ID -1
#define INVALID_AREA_ID -1
#define INVALID_TIMER_ID -1
#define INVALID_VIRTUAL_WORLD_ID -1
#define INVALID_INTERIOR_ID -1
#define INVALID_CLASS_ID -1
#define INVALID_PAINTJOB_ID -1
#define INVALID_VEHICLE_COLOR_ID -2
#define INVALID_WEAPON_ID -1
There might be others I haven't thought of.
#define INVALID_VEHICLE_COLOR_ID -2
How is this one "invalid"? When you pass a vehicle color ID to SA-MP natives (ChangeVehicleColor, for example), the value gets truncated to just one byte, so for INVALID_VEHICLE_COLOR_ID the value -2 (0xFFFFFFFE) will be treated as 254 (0xFE), which is a valid color ID.
Just see it as having a special meaning, in the same way that often -1 has a special meaning for vehicle colors: https://forum.sa-mp.com/showthread.php?t=339088 https://github.com/Open-GTO/sa-mp-fixes/issues/36