CLEO Help Script not working

CLEO related
Status
Not open for further replies.

Badonga

Active member
Joined
Aug 5, 2013
Messages
71
Reaction score
0
// This file was decompiled using SASCM.INI published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013

{$VERSION 3.1.0000}
{$CLEO .cs}

const
RED = 0xFFFF0000
ORANGE = 0xFFA500
MAROON = 0xFFBF1111
end

//-------------MAIN---------------
thread "Taze"

:TAZE_8
wait 0
if and
056D:  actor $PLAYER_ACTOR defined
key_down 49
else_jump @TAZE_8
:FUCKTAG
wait 0
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
if
056D:  actor 1@ defined
else_jump @TAZE_127

2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)

0B37: samp 3@ = get_player_color 2@
if or
    3@ == RED
    3@ == ORANGE
    3@ == MAROON
004D: jump_if_false @FUCKTAG

0AF9: samp say_msg "/taze %d" 2@ // Not working. 2@ returns nothing
wait 1050
0AF9: samp say_msg "/cuff %d" 2@  // Not working. 2@ returns nothing
wait 1050
0AF9: samp say_msg "/arrest %d" 2@  // Not working. 2@ returns nothing
jump @TAZE_8
else_jump @fucktag

:TAZE_127
wait 0
jump @TAZE_8
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Code:
{$CLEO .cs}
0000:


const
RED = 0xFFFF0000
ORANGE = 0xFFA500 //needs to be ARGB 
MAROON = 0xFFBF1111
end

while true
wait 0
    if and
        0256: $PLAYER_ACTOR
        0AB0: 49
    then
        0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to $nouse closest_ped_to 0@
        if 056D: actor 0@ def
        then
            0B2B: samp 1@ = get_player_id_by_actor_handle 0@
            0B37: samp 2@ = get_player_color 1@
            if or 
                2@ == RED
                2@ == ORANGE
                3@ == MAROON
            then
                0AF9: "/taze %d" 1@
                wait 1050
                0AF9: "/cuff %d" 1@
                wait 1050
                0AF9: "/arrest %d" 1@
            end
        end
    end
end
 

Badonga

Active member
Joined
Aug 5, 2013
Messages
71
Reaction score
0
Thank youuuuu!

Now I have a question:
Can you do it so that it sends the commands to [closest orange/red/maroon players]? Note that this script only send the commands to the id of the closest player if it passes the check if the id is orange/red/maroon.

I hope you understand what I mean  :stoned:

EDIT: It's not working. Nothing happens when I press 1 :eek:hgodwhy:
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Code:
{$CLEO}

0000: NOP

const
RED = 0xFFFF0000
ORANGE = 0xFFA500
MAROON = 0xFFBF1111
end

//-------------MAIN---------------


:TAZE_8
wait 0 
if and
056D:   actor $PLAYER_ACTOR defined 
key_down 49 
jf @TAZE_8
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@ 
if 
056D:   actor 1@ defined 
jf @TAZE_8
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
0B37: samp 3@ = get_player_color 2@
if or 
    3@ == RED
    3@ == ORANGE
    3@ == MAROON
jf @TAZE_8
0AF9: samp say_msg "/taze %d" 2@
wait 1050 
0AF9: samp say_msg "/cuff %d" 2@  
wait 1050 
0AF9: samp say_msg "/arrest %d" 2@  
jump @TAZE_8


OR TRY THIS

Code:
{$CLEO}

0000: NOP


$RED = 0xFFFF0000
$ORANGE = 0xFFA500
$MAROON = 0xFFBF1111


//-------------MAIN---------------


:TAZE_8
wait 0 
if and
056D:   actor $PLAYER_ACTOR defined 
key_down 49 
jf @TAZE_8
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@ 
if 
056D:   actor 1@ defined 
jf @TAZE_8
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
0B37: samp 3@ = get_player_color 2@
if or 
    3@ == $RED
    3@ == $ORANGE
    3@ == $MAROON
jf @TAZE_8
0AF9: samp say_msg "/taze %d" 2@
wait 1050 
0AF9: samp say_msg "/cuff %d" 2@  
wait 1050 
0AF9: samp say_msg "/arrest %d" 2@  
jump @TAZE_8
 

Badonga

Active member
Joined
Aug 5, 2013
Messages
71
Reaction score
0
BlackHat link said:
Code:
{$CLEO}

0000: NOP

const
RED = 0xFFFF0000
ORANGE = 0xFFA500
MAROON = 0xFFBF1111
end

//-------------MAIN---------------


:TAZE_8
wait 0 
if and
056D:   actor $PLAYER_ACTOR defined 
key_down 49 
jf @TAZE_8
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@ 
if 
056D:   actor 1@ defined 
jf @TAZE_8
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
0B37: samp 3@ = get_player_color 2@
if or 
    3@ == RED
    3@ == ORANGE
    3@ == MAROON
jf @TAZE_8
0AF9: samp say_msg "/taze %d" 2@
wait 1050 
0AF9: samp say_msg "/cuff %d" 2@  
wait 1050 
0AF9: samp say_msg "/arrest %d" 2@  
jump @TAZE_8

Thank you for helping mate, but still same problem:

Code:
0AF9: samp say_msg "/taze %d" 2@           // Output = "/taze " and no ID
wait 1050 
0AF9: samp say_msg "/cuff %d" 2@            // Output = "/cuff " and no ID
wait 1050 
0AF9: samp say_msg "/arrest %d" 2@         // Output = "/arrest " and no ID
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Badonga link said:
Second one won't even compile.  :bawww:
maybe:

Code:
{$CLEO}

0000: NOP




//-------------MAIN---------------


:TAZE_8
wait 0 
if and
056D:   actor $PLAYER_ACTOR defined 
key_down 49 
jf @TAZE_8
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@ 
if 
056D:   actor 1@ defined 
jf @TAZE_8
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
0B37: samp 3@ = get_player_color 2@
if or 
    3@ == 0xFFFF0000
    3@ == 0xFFA500
    3@ == 0xFFBF1111
jf @TAZE_8
0AF9: samp say_msg "/taze %d" 2@
wait 1050 
0AF9: samp say_msg "/cuff %d" 2@  
wait 1050 
0AF9: samp say_msg "/arrest %d" 2@  
jump @TAZE_8
 

Badonga

Active member
Joined
Aug 5, 2013
Messages
71
Reaction score
0
BlackHat link said:
maybe:

Code:
{$CLEO}

0000: NOP




//-------------MAIN---------------


:TAZE_8
wait 0 
if and
056D:   actor $PLAYER_ACTOR defined 
key_down 49 
jf @TAZE_8
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@ 
if 
056D:   actor 1@ defined 
jf @TAZE_8
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
0B37: samp 3@ = get_player_color 2@
if or 
    3@ == 0xFFFF0000
    3@ == 0xFFA500
    3@ == 0xFFBF1111
jf @TAZE_8
0AF9: samp say_msg "/taze %d" 2@
wait 1050 
0AF9: samp say_msg "/cuff %d" 2@  
wait 1050 
0AF9: samp say_msg "/arrest %d" 2@  
jump @TAZE_8

That compiles fine and it works to the colored players. The problem here is not the color, but

Code:
0AF9: samp say_msg "/taze %d" 2@           // Output = "/taze " and no ID
wait 1050 
0AF9: samp say_msg "/cuff %d" 2@            // Output = "/cuff " and no ID
wait 1050 
0AF9: samp say_msg "/arrest %d" 2@         // Output = "/arrest " and no ID

:bawww:
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Badonga link said:
That compiles fine and it works to the colored players. The problem here is not the color, but

Code:
0AF9: samp say_msg "/taze %d" 2@           // Output = "/taze " and no ID
wait 1050 
0AF9: samp say_msg "/cuff %d" 2@            // Output = "/cuff " and no ID
wait 1050 
0AF9: samp say_msg "/arrest %d" 2@         // Output = "/arrest " and no ID

:bawww:


say_msg is working very well

try this one:
Code:
{$CLEO}

0000: NOP

const
1 = 0xFFFF0000
2 = 0xFFA500
3 = 0xFFBF1111
end



//-------------MAIN---------------


:TAZE_8
wait 0 
if and
056D:   actor $PLAYER_ACTOR defined 
key_down 49 
jf @TAZE_8
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@ 
if 
056D:   actor 1@ defined 
jf @TAZE_8
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
0B37: samp 3@ = get_player_color 2@
if or 
04A4:   3@ == 1  // @ == constant
04A4:   3@ == 2  // @ == constant
04A4:   3@ == 3  // @ == constant
jf @no_noob
0AF9: samp say_msg "/taze %d " 2@
wait 1050 
0AF9: samp say_msg "/cuff %d " 2@  
wait 1050 
0AF9: samp say_msg "/arrest %d " 2@  
jump @TAZE_8


:no_noob
wait 0
0AD1: show_formatted_text_highpriority "no noob found" time 1000 0x0AD1
wait 100
jump @TAZE_8
 

Badonga

Active member
Joined
Aug 5, 2013
Messages
71
Reaction score
0
I GOT IT! THE PROBLEM IS NOT IT SENDS TO NO ID BUT IT SENDS TO ID 2 INSTEAD OF WHAT IS STORED IN VARIABLE 2@

Now how to fix it  :sweet_jesus:
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Badonga link said:
I GOT IT! THE PROBLEM IS NOT IT SENDS TO NO ID BUT IT SENDS TO ID 2 INSTEAD OF WHAT IS STORED IN VARIABLE 2@

Now how to fix it  :sweet_jesus:

what?

id = 2@ , the actor handle (the actor him self) = 1@

this is the code
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
 

Badonga

Active member
Joined
Aug 5, 2013
Messages
71
Reaction score
0
This question is the only one I have left:

Can you do it so that it sends the commands to [closest orange/red/maroon player]? Note that this script only send the commands to the id of the closest player IF it passes the check if the id is orange/red/maroon.
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
Code:
{$CLEO}

0000: NOP

:TAZE_CUFF_ARREST
wait 0 
if and
0AB0: 49 
not SAMP.ChatInputOpened
jf @TAZE_CUFF_ARREST
Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@)
0AE1: 4@ = random_actor_near_point 1@ 2@ 3@ in_radius 25.0 find_next 0 pass_deads 1
if 
056D:   actor 4@ defined 
jf @TAZE_CUFF_ARREST
5@ = SAMP.GetSAMPPlayerIDByActorHandle(4@)
6@ = SAMP.GetPlayerColor(5@)
if or 
6@ == 0xFFFF0000
6@ == 0xFFA500
6@ == 0xFFBF1111
jf @TAZE_CUFF_ARREST
0AF9: samp say_msg "/taze %d" 5@
wait 1000 
0AF9: samp say_msg "/cuff %d" 5@  
wait 1000 
0AF9: samp say_msg "/arrest %d" 5@  
goto @TAZE_CUFF_ARREST
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Badonga link said:
This question is the only one I have left:

Can you do it so that it sends the commands to [closest orange/red/maroon player]? Note that this script only send the commands to the id of the closest player IF it passes the check if the id is orange/red/maroon.

lel?

if it pass the color if check , it will send the command to the closest orange/red/maroon player
if it didn't pass the color check it will go back to the main label to loop again until it passes the color check
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
TH3RM4L link said:
Code:
{$CLEO}

0000: NOP

:TAZE_CUFF_ARREST
wait 0 
if and
0AB0: 49 
not SAMP.ChatInputOpened
jf @TAZE_CUFF_ARREST
Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@)
0AE1: 4@ = random_actor_near_point 1@ 2@ 3@ in_radius 25.0 find_next 0 pass_deads 1
if 
056D:   actor 4@ defined 
jf @TAZE_CUFF_ARREST
5@ = SAMP.GetSAMPPlayerIDByActorHandle(4@)
6@ = SAMP.GetPlayerColor(5@)
if or 
6@ == 0xFFFF0000
6@ == 0xFFA500
6@ == 0xFFBF1111
jf @TAZE_CUFF_ARREST
0AF9: samp say_msg "/taze %d" 5@
wait 1000 
0AF9: samp say_msg "/cuff %d" 5@  
wait 1000 
0AF9: samp say_msg "/arrest %d" 5@  
goto @TAZE_CUFF_ARREST
:excited_troll:

Code:
0AE1: 4@ = random_actor_near_point 1@ 2@ 3@ in_radius 25.0 find_next 0 pass_deads 1
this code isn't synced last time i checked
 

Badonga

Active member
Joined
Aug 5, 2013
Messages
71
Reaction score
0
BlackHat link said:
:excited_troll:

Code:
0AE1: 4@ = random_actor_near_point 1@ 2@ 3@ in_radius 25.0 find_next 0 pass_deads 1
this code isn't synced last time i checked

Yes, that code is not working.

By the way in your previous post, this is what the script does:

The Steps:
1. It gets the ID of the closest player to me
2. THEN it checks if he is those colors and if he is one of those colors
3. THEN the command is sent to that ID.

Otherwise I have to keep running to those colored player to make him near me then the step 2 and 3 will work.

What I want the script to do is that the script firsts check the closest colored player to me (imagine there are a bunch of players with other colors that are not listed in the script around me and the player with the color that I want is in that crowd but NOT closest to me so I have to keep running at him and pressing the key...)


I hope you understand. :looky:
 
Status
Not open for further replies.
Top