CLEO Help How do I put a max/min to this variable?

CLEO related
Status
Not open for further replies.

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
I want to put a maximum or minimum to 28@ but i can't, I tried with "for 28@" but is not working, it always remain at 0. I want to put a minimum of 0 and maximum of 14.

Code:
{$CLEO .cs}

0000: NOP

while true
wait 0
if
0ADC: "i"
then
28@ += 1
04B8: get_weapon_data_from_actor $PLAYER_ACTOR slot 28@ weapon 31@ ammo 30@ model 29@
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 31@
end
if                                                                                   
0ADC: "o"                                                                            
then                                                                                 
28@ -= 1                                                                             
04B8: get_weapon_data_from_actor $PLAYER_ACTOR slot 28@ weapon 31@ ammo 30@ model 29@
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 31@
end                                                                                  
end
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,498
Solutions
1
Reaction score
243
Location
( ͡° ͜ʖ ͡°)
Code:
IF
28@ < 0 {IF VALUE OF 28@ IS SMALLER THAN ZERO}
THEN
    28@ = 0
END
IF
28@ > 14 {IF VALUE OF 28@ IS BIGGER THAN FOURTEEN}
THEN
    28@ = 14
END
 
Status
Not open for further replies.
Top