{$CLEO .cs}

0000: NOP

thread 'GLC'
04ED: load_animation 'PED'
04ED: load_animation 'SHOTGUN'

:S
wait 0
if
not Actor.Driving($PLAYER_ACTOR)
jf @S1
0419: 15@ = player $PLAYER_CHAR weapon 12 ammo 
0007: $dist = 0.0
jump @S1

:S1
wait 0
if
not Actor.Driving($PLAYER_ACTOR)
jf @S
04EE: animation 'PED' loaded
04EE: animation 'SHOTGUN' loaded
if
02D7: player $PLAYER_CHAR currentweapon == 26
jf @S
if and
0AB0:   is_key_pressed 0x9
0AB0:   is_key_pressed 0x45
jf @S
if
not 15@ == 0
jf @INFO
0007: $dist = 0.0
Model.Load(#GRENADE)
if
    Model.Available(#GRENADE)
jf @S1
jump @DIST

:DIST
wait 0
if and
0AB0:   is_key_pressed 0x9
0AB0:   is_key_pressed 0x45
jf @C_BEGIN
if
    not $dist > 2.0
then
$dist += 1.0
else
0007: $dist = 3.0
end
0ACE: print_help_formatted "Distance: x%f" $dist
wait 500
jump @DIST

:C_BEGIN
05E6: 7@ = actor $PLAYER_ACTOR struct 
000A: 7@ += 580 // integer values 
05E0: 1@ = read_memory 7@ size 4 virtual_protect 0 
00D6: if or
80DF:   not actor $PLAYER_ACTOR driving 
8039:   not  1@ == 50
jf @S
wait 0
00D6: if 
001B:   42 > 1@ // integer values 
jf @S
000E: 7@ -= 247 // integer values
05E0: 0@ = read_memory 7@ size 1 virtual_protect 0 
00D6: if 
001B:   8 > 0@ // integer values 
jf @S
000A: 7@ += 3 // integer values 
05E0: 0@ = read_memory 7@ size 1 virtual_protect 0 
00D6: if 
0039:   0@ == 24 // integer values 
jf @CHECK
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 0.25 -0.25
0002: jump @C_1

:CHECK
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 0.25 0.5
gosub @BOMB
wait 1000
jump @S

:C_1
wait 0
gosub @BOMB_C
wait 1000
jump @S

:BOMB
wait 0
if
02D7: player $PLAYER_CHAR currentweapon == 26
jf @INFO01
0673: play_animation on actor $PLAYER_ACTOR animgroup 15 anim 205 blendfactor 30.0
wait 275
15@ -= 1
017A: set_player $PLAYER_CHAR weapon 12 ammo_to 15@
04C4: create_coordinate 0@ 1@ 2@ from_actor $PLAYER_ACTOR offset 0.0 1.2 0.0
0437: scatter_particle 18 0.7 at 0@ 1@ 2@ 0 0 0
0437: scatter_particle 18 0.7 at 0@ 1@ 2@ 0 0 0
0437: scatter_particle 18 0.7 at 0@ 1@ 2@ 0 0 0
04C4: create_coordinate 0@ 1@ 2@ from_actor $PLAYER_ACTOR offset 0.0 1.75 0.0
Object.Create(4@,#GRENADE,0@,1@,2@)
Object.ToggleInMovingList(4@)=True
10@ = Actor.Angle($PLAYER_ACTOR)
Object.Angle(4@) = 10@
Object.CollisionDetection(4@)=True
gosub @VELOCITY
wait 650
0400: create_coordinate 0@ 1@ 2@ from_object 4@ offset 0.0 0.0 0.0
020C: create_explosion_with_radius 0 at 0@ 1@ 2@
Object.Destroy(4@)
return

:BOMB_C
wait 0
if
02D7: player $PLAYER_CHAR currentweapon == 26
jf @INFO01
0673: play_animation on actor $PLAYER_ACTOR animgroup 15 anim 206 blendfactor 30.0
wait 275
15@ -= 1
017A: set_player $PLAYER_CHAR weapon 12 ammo_to 15@
04C4: create_coordinate 0@ 1@ 2@ from_actor $PLAYER_ACTOR offset 0.0 1.2 -0.25
0437: scatter_particle 18 0.7 at 0@ 1@ 2@ 0 0 0
0437: scatter_particle 18 0.7 at 0@ 1@ 2@ 0 0 0
0437: scatter_particle 18 0.7 at 0@ 1@ 2@ 0 0 0
04C4: create_coordinate 0@ 1@ 2@ from_actor $PLAYER_ACTOR offset 0.0 1.75 -0.25
Object.Create(4@,#GRENADE,0@,1@,2@)
Object.ToggleInMovingList(4@)=True
10@ = Actor.Angle($PLAYER_ACTOR)
Object.Angle(4@) = 10@
Object.CollisionDetection(4@)=True
gosub @VELOCITY
if
    $dist > 1.0
then
wait 1050
else
    if
    $dist > 2.0
    then
    wait 950
    else
        if
        $dist > 3.0
        then
        wait 850
        else
            if
            $dist > 4.0
            then
            wait 750
            else
            wait 650
            end
        end
    end
end
0400: create_coordinate 0@ 1@ 2@ from_object 4@ offset 0.0 0.0 0.0
020C: create_explosion_with_radius 0 at 0@ 1@ 2@
Object.Destroy(4@)
return

:VELOCITY
if
    $dist > 1.0
then
0007: $final = 41.0
else
    if
    $dist > 2.0
    then
    0007: $final = 35.0
    else
        if
        $dist > 3.0
        then
        0007: $final = 24.0
        else
        0007: $final = 17.0
        end
    end
end
FOR $MyCounter = 1.0 to $final step 2.0
wait 10
0400: create_coordinate 0@ 1@ 2@ from_object 4@ offset 0.0 1.0 0.5
01BC: put_object 4@ at 0@ 1@ 2@
end
return

:INFO
wait 0
0ACE: print_help_formatted "You don't have enough grenades !" 0
wait 500
jump @S

:INFO01
wait 0
0ACE: print_help_formatted "Wrong Weapon Selected!" 0
wait 500
jump @S