CLEO Help CLEO HELP - Simple Commands (/command)

CLEO related
Status
Not open for further replies.

TrollerYash

Active member
Joined
May 7, 2013
Messages
52
Reaction score
0
Hey, I need some help regarding COMMANDS for cleo.

I want to make a simple test cleo, which when I type /.addnos it adds nitro in my vehicle..

I saw a tutorial here, but I tried everything I could but it didn't work.

It did compile but it didn't work INGAME.

I need help please.
 

ejexter

Well-known member
Joined
Feb 21, 2014
Messages
211
Reaction score
0
TrollerYash link said:
Hey, I need some help regarding COMMANDS for cleo.

I want to make a simple test cleo, which when I type /.addnos it adds nitro in my vehicle..

I saw a tutorial here, but I tried everything I could but it didn't work.

It did compile but it didn't work INGAME.

I need help please.


CODE:

{$CLEO .cs}
thread "CarNitro"
0662: "by Pa0NeiX"
0B34: samp register_client_command ".givenitro" to_label @NITRO

:LOOP
wait 0
goto @LOOP

:NITRO
wait 0
if
00DF: actor $PLAYER_ACTOR driving
jf @NITRO
$CAR = Actor.CurrentCar($PLAYER_ACTOR)
09E9: car $CAR add_single_nitro
0AF8: samp add_message_to_chat "{FF9600}[ANNOUNCE] {FFFF00}NITRO ADDED" color 0xFFFFFFAA
SAMP.CmdRet()
goto @LOOP


0B34: samp register_client_command ".givenitro" to_label @NITRO
RED = The Command [/.givenitro] | GREEN = GOTO LABEL

SAMP.CmdRet()
MUST TO ADD TO END LINE
 

MrChristmas

Expert
Joined
Jul 29, 2014
Messages
563
Reaction score
26
There's no way (In my opinion) to make something like 
$CAR = Actor.CurrentCar($PLAYER_ACTOR)
You need to add variable to make it work
e.g. 10@ or 12@

Also you can't have nitro in bikes, planes and boats so you need to make script to do not activate when player is in boat, plane or bike.


Replace the line in your script with this one

:NITRO
wait 5
if and
0449:  actor $PLAYER_ACTOR in_a_car
  NOT 04A7:  actor $PLAYER_ACTOR driving_boat
  NOT 047A:  actor $PLAYER_ACTOR driving_bike
    NOT Actor.DrivingPlane($PLAYER_ACTOR)
10@ = Actor.CurrentCar($PLAYER_ACTOR)
09E9: car 10@ add_single_nitro
0AF8: samp add_message_to_chat "{FF9600}[ANNOUNCE] {FFFF00}NITRO ADDED" color 0xFFFFFFAA
SAMP.CmdRet()
goto @LOOP
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
It crashes you onfoot because the script jumps from the main label to another label without using cmdret.
Code:
{$CLEO .cs}

0B34: samp register_client_command ".addnos" to_label @MAIN

:LOOP
wait 0
cmdret
goto @LOOP

:MAIN
wait 0
if
Player.Defined($PLAYER_CHAR)
jf @LOOP
if and
Actor.Driving($PLAYER_ACTOR)
847A:   actor $PLAYER_ACTOR driving_bike
84A7:   actor $PLAYER_ACTOR driving_boat
84AB:   actor $PLAYER_ACTOR driving_plane
89AE:   actor $PLAYER_ACTOR driving_train
jf @LOOP
$CURRENT_CAR = Actor.CurrentCar($PLAYER_ACTOR)
09E9: car $CURRENT_CAR add_single_nitro
0AF8: samp add_message_to_chat "Nitro added" color -1
cmdret
Mr.Christmas link said:
There's no way (In my opinion) to make something like  You need to add variable to make it work
Also you can't have nitro in bikes, planes and boats so you need to make script to do not activate when player is in boat, plane or bike.


Replace the line in your script with this one
$CAR can be used too.
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
04A7 is not any cleo opcode or directive and will give errors upon compilation.

Add these instead:

Code:
84C8:   not actor $PLAYER_ACTOR driving_flying_vehicle 
84AB:   not actor $PLAYER_ACTOR driving_plane 
84A9:   not actor $PLAYER_ACTOR driving_heli 
84A7:   not actor $PLAYER_ACTOR driving_boat 
847A:   not actor $PLAYER_ACTOR driving_bike
89AE:   not actor $PLAYER_ACTOR driving_train
 
Status
Not open for further replies.
Top