There is no Random function in GTA2 but you can do a workarround (a modulo operation)
Code: Select all
SET temp = ( rand / 33 )
SET temp = ( temp * 33 )
SET surp_sel= ( rand - temp )
33 is the maximum random value
rand is a counter that is increased every WHILE_EXEC cycle and reset on pseudo random events.
It is important that it is a value that is different in every game and that the seed(rand) happens more often than event(surp_sel) otherwise you could get a repeating pattern.
If you use the same seed for multiple events ensure that the max values do not have a common divisor otherwise you will have correlations.
You can look how it works on
BC Awkward Cargo