CLEO Help sounds play

CLEO related
Status
Not open for further replies.

pai1ne13

Active member
Joined
Jan 2, 2019
Messages
59
Reaction score
4
hello, i wanna play more sounds when a the player have a check point on but I do not know how to declare this function and when i press "X" or 'Y" the sounds start at exactly time. How can i fix it?
Code:
{$CLEO .cs}
0000: NOP

repeat
wait 50
until 0AFA: is_samp_structures_available


repeat
wait 50
until 056D: actor $PLAYER_ACTOR defined

while true
wait 0
    if or
key_down 89 = 30@
key_down 88 =  32@
then
0AAE: release_mp3 30@
0aae: 32@
0AAC: 30@ = load_audiostream "CLEO/music/s1.MP3"
0AAC: 32@ = load_audiostream "CLEO/music/s2.MP3"
0ABC: set_audiostream 30@  volume 2.0
0ABC: set_audiostream 32@  volume 2.0
0AAD: set_mp3 30@  perform_action 1
0AAD: set_mp3 32@  perform_action 1
0AAF: 1@ = get_mp3_length 30@
0AAF: 0@ = get_mp3_length 32@

0AAC: 30@ = load_audiostream "CLEO/music/s1.MP3"
0AAC: 32@ = load_audiostream "CLEO/music/s2.MP3"


        wait 1000
    end
end
 
Last edited:

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
PHP:
{$CLEO .cs}
0000: NOP
 
repeat
wait 0
until 0AFA: is_samp_structures_available


repeat
wait 0
until 056D: actor $PLAYER_ACTOR defined

while true
wait 0
    if or
        key_down 89
        key_down 88
    then
        0AAC: 30@ = load_audiostream "CLEO\music\s1.mp3"
        0ABC: set_audiostream 30@  volume 2.0 
        0AAD: set_mp3 30@ perform_action 1
        repeat
        wait 0
            0AB9: get_mp3 30@ state_to 29@
        until 29@ < 0
        0AAE: release_mp3 30@
        
        0AAC: 30@ = load_audiostream "CLEO\music\s2.mp3"
        0ABC: set_audiostream 30@  volume 2.0 
        0AAD: set_mp3 30@ perform_action 1
        repeat
        wait 0
            0AB9: get_mp3 30@ state_to 29@
        until 29@ < 0
        0AAE: release_mp3 30@
    end
end
 

pai1ne13

Active member
Joined
Jan 2, 2019
Messages
59
Reaction score
4
PHP:
{$CLEO .cs}
0000: NOP

repeat
wait 0
until 0AFA: is_samp_structures_available


repeat
wait 0
until 056D: actor $PLAYER_ACTOR defined

while true
wait 0
    if or
        key_down 89
        key_down 88
    then
        0AAC: 30@ = load_audiostream "CLEO\music\s1.mp3"
        0ABC: set_audiostream 30@  volume 2.0
        0AAD: set_mp3 30@ perform_action 1
        repeat
        wait 0
            0AB9: get_mp3 30@ state_to 29@
        until 29@ < 0
        0AAE: release_mp3 30@
       
        0AAC: 30@ = load_audiostream "CLEO\music\s2.mp3"
        0ABC: set_audiostream 30@  volume 2.0
        0AAD: set_mp3 30@ perform_action 1
        repeat
        wait 0
            0AB9: get_mp3 30@ state_to 29@
        until 29@ < 0
        0AAE: release_mp3 30@
    end
end
ok thanks so much, but how can i play this sounds when a checkpoints is on?
 

pai1ne13

Active member
Joined
Jan 2, 2019
Messages
59
Reaction score
4
PHP:
{$CLEO .cs}
0000: NOP

repeat
wait 0
until 0AFA: is_samp_structures_available


repeat
wait 0
until 056D: actor $PLAYER_ACTOR defined

while true
wait 0
    if or
        key_down 89
        key_down 88
    then
        0AAC: 30@ = load_audiostream "CLEO\music\s1.mp3"
        0ABC: set_audiostream 30@  volume 2.0
        0AAD: set_mp3 30@ perform_action 1
        repeat
        wait 0
            0AB9: get_mp3 30@ state_to 29@
        until 29@ < 0
        0AAE: release_mp3 30@
       
        0AAC: 30@ = load_audiostream "CLEO\music\s2.mp3"
        0ABC: set_audiostream 30@  volume 2.0
        0AAD: set_mp3 30@ perform_action 1
        repeat
        wait 0
            0AB9: get_mp3 30@ state_to 29@
        until 29@ < 0
        0AAE: release_mp3 30@
    end
end
the s1 play again and again, s2 dont play
 

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
ok thanks so much, but how can i play this sounds when a checkpoints is on?
PHP:
while true
wait 0
    if call @is_cp_active 0
    then
        //do stuff                                     
    end   
end

:is_cp_active
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x24
0A8D: 1@ = readMem 1@ sz 4 vp 0
IF 1@ == TRUE
THEN 0485:  return_true
ELSE 059A:  return_false
END
0AA3: freelib 0@
0AB2: ret 0
 

pai1ne13

Active member
Joined
Jan 2, 2019
Messages
59
Reaction score
4
PHP:
while true
wait 0
    if call @is_cp_active 0
    then
        //do stuff                                    
    end  
end

:is_cp_active
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x24
0A8D: 1@ = readMem 1@ sz 4 vp 0
IF 1@ == TRUE
THEN 0485:  return_true
ELSE 059A:  return_false
END
0AA3: freelib 0@
0AB2: ret 0
thanks for this man
 
Status
Not open for further replies.
Top