CLEO Help Help to make a hitman cmd..

CLEO related

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
Hey i need a hitman cmd man can you help me please ....

The mod should be like this:

when i type the command /gethit the mod should type by it self the next commands:

wait 1 sec after /gethit was used then the mod type :

/my contract ( when that command was typed the mod should make a screen shoot)

wait 500 ms

/order ( the command /order should be used 3 times for more bullets)

wait 500 ms

/order

wait 500ms

/order

/undercover

/turn off

done until here.

Next, when im near on that player, the mod should verify the distance as example i need to be at 105 metters for no fail, if im at 100 metters the mod will tell me by a text on screen that im too close.. and if its posibile the mod will change the sniper weapon with the default (punch - it will take the sniper from my hand) that think should only work on sniper, not when i use knife.

next after i kill the target there will be a text in chat like : user (player name) has succesfully completed the contract on user (player name)

ex : Derrek has succesfully completed the contract on Ajom

Now the mod should detect that text in chat and do the next things :

When that text apear the mod should make a screenshoot, and type the fallowing commands : /turn on wait 500ms /undercover..

And if its posibile i need 3 commands.



/tn will do the fallowing thing - /turn off wait 500ms, /togw wait 500 ms, /togn wait 500ms, /togc.

/ch - will do the fallowing : /cancel hit wait 500ms, /undercover wait 500ms, /killcp wait 500ms, /turn on.

/kc - /killcp

/sp - /spawnchange

You can get the player id (name ) for the mod from the command /gethit, after using tha command /gethit, in chat will apear : You have a new contract on User (player name )

screen shot :
Thats how you can get the player id for using the distance and all of that

////

the proper chatmessage formatting of those strings are :

You have a new contract on Player (/mycontract).


Player has succesfully completed the contract on Player for $1.000.000 ( any value from 70k to 1kk), distance: 244m, weapon sniper.

And there is one more thing..

when I connect to the server, the mod should to detect my id and name. That is for when appears in the chat Player has successfully completed the contract, it needs to me me, because that text "Player has succesfully completed the contract on player" its visibile for everyone, so when someone will make a contract, the mod will start by it self.. so The mod should work only when i did that contract not on someone else, you can do that like this:

1. Samp player connected

2. detect player id & name (detect my name and id)

if text player has succesfully completed the contract on player was found, the player who completed the contract should be the same player that was detected when i connected at point 2. If there is other player and my id or name was not detected the mod should not work (if im not the one who completed the contract.. Because as i said when someone will make a contract it will triger my mod to work with no reason so it need to work only when i completed the contract

@ajom
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
im getting this error @Parazitas @ajom i installed the latest sannybuilder and the sb data from here : https://github.com/sannybuilder/data

How can we fix that? i tryed to install multiple sb data, sf plugin etc still the same error..

i tryed to delete that line like that :

the line was :

then
0B20: samp 0@ = actor_handle_by_samp_player_id PLAYERID_TARGET
// get distance between me and the target
00A0: store_actor 0@ position_to 1@ 2@ 3@

and i modified it to :

then
00A0: store_actor 0@ position_to 1@ 2@ 3@

and the compile works,. so can we fix that? 0B20
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Downgrade to SB v3.5.1 because later versions have custom extensions feature which requires {$use plugin} defined at extension.txt. Currently, SAMPFUNCS is not included inside it(unless you know how to add sampfuncs definitions at SASCM.ini,keywords.txt,opcodes.txt,extensions.txt).

Plus, SAMPFUNCS is old and outdated so it is better to not use new versions but instead use outdated but best compatible version for it which v3.5.1
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
I removed the line with the code 0B20 and it let me compile..
Do not remove it, the script needs that operation. Just downgrade to 3.5.1, latest SB versions are for users who knows much about SB BackBone. In your case(you are unaware of the newly added changes) it is better to stick on the previous version.
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
@ajom i removed the line for fail distance to test the mod, there is a bug. :

when the mod uses my target, it shows You don't have a contract. And the mod keep;s spaming that command. So if you can do when that text is detected : You don't have a contract" if that text is detected the mod will stop and will wait to type the command /gh again..

proofs :



so if i dont have a contract the mod should stop work and wait to use the command gh again (/gethit)
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
And if it is posibile, make the command /tn to execute the next commands : /turn off /togwt /togn /tognews /togc, at this moment the command /tn execute only one command that is /turn off
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
Update & bugs : all works fine except one. The first part of the mod it's working. Like /gethit /mycontract screenshot /order /turn off etc.

Now when i finish the contract nothing hapends. It should make a ss and type the commands /turn on and /undercover. Nothing of these hapends.

@ajom can u verify that? It's the line where is the text "has successfully completed the contact "
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
I don't see any problem regarding the " has succesfully completed the contract on " pattern at raknet, it is hard to understand through words I guess so...
  1. Record a gameplay using the script I posted(where the bug happens)
  2. upload your chatlog.txt here after your gameplay
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
Code:
{$CLEO}
                  
0662: "Hitman Faction"
thread "Created by Derrek"
wait 2500

0AB1: call_scm_func @chatmsg 0
0B34: samp register_client_command "hitman" to_label @gnrw

REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
   WAIT 0

IF
0B61:  samp is_local_player_spawned
THEN
    FOR 0@ = 97 TO 99 // Can be changed to 98 to 99, 97 to 99 - it reads the last amount of lines from the log. In this case, it reads just the last one.
        0AC8: 1@ = allocate_memory_size 260
        0AC8: 2@ = allocate_memory_size 260
        0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
        IF
        0C29: $NOT_USED = stristr string1 1@ string2 "Has succesfully completed the contract" // Text to look for in the chat to start the sequence. It will catch anything that has "text" anywhere in the chat.
        THEN   
                0B2B: samp 1@ = get_player_id_by_actor_handle $PLAYER_ACTOR
                0B36: samp 1@ = get_player_nickname 1@
                wait 500 // screenshot next frame
                0AB1: @PressScreenshot 0
                wait 500
                0AF9: samp say_msg "/turn on" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /turn on" color -1
                wait 500
                0AF9: samp say_msg "/undercover" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /undercover" color -1
                wait 500
                0AF9: samp say_msg "/togw" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /togw" color -1
                0AF8: samp add_message_to_chat "Success." color olor -1 // Avoid endless looping by adding a debug message to the chat.
                end
                IF
                0C29: $NOT_USED = stristr string1 1@ string2 "you have a new contract on" // Text to look for in the chat to start the sequence. It will catch anything that has "text" anywhere in the chat.
                THEN
                0B2B: samp 1@ = get_player_id_by_actor_handle $PLAYER_ACTOR
                0B36: samp 1@ = get_player_nickname 1@
                wait 500
                0AF9: samp say_msg "/turn off" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /turn off" color -1
                wait 500
                0AF9: samp say_msg "/undercover" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /undercover" color -1
                wait 500
                0AF9: samp say_msg "/order" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /order" color -1
                wait 500
                0AF9: samp say_msg "/order" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /order again" color -1
                wait 500
                0AF9: samp say_msg "/order" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /order again" color -1
                wait 500
                0AF9: samp say_msg "/togw" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /togw" color -1
                wait 500
                0AF9: samp say_msg "/mycontract" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /mycontract" color -1
                wait 500 // screenshot next frame
                0AB1: @PressScreenshot 0
                wait 500
                0AF8: samp add_message_to_chat "Success." color olor -1 // Avoid endless looping by adding a debug message to the chat.
                end
            end
         end       
    end
  
:PressScreenshot // credits to parazitas
if 0AA2: 0@ = load_dynamic_library "samp.dll" // IF and SET
then
    0@ += 0x119CBC // 0.3.7 R1 > Do screenshot?
    0A8C: write_memory 0@ size 4 value true virtual_protect 0
end
0AB2: cleo_return 0

:gnrw
   SAMP.IsCommandTyped(0@)
0AC6: 17@ = label @gnr1 offset
SAMP.ShowDialog(7777, "{339933}Comenzi & Informatii", 17@, "Inchide", "", 0)
SAMP.CmdRet

:gnr1
hex
{F3EA27}"{20D9E5}/gh - /GetHit /mycontract /order x3> /Undervocer /turn off  " 0A
{F3EA27}"/tn - /turn off /togw " 0A
{F3EA27}"{20D9E5}/ch - /cancelhit /undercover /killcp /turn on" 0A
{F3EA27}"/kc - /killcp" 0A
{F3EA27}"/sp - /spawnchange" 0A 
/////Nephrite.ro
end      ////Nephrite.ro
SAMP.CmdRet



:chatmsg
chatmsg "{FE0D0D}Made by !©Derrek for {8E20E5}Nephrite.ro"                                                                 
chatmsg "{FF3393}Hitman "
0AB2: ret 0

I think this script is more effective it works all .... only if you can edit it add the distance from player feature to remove the sniper, and add to detect my name, if i completed the contract or not at the line "has succesfully complet the contract"
 

blvck0v

Active member
Joined
Feb 23, 2019
Messages
97
Reaction score
51
Location
ugbase.eu
Code:
{$CLEO}
                 
0662: "Hitman Faction"
thread "Created by Derrek"
wait 2500

0AB1: call_scm_func @chatmsg 0
0B34: samp register_client_command "hitman" to_label @gnrw

REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
   WAIT 0

IF
0B61:  samp is_local_player_spawned
THEN
    FOR 0@ = 97 TO 99 // Can be changed to 98 to 99, 97 to 99 - it reads the last amount of lines from the log. In this case, it reads just the last one.
        0AC8: 1@ = allocate_memory_size 260
        0AC8: 2@ = allocate_memory_size 260
        0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
        IF
        0C29: $NOT_USED = stristr string1 1@ string2 "Has succesfully completed the contract" // Text to look for in the chat to start the sequence. It will catch anything that has "text" anywhere in the chat.
        THEN  
                0B2B: samp 1@ = get_player_id_by_actor_handle $PLAYER_ACTOR
                0B36: samp 1@ = get_player_nickname 1@
                wait 500 // screenshot next frame
                0AB1: @PressScreenshot 0
                wait 500
                0AF9: samp say_msg "/turn on" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /turn on" color -1
                wait 500
                0AF9: samp say_msg "/undercover" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /undercover" color -1
                wait 500
                0AF9: samp say_msg "/togw" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /togw" color -1
                0AF8: samp add_message_to_chat "Success." color olor -1 // Avoid endless looping by adding a debug message to the chat.
                end
                IF
                0C29: $NOT_USED = stristr string1 1@ string2 "you have a new contract on" // Text to look for in the chat to start the sequence. It will catch anything that has "text" anywhere in the chat.
                THEN
                0B2B: samp 1@ = get_player_id_by_actor_handle $PLAYER_ACTOR
                0B36: samp 1@ = get_player_nickname 1@
                wait 500
                0AF9: samp say_msg "/turn off" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /turn off" color -1
                wait 500
                0AF9: samp say_msg "/undercover" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /undercover" color -1
                wait 500
                0AF9: samp say_msg "/order" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /order" color -1
                wait 500
                0AF9: samp say_msg "/order" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /order again" color -1
                wait 500
                0AF9: samp say_msg "/order" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /order again" color -1
                wait 500
                0AF9: samp say_msg "/togw" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /togw" color -1
                wait 500
                0AF9: samp say_msg "/mycontract" // What you want to say when someone says "text" in the chat.
                0AF8: samp add_message_to_chat "DEBUG: i said /mycontract" color -1
                wait 500 // screenshot next frame
                0AB1: @PressScreenshot 0
                wait 500
                0AF8: samp add_message_to_chat "Success." color olor -1 // Avoid endless looping by adding a debug message to the chat.
                end
            end
         end      
    end
 
:PressScreenshot // credits to parazitas
if 0AA2: 0@ = load_dynamic_library "samp.dll" // IF and SET
then
    0@ += 0x119CBC // 0.3.7 R1 > Do screenshot?
    0A8C: write_memory 0@ size 4 value true virtual_protect 0
end
0AB2: cleo_return 0

:gnrw
   SAMP.IsCommandTyped(0@)
0AC6: 17@ = label @gnr1 offset
SAMP.ShowDialog(7777, "{339933}Comenzi & Informatii", 17@, "Inchide", "", 0)
SAMP.CmdRet

:gnr1
hex
{F3EA27}"{20D9E5}/gh - /GetHit /mycontract /order x3> /Undervocer /turn off  " 0A
{F3EA27}"/tn - /turn off /togw " 0A
{F3EA27}"{20D9E5}/ch - /cancelhit /undercover /killcp /turn on" 0A
{F3EA27}"/kc - /killcp" 0A
{F3EA27}"/sp - /spawnchange" 0A
/////Nephrite.ro
end      ////Nephrite.ro
SAMP.CmdRet



:chatmsg
chatmsg "{FE0D0D}Made by !©Derrek for {8E20E5}Nephrite.ro"                                                                
chatmsg "{FF3393}Hitman "
0AB2: ret 0

I think this script is more effective it works all .... only if you can edit it add the distance from player feature to remove the sniper, and add to detect my name, if i completed the contract or not at the line "has succesfully complet the contract"
he 's asking you to make him a script and then he goes somewhere else and says that he made it
this is ridiculous, why do you even bother with this kind of trash people
where's ajom's credits? mention of parazitas for helping? what a fucking joke
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
he 's asking you to make him a script and then he goes somewhere else and says that he made it
this is ridiculous, why do you even bother with this kind of trash people
where's ajom's credits? mention of parazitas for helping? what a fucking joke


this was fully made by me, i know how to do that. And why u comment here? no one asked for your help dude, go and do your job
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
I think this script is more effective it works all .... only if you can edit it add the distance from player feature to remove the sniper, and add to detect my name, if i completed the contract or not at the line "has succesfully complet the contract"

It's good to see you learned how to make a code now, I think you can now take it from here, lol XD.

he 's asking you to make him a script and then he goes somewhere else and says that he made it
this is ridiculous, why do you even bother with this kind of trash people
where's ajom's credits? mention of parazitas for helping? what a fucking joke
I just use every measure of my ability to help and make readers learn, if this topic became a stepping stone for him to become a good coder in the future then it wouldn't be a bother for me if I don't get credits(I think... Lol).



Anyway... I Updated the script which would sum up everything so far.
 
Top