Quantcast

Jump to content

» «
Photo

Adrenaline/Crank mod help!

2 replies to this topic
oswi54
  • oswi54

    Player Hater

  • Members
  • Joined: 19 Jun 2013

#1

Posted 23 September 2013 - 06:51 AM

Hi! I wanted to write in cleo a mod, that require from the player, to run, ride a car very fast, do stunt jumps, and everything insane which would allow him to increase adrenaline level. My code: 

{$CLEO .cs}
0000: NOP

:start
wait 10
if
Player.Defined($PLAYER_CHAR)
jf @start

:c1
wait 10
if and
00E1: player 0 pressed_key 1
00E1: player 0 pressed_key 16
jf @c2
00BB: show_text_lowpriority GXT 'CRKU' time 1000 flag 1  //Adrenaline level is increasing!
0003: shake_camera 0
jump @start

:c2
wait 10
if and
044B:   actor $PLAYER_ACTOR on_foot
02A0:   actor $PLAYER_ACTOR stopped
jf @c3
00BB: show_text_lowpriority GXT 'CRKD' time 1000 flag 1  //Adrenaline level is decreasing!
wait 5000
00BB: show_text_lowpriority GXT 'URD' time 2000 flag 1 //You're dying!
wait 3000
0003: shake_camera 1000
jump @start

:c3
wait 10
if and
0449:   actor $PLAYER_ACTOR in_a_car
02A0:   actor $PLAYER_ACTOR stopped
jf @c4
00BB: show_text_lowpriority GXT 'CRKD' time 1000 flag 1  //Adrenaline level is decreasing!
jump @start

:c4
wait 10
if and
0449:   actor $PLAYER_ACTOR in_a_car
00E1:   player 0 pressed_key 1
jf @start
00BB: show_text_lowpriority GXT 'CRKU' time 1000 flag 1  //Adrenaline level is increasing!
jump @start

It hasn't these stunts thing yet but I want to add this later. Could someone help me with this code? My problem is that it works as it works...dumbly. When I'm standing in one place, the textes that level decreases appear, but In same time I start to run and it does'n show that Level is increasing but it shows that I'm dying etc. How would you write this code? (Sorry for my english I'm from Poland)


xNCx
  • xNCx

    VCMP beta tester

  • Members
  • Joined: 15 May 2008
  • None

#2

Posted 23 September 2013 - 06:49 PM

Cześć.

 

First of all you need to rewrite you code a little, my eyes hurt when using jf @label. I know, sometimes you have to do it, but I try to avoid it. Try to rewrite this code, for example:

:c1
wait 10

//player running
if and
key 1
key 16
then
**your code**
end

//player doing something else
if and
key 1
actor in car
then
****
end

jump @c1 <- do not forget this

It will look much better. Still not the best, but this should be enough.

 

About your issue, see how your code works:

1. you stand still, triggers script

2. Adrenaline level is decreasing!

3. wait 5000

4. You're dying!

5. wait 3000

 

Which means, that if you are NOW not moving, the effects of this will happen over the next 8 seconds. However, if you will be running for 8 seconds, the messages should not reappear.

  • oswi54 likes this

oswi54
  • oswi54

    Player Hater

  • Members
  • Joined: 19 Jun 2013

#3

Posted 23 September 2013 - 07:39 PM

Thank, you. Now it works as it should ;) I think that I will can do other things. Thanks.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users