Invader666
Member
Hello, i wanted a mod which triggers a sound whenever there is some text on chat like "SMS from xxx". I tried to make it but its not working. I dont know what im doing wrong here. Please help
Code:
{$CLEO .cs}
0000: NOP
/* this part requires sampfuncs
repeat
wait 50
until 0AFA: is_samp_structures_available
*/
repeat
wait 50
UNTIL 0AFA: SAMP_IS_READY
056D: actor $PLAYER_ACTOR defined
while true
if
WAIT 0
0AC8: 0@ = allocate_memory_size 260
0B75: samp get_chat_string 99 text_to 0@ prefix_to 33@ color_to 33@ prefix_color_to 33@
IF
0AD4: 33@ = scan_string 0@ format "SMS from" 1@v // used: 1@,2@,3@,4@
then
0AAE: release_mp3 $hMP1 1@v
0AAC: $hMP1 = load_audiostream "CLEO/music/Alert.MP3"
0ABC: set_audiostream $hMP1 volume 1.0
0AAD: set_mp3 $hMP1 perform_action 1 //0=stop, 1=play, 2=pause, 3=resume
0AAF: 0@ = get_mp3_length $hMP1
wait 1000
end
0AC9: free_allocated_memory 0@
end