Hi.
I have this code:
How i can detect if the "play1" is activated? Like if it's activated, send a chat message with "Audio1 is already playing. Use /stop1 to stop it" and so on.
@monday helped me with the code above.
Thanks in advance.
Sorry for my bad english
I have this code:
PHP:
{$CLEO .cs}
0000: NOP
// this part requires sampfuncs
repeat
wait 50
until 0AFA: is_samp_structures_available
0b34: "play1" @play1
0b34: "stop1" @stop1
0b34: "play2" @play2
0b34: "stop2" @stop2
0b34: "play3" @play3
0b34: "stop3" @stop3
0b34: "play4" @play4
0b34: "stop4" @stop4
0b34: "play5" @play5
0b34: "stop5" @stop5
0b34: "play6" @play6
0b34: "stop6" @stop6
0b34: "play7" @play7
0b34: "stop7" @stop7
0b34: "play8" @play8
0b34: "stop8" @stop8
0b34: "play9" @play9
0b34: "stop9" @stop9
0b34: "play10" @play10
0b34: "stop10" @stop10
:cmd_999
wait 0
jump @cmd_999
repeat
wait 50
until 056D: actor $PLAYER_ACTOR defined
////////////////////PLAY 1////////////////////
:play1
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP1
0AAC: $hMP1 = load_audiostream "cleo/music/1.mp3"
0ABC: set_audiostream $hMP1 volume 1.0
0AAD: set_mp3 $hMP1 perform_action 1 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////STOP 1////////////////////
:stop1
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP1
0AAC: $hMP1 = load_audiostream "cleo/music/1.mp3"
0ABC: set_audiostream $hMP1 volume 1.0
0AAD: set_mp3 $hMP1 perform_action 0 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////PLAY 2////////////////////
:play2
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP2
0AAC: $hMP2 = load_audiostream "cleo/music/2.mp3"
0ABC: set_audiostream $hMP2 volume 1.0
0AAD: set_mp3 $hMP2 perform_action 1 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////STOP 2////////////////////
:stop2
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP2
0AAC: $hMP2 = load_audiostream "cleo/music/2.mp3"
0ABC: set_audiostream $hMP2 volume 1.0
0AAD: set_mp3 $hMP2 perform_action 0 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////PLAY 3////////////////////
:play3
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP3
0AAC: $hMP3 = load_audiostream "cleo/music/3.mp3"
0ABC: set_audiostream $hMP3 volume 1.0
0AAD: set_mp3 $hMP3 perform_action 1 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////STOP 3////////////////////
:stop3
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP3
0AAC: $hMP3 = load_audiostream "cleo/music/3.mp3"
0ABC: set_audiostream $hMP3 volume 1.0
0AAD: set_mp3 $hMP3 perform_action 0 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////PLAY 4////////////////////
:play4
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP4
0AAC: $hMP4 = load_audiostream "cleo/music/4.mp3"
0ABC: set_audiostream $hMP4 volume 1.0
0AAD: set_mp3 $hMP4 perform_action 1 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////STOP 4////////////////////
:stop4
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP4
0AAC: $hMP4 = load_audiostream "cleo/music/4.mp3"
0ABC: set_audiostream $hMP4 volume 1.0
0AAD: set_mp3 $hMP4 perform_action 0 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////PLAY 5////////////////////
:play5
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP5
0AAC: $hMP5 = load_audiostream "cleo/music/5.mp3"
0ABC: set_audiostream $hMP5 volume 1.0
0AAD: set_mp3 $hMP5 perform_action 1 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////STOP 5////////////////////
:stop5
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP5
0AAC: $hMP5 = load_audiostream "cleo/music/5.mp3"
0ABC: set_audiostream $hMP5 volume 1.0
0AAD: set_mp3 $hMP5 perform_action 0 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////PLAY 6////////////////////
:play6
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP6
0AAC: $hMP6 = load_audiostream "cleo/music/6.mp3"
0ABC: set_audiostream $hMP6 volume 1.0
0AAD: set_mp3 $hMP6 perform_action 1 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////STOP 6////////////////////
:stop6
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP6
0AAC: $hMP6 = load_audiostream "cleo/music/6.mp3"
0ABC: set_audiostream $hMP6 volume 1.0
0AAD: set_mp3 $hMP6 perform_action 0 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////PLAY 7////////////////////
:play7
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP7
0AAC: $hMP7 = load_audiostream "cleo/music/7.mp3"
0ABC: set_audiostream $hMP7 volume 1.0
0AAD: set_mp3 $hMP7 perform_action 1 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////STOP 7////////////////////
:stop7
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP7
0AAC: $hMP7 = load_audiostream "cleo/music/7.mp3"
0ABC: set_audiostream $hMP7 volume 1.0
0AAD: set_mp3 $hMP7 perform_action 0 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////PLAY 8////////////////////
:play8
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP8
0AAC: $hMP8 = load_audiostream "cleo/music/8.mp3"
0ABC: set_audiostream $hMP8 volume 1.0
0AAD: set_mp3 $hMP8 perform_action 1 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////STOP 8////////////////////
:stop8
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP8
0AAC: $hMP8 = load_audiostream "cleo/music/8.mp3"
0ABC: set_audiostream $hMP8 volume 1.0
0AAD: set_mp3 $hMP8 perform_action 0 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////PLAY 9////////////////////
:play9
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP9
0AAC: $hMP9 = load_audiostream "cleo/music/9.mp3"
0ABC: set_audiostream $hMP9 volume 1.0
0AAD: set_mp3 $hMP9 perform_action 1 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////STOP 9////////////////////
:stop9
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP9
0AAC: $hMP9 = load_audiostream "cleo/music/9.mp3"
0ABC: set_audiostream $hMP9 volume 1.0
0AAD: set_mp3 $hMP9 perform_action 0 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////PLAY 10////////////////////
:play10
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP10
0AAC: $hMP10 = load_audiostream "cleo/music/10.mp3"
0ABC: set_audiostream $hMP10 volume 1.0
0AAD: set_mp3 $hMP10 perform_action 1 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
////////////////////STOP 10////////////////////
:stop10
SAMP.IsCommandTyped(20@)
0AAE: release_mp3 $hMP10
0AAC: $hMP10 = load_audiostream "cleo/music/10.mp3"
0ABC: set_audiostream $hMP10 volume 1.0
0AAD: set_mp3 $hMP10 perform_action 0 //0=stop, 1=play
wait 1000
SAMP.CmdRet()
@monday helped me with the code above.
Thanks in advance.
Sorry for my bad english
Last edited: