Jump to content

High level coding


Ify24

Recommended Posts

HY guys ..

Till now I wasn't using high level coding but now I want And I have a question..

What's wrong whit my script ??

 

 

{$CLEO .cs}thread "MYSCRIPT"0A95: enable_thread_savingConstDESERT_EAGLE=24AK_47=30GRENADE=16EndModel.Load(#AK47)Model.Load(#DESERT_EAGLE)Model.Load(#GRENADE)While truewait 0 if andModel.Available(#AK47)Model.Available(#DESERT_EAGLE)Model.Available(#GRENADE)jf Breakend wait 0if00E1:   player 0 pressed_key 8then 048F: actor $PLAYER_ACTOR remove_weapons 017B: set_actor $PLAYER_ACTOR weapon DESERT_EAGLE ammo_to 50 017B: set_actor $PLAYER_ACTOR weapon AK_47 ammo_to 250 017B: set_actor $PLAYER_ACTOR weapon GRENADE ammo_to 3endModel.Destroy(#DESERT_EAGLE)Model.Destroy(#AK47)Model.Destroy(#GRENADE)0A93: end_custom_thread

 

 

?

Link to comment
Share on other sites

Yeah. Pay attention to 0A93 opcode, which will end the current script too quickly to let player pressing any key.

Link to comment
Share on other sites

Yeah. Pay attention to 0A93 opcode, which will end the current script too quickly to let player pressing any key.

So then I can use just

 

 

end_thread

 

 

?

Link to comment
Share on other sites

So my edited script is not working..

 

 

{$CLEO .cs}thread "MYSCRIPT"0A95: enable_thread_savingConstDESERT_EAGLE=24AK_47=30GRENADE=16EndModel.Load(#AK47)Model.Load(#DESERT_EAGLE)Model.Load(#GRENADE)While truewait 0 if andnot Model.Available(#AK47)not Model.Available(#DESERT_EAGLE)not Model.Available(#GRENADE)else_jump @MYSCRIPTjf Breakend :MYSCRIPTPlayer.Defined($PLAYER_CHAR)Player.CanMove($PLAYER_CHAR, true)wait 0if00E1:   player 0 pressed_key 8then 048F: actor $PLAYER_ACTOR remove_weapons 017B: set_actor $PLAYER_ACTOR weapon DESERT_EAGLE ammo_to 50 017B: set_actor $PLAYER_ACTOR weapon AK_47 ammo_to 250 017B: set_actor $PLAYER_ACTOR weapon GRENADE ammo_to 3endModel.Destroy(#DESERT_EAGLE)Model.Destroy(#AK47)Model.Destroy(#GRENADE)end_thread

 

 

(I typed Player.CanMove () becouse player didn't move..)

And when I press Backspace nothing happens...

Link to comment
Share on other sites

No, that's not a normal thread as it is a CLEO script. Take a look at the following:

 

{$CLEO}Const GRENADE      = 16  DESERT_EAGLE = 24  AK_47        = 30 End0000: NOP0A95: enable_thread_saving#GRENADE.Load()#DESERT_EAGLE.Load()#AK47.Load()while true wait 0  if  00E1:  player 0 pressed_key 8  then   While true     if and       #GRENADE.Available()       #DESERT_EAGLE.Available()       #AK47.Available()     then       break     else       wait 0      end   end   048F: actor $PLAYER_ACTOR remove_weapons   017B: set_actor $PLAYER_ACTOR weapon GRENADE ammo_to 3    017B: set_actor $PLAYER_ACTOR weapon DESERT_EAGLE ammo_to 50    017B: set_actor $PLAYER_ACTOR weapon AK_47 ammo_to 250    #GRENADE.Destroy()   #DESERT_EAGLE.Destroy()   #AK47.Destroy()   0A93: end_custom_thread endend

 

Link to comment
Share on other sites

 

{$CLEO}0000: const   DESERT_EAGLE = 24   AK_47        = 30   GRENADE      = 16end#AK47.Load#DESERT_EAGLE.Load#GRENADE.Load038B: load_requested_models while true   wait 0   if    00E1:  player 0 pressed_key 8   then       048F: actor $PLAYER_ACTOR remove_weapons       017B: set_actor $PLAYER_ACTOR weapon DESERT_EAGLE ammo_to 50       017B: set_actor $PLAYER_ACTOR weapon AK_47 ammo_to 250       017B: set_actor $PLAYER_ACTOR weapon GRENADE ammo_to 3       #AK47.Destroy              #DESERT_EAGLE.Destroy       #GRENADE.Destroy       break       endend0A93:

 

 

Dammit I have to stop using fast reply. bored.gif

Edited by BnB
Link to comment
Share on other sites

The order isn't necessary for this kind of things, unless you write a constant before the const...end construct.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.