Jump to content

Mp3 Script at 30 percent health


Recommended Posts

Hi guys

 

Im having problems with this script. It works on my friends machine but not on mine. Im so confused.

 

When health reaches below 30 percent SuitAlarm.mp3 should play but on my system it plays but crashes while playing.

 

 

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------thread 'SPARTANHEALTH' Audiostream.Load(5@, "CLEO\SUITALARM.MP3"):SPARTANHEALTH_44wait 0 1@ = Actor.Health($PLAYER_ACTOR)0085: 2@ = 1@ // (int) if  30 >= 1@ else_jump @SPARTANHEALTH_44 0169: set_fade_color_RGB 255 0 0 Audiostream.PerformAction(5@, STOP)Audiostream.PerformAction(5@, PLAY)fade 0 2000 wait 1000 fade 1 2000 wait 1000 2@ += 1 Actor.Health(1@) = 2@jump @SPARTANHEALTH_44

 

Link to comment
https://gtaforums.com/topic/459348-mp3-script-at-30-percent-health/
Share on other sites

Hi yair1221

 

I believe you have made the script for LordNiti, I am JohnPro and LordNiti has provided me with your script. The script works on Lordniti's machine however on mine it crashes.

 

All my other cleo scripts work without problems, including a death script which plays an MP3 when health reaches 0.

 

I am using Cleo 4

Edited by JohnPro

Your code fails more.. don't use global variables tounge2.gif

 

The script looks fine to me, although the MP3 doesn't need to be loaded all the time. I'm confused by the use of the Actor.Health class thing as both a get and set command, though. Does that work properly? Bahh.. pointless using classes when there are over 1,600 unclassed opcodes.

 

But since bass.dll uses system functions to play audio, it is easily possible that it can work on one machine and not on another. Some have said they have problems with playing audiostreams with CLEO 4.

or try mine tounge.gif

P.S. Didn't test and probably still not gunna work tounge.gif

 

 

{$CLEO .cs}//-------------MAIN---------------thread 'SPARTANHEALTH':SPARTANHEALTH_44wait 0Audiostream.Load(5@, "CLEO\SUITALARM.MP3")1@ = Actor.Health($PLAYER_ACTOR)0085: 2@ = 1@ // (int)if1@ <= 30jf @SPARTANHEALTH_440169: set_fade_color_RGB 255 0 0Audiostream.PerformAction(5@, STOP)Audiostream.PerformAction(5@, PLAY)fade 0 2000wait 1000fade 1 2000wait 10002@ += 1Actor.Health(1@) = 2@jump @SPARTANHEALTH_44

 

Who wrote this script:?

 

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------thread 'SPARTANHEALTH'Audiostream.Load(5@, "CLEO\SUITALARM.MP3"):SPARTANHEALTH_44wait 01@ = Actor.Health($PLAYER_ACTOR) 0085: 2@ = 1@ // (int)if30 >= 1@else_jump @SPARTANHEALTH_440169: set_fade_color_RGB 255 0 0Audiostream.PerformAction(5@, STOP)Audiostream.PerformAction(5@, PLAY)fade 0 2000wait 1000fade 1 2000wait 10002@ += 1Actor.Health(1@) = 2@jump @SPARTANHEALTH_44

 

 

It fails in too many ways

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.