1) If I may add my opinion on the programing syntax, variables should start with a lower-case letter, expInteger but nvm

2) I suggest adding the following line.
Code: Select all
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,I2S(ExpInteger)) // shows the final value of ExpInteger
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,I2S(Round2I(ExpInteger))) // shows the value the function returns
// this code was written in the forum and not in jasscraft so I might have made some syntax errors, but I trust you to fix them if I did :)
Edit: My suggested code.
remove the NOT for a cleaner reading.
add a debuging message (DisplayTextToPlayer..)
add an elseif statemant to stop it from going through un-needed code (if ExpInteger>=20 it can't be <=0)
Code: Select all
if (ExpInteger>=20) then
set ExpInteger=20
elseif (ExpInteger<=0) then
set ExpInteger=0
endif
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,I2S(ExpInteger)) // shows the final value of ExpInteger
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,I2S(Round2I(ExpInteger))) // shows the value the function returns
return Round2I(ExpInteger)