CLEO Help Help, newbie scripting CLEO

CLEO related
Status
Not open for further replies.

nijaiseeyou

Member
Joined
Apr 28, 2013
Messages
15
Reaction score
0
Hello, I am a newbie on scripting cleo I can script really good with SAMP but neither than that suck.
Here is my code
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}
thread 'tire'
:tire_01
wait 0
if
0AB0:   key_pressed 49
else_jump @tire_01
053F: set_car 0@ tires_vulnerability 0
jump @tire_01

:tire_02
wait 0
if
0AB0:   key_pressed 50
else_jump @tire_01
053F: set_car 0@ tires_vulnerability 1
jump @tire_01
Why dose when I press the buttons It gives me a OP code and then eventually crashes my game?
Please show me what I did wrong and possibly explain why It is doing this so I don't run into this problem next time.
 

Z0DY

Well-known member
Joined
Feb 20, 2013
Messages
225
Reaction score
0
You must Define 0@
Code:
    {$VERSION 3.1.0027}
    {$CLEO .cs}
    thread 'tire'
    :tire_01
    wait 0
    if and
    0AB0:   key_pressed 49
    Actor.Driving($player_Actor
    else_jump @tire_01
    0@ = Actor.Car($player_actor)
    053F: set_car 0@ tires_vulnerability 0
    jump @tire_01

    :tire_02
    wait 0
    if and
    0AB0:   key_pressed 50
    Actor.Driving($player_Actor
    else_jump @tire_01
    0@ = Actor.Car($player_actor)
    053F: set_car 0@ tires_vulnerability 1
    jump @tire_01

Try this and see what i changed, 0@ is now our Car and because u only need this when you are in a Car i asked if Actor.Driving.
 

Protential

Active member
Joined
Jun 8, 2013
Messages
61
Reaction score
0
There first part of your cleo will keep looping, making the second part have no functionality.
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}
thread 'tire'
:tire_01
wait 0
if
0AB0:   key_pressed 49
else_jump @tire_01
053F: set_car 0@ tires_vulnerability 0
jump @tire_01
Only the toggle on will work, the toggle off won't work at all.
This should fix it
Code:
{$VERSION 3.1.0027}
    {$CLEO .cs}
    thread 'tire'
    :tire_01
    wait 0
    if and
    0AB0:   key_pressed 49
    Actor.Driving($player_Actor)
    else_jump @tire_01
    0@ = Actor.Car($player_actor)
    053F: set_car 0@ tires_vulnerability 0
    jump @tire_02

    :tire_02
    wait 0
    if and
    0AB0:   key_pressed 50
    Actor.Driving($player_Actor
    else_jump @tire_02
    0@ = Actor.Car($player_actor)
    053F: set_car 0@ tires_vulnerability 1
    jump @tire_01
 

nijaiseeyou

Member
Joined
Apr 28, 2013
Messages
15
Reaction score
0
Seems to look like it works, but It doesn't, It gives me 2 of the same OP codes whenever I press "1" or "2". I really want to get this bad boy up and running.
 

Protential

Active member
Joined
Jun 8, 2013
Messages
61
Reaction score
0
Seems to look like it works, but It doesn't, It gives me 2 of the same OP codes whenever I press "1" or "2". I really want to get this bad boy up and running.
Could you rephrase that?
The script that I posted should work.
 

nijaiseeyou

Member
Joined
Apr 28, 2013
Messages
15
Reaction score
0
[quote author="nijaiseeyou"]Seems to look like it works, but It doesn't, It gives me 2 of the same OP codes whenever I press "1" or "2". I really want to get this bad boy up and running.
Could you rephrase that?
The script that I posted should work.[/quote]
Ops, never mind stupid mistake on my side I had the old script in it aswell.
 

Protential

Active member
Joined
Jun 8, 2013
Messages
61
Reaction score
0
It dose not make the tires invertible
Do you mean invulnerable?
Maybe that OPCode doesn't work on SA:MP, but you could always try alternatives like creating a loop to repair your tires instead of making them invulnerable, it would give the same if not a similar result.
 
Status
Not open for further replies.
Top