function calc takes real a, real b, string x returns real
if x == "+" then
return a + b
elseif x == "-" then
return a - b
elseif x == "*" then
return a * b
elseif x == "/" then
return a / b
elseif x == "^" then
For function "constants", just use direct returns (as done above) as well.
call DisplayTimedTextToForce(GetPlayersAll(), 6.00, a)
set a = ""
Use bj_FORCE_ALL_PLAYERS directly instead of GetPlayersAll(), and you don't need to set a to "".
Also, I don't understand this code that much:
if S2R(S) == I2R(R2I(S2R(S))) then
set S = I2S(R2I(S2R(S)))
Well, unless you are trying to compare it to the truncated value.
That's all I could really find at the moment.