Quantcast

Jump to content

» «
Photo

[GTA SA] ~ CLEO Script Tutorial ~

631 replies to this topic
Decoi
  • Decoi

    Player Hater

  • Members
  • Joined: 14 Apr 2013

#601

Posted 16 April 2013 - 10:41 PM

Thanks for the tips I will remember that format of script if I am scripting a C-HUD, I hope you do San Vice Reloaded ill be looking forward to it if you have it in the works colgate.gif .

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#602

Posted 19 April 2013 - 03:15 PM

Yes, i will do it

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#603

Posted 30 April 2013 - 12:02 PM

1. how to use ~k~~PED_FIREWEAPON~ in cleo coding? I want to use this as a IF KEY PRESSED.
2. is there a key press code for LMB as for other keys?
3. what does this code means?

CODE

if and
actor 32@ defined
not actor 32@ defined \\ ignore the lack of opcodes please

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#604

Posted 30 April 2013 - 03:19 PM Edited by ZAZ, 30 April 2013 - 03:32 PM.

QUOTE (MRobinson @ Tuesday, Apr 30 2013, 13:02)
1. how to use ~k~~PED_FIREWEAPON~ in cleo coding? I want to use this as a IF KEY PRESSED.
PED_FIREWEAPON is a gamefunction with keypress allocation
in controler setup can you allocate a key for PED_FIREWEAPON
~k~~PED_FIREWEAPON~ is a "gxt-variable" to show the allocated Key instead ~k~~PED_FIREWEAPON~

To check if PED_FIREWEAPON was pressed needs to use opcode 00E1 and check for 17
CODE
if
00E1:   key_pressed  0  17//--------- PED_FIREWEAPON key  
jf @next


Have a look now to Sannybuilder HELP >> GTA SA >> Keypress numbers


script:
CODE
00BC: show_text_highpriority GXT 'GA_6' time 1000 flag 1

GXT:
CODE
GA_6 Park it, prime it by pressing ~k~~PED_FIREWEAPON~ and LEG IT!
it shows this text:
QUOTE
"Park it, prime it by pressing LMB and LEG IT!"

if LMB is set as PED_FIREWEAPON key


QUOTE
2. is there a key press code for LMB as for other keys?
what are "other keys?" , you can do it as shown above if LMB is set as PED_FIREWEAPON key

or use 0AB0 and check for 1
virtual keycode 1 = left mouse button
CODE
if
0AB0:   key_pressed 1 // -- LMB
jf @next


QUOTE
3. what does this code means?

056D: actor 0@ defined
opcode 056D is a condition to check if the variable contains a valid handle value of an actor(ped) which is availble in game at that moment
can also be Player_actor

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#605

Posted 01 May 2013 - 08:44 AM

Rest is ok.. thanks.. and I know the meaning of defined... confused.gif
What I want to know is.. that what happens by using the 2 contradictory opcodes together?
For example, by

CODE

if
056D: actor 0@ defined
jf @repeat
jump @next

we mean in other way to define the player if its not yet defined
but, in case if we put 056D and 856D together.. then what it signfies?
something like this...

CODE

if and
056D: actor 0@ defined
856D: not actor 0@ defined
jf @repeat
jump @next


then what it is supposed to do?

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#606

Posted 01 May 2013 - 09:45 AM

Why would you want to that? Such a check will never return true, unless 0@ is holding a Schrödinger's cat handle.

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#607

Posted 01 May 2013 - 02:40 PM

The problem is.. that I am trying to check if a specific actor is present or not.. but whenever I use 056D, the actor, instead of being checked if it is there or not.. gets defined... for eg. I check that $COPILOT_1 is defined or not..

CODE

if
056D: actor $COPILOT_1 defined
jf @forward
jump @backward


the thing happens is.. the pilot instantly gets defined according to my mod... and then... I want that the forward goes only when the actor is really present as my other script satisfies.

In detail, the actor $COPILOT_1 is defined if model polmav is around and level is more than 2, but when I used this code, it always appears exactly at the same time when that part of the script is checked sad.gif

I thought to consult my superiors first before using the contradictions together... I thought it may fix my problem.. hope u understand me.. sad.gif

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#608

Posted 02 May 2013 - 05:06 AM

I don't know what you mean. Important is, in which way the actor has been defined. Please post a complete script and explain your real plan.

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#609

Posted 02 May 2013 - 08:53 AM

whatsthat.gif zaz... u never check ur inbox... the problem is my script is longer than the whole posts in 2 pages here... and also it is a totally new cop system which u understand I can't leak here... anyways if you can't help.. I will find another way... cryani.gif

Sorry for disturbing.

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#610

Posted 03 May 2013 - 12:22 PM

okay as I cant find any help on the previous topic.. I finally posted the start of my script ...

CODE
:COPSYST_13
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @COPSYST_13
010F:   player $PLAYER_CHAR wanted_level > 0
004D: jump_if_false @COPSYST_13
00D6: if
856D:   not actor $COPPILT_1 defined
004D: jump_if_false @COPSYST_70
0002: jump @COPSYST_100

:COPSYST_70
01F7: set_player $PLAYER_CHAR ignored_by_cops 0
099E: enable_police_patrols 1
072C: generate_police_bikes 1
096A: enable_flying_helis 1
0A14: disable_respray_garages 1
0002: jump @COPSYST_13


and here is the complete other script for bulletproofed cops in helicopter.. also tell me if they are not bullet proof
CODE
:NONAME_2
0001: wait 250 ms
0A8D: 0@ = read_memory 12700004 size 4 virtual_protect 0
0050: gosub @NONAME_56
0A8D: 0@ = read_memory 12700008 size 4 virtual_protect 0
0050: gosub @NONAME_56
0002: jump @NONAME_2

:NONAME_56
00D6: if
0019:   0@ > 0
004D: jump_if_false @NONAME_289
0A8D: 1@ = read_memory 12010644 size 4 virtual_protect 0
0AA8: call_function_method 4342112 1@ num_params 1 pop 0 0@ 1@  
046C: 2@ = car 1@ driver
00D6: if
8019:   not  2@ > 0
004D: jump_if_false @NONAME_289
00D6: if
0137:   car 1@ model == #VCNMAV
004D: jump_if_false @NONAME_214
0247: load_model #LAPD1

:NONAME_159
8248:   not model #LAPD1 available
004D: jump_if_false @NONAME_182
0001: wait 0 ms
0002: jump @NONAME_159

:NONAME_182
0129: $MEDIA_GUY = create_actor_pedtype 5 model #LAPD1 in_car 1@ driverseat
054A: set_actor $MEDIA_GUY immune_to_car_headshots 1
0249: release_model #LAPD1
0002: jump @NONAME_289

:NONAME_214
0247: load_model #SWAT

:NONAME_219
8248:   not model #SWAT available
004D: jump_if_false @NONAME_242
0001: wait 0 ms
0002: jump @NONAME_219

:NONAME_242
0129: $COPPILT_1 = create_actor_pedtype 6 model #SWAT in_car 1@ driverseat
01C8: $COPPILT_2 = create_actor_pedtype 6 model #SWAT in_car 1@ passenger_seat 0
054A: set_actor $COPPILT_1 immune_to_car_headshots 1
054A: set_actor $COPPILT_2 immune_to_car_headshots 1
0249: release_model #SWAT

:NONAME_289
0051: return


you remember zaz .. that I faced a problem about "walkstyles" a long ago.. ? Thats not fixed yet. I want an actor to perform "Cop_move_FWD" from ifp "police" which is present in gta3.img. The animation should not stop in one loop and also not be upto infinity as I have to use opcode 07CD after that. That means I want the guy to stop at a point.. something like this:

CODE
:START
00D6: if
0039: 28@ == 1
004D: jf @back
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
xxxx: [B]want the actor 10@ to move with gun pointed in front but my game crashes on using opcode 0245 and nothing budges on using 0A1A[/B]
07CD: AS_actor 10@ walk_to 1@ 2@ 3@ stop_with_angle 0.0 within_radius 0.5  \\ I dont want the walkstyle to go on forever
00D6: if
09ED:   actor 10@ is_within_field_of_view_actor $PLAYER_ACTOR
004D: jf @back
0792: disembark_instantly_actor $PLAYER_ACTOR
01F7: set_player $PLAYER_CHAR ignored_by_cops 1


Now thats all the fuss about.. I have 3ds max too, tell me if changing the walkcycles or adding a new walkcycle will work in this. PLEASE HELP suicidal.gif

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#611

Posted 03 May 2013 - 07:57 PM Edited by ZAZ, 10 September 2013 - 05:46 PM.

looks like Seemanns Polmav script after decompiling
i advice to avoid using globals unless you need it indeed in another script

QUOTE

tell me if they are not bullet proof

they are immune_to_car_headshots, but i think it's enough if they are in a vehicle, unless motorbike

your check if actor $COPPILT_1 is defined ....
....if he's not defenied, then the code jumps to COPSYST_100
what happens at COPSYST_100?

My tip: I often use 03F0: and 045A: to display script values
in your case i would add these codes to display the content of $COPPILT_1

:COPSYST_13
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @COPSYST_13
03F0: enable_text_draw 1
045A: draw_text_1number 100.0 160.0 GXT 'NUMBER' number $COPPILT_1



QUOTE

(MRobinson @ Friday, May 3 2013, 13:22) you remember zaz .. that I faced a problem about "walkstyles" a long ago.. ? Thats not fixed yet. I want an actor to perform "Cop_move_FWD" from ifp "police" which is present in gta3.img. The animation should not stop in one loop and also not be upto infinity as I have to use opcode 07CD after that. That means I want the guy to stop at a point.. something like this:

:START
00D6: if
0039: 28@ == 1
004D: jf @back
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
xxxx: want the actor 10@ to move with gun pointed in front but my game crashes on using opcode 0245 and nothing budges on using 0A1A
07CD: AS_actor 10@ walk_to 1@ 2@ 3@ stop_with_angle 0.0 within_radius 0.5  \\ I dont want the walkstyle to go on forever
00D6: if
09ED:   actor 10@ is_within_field_of_view_actor $PLAYER_ACTOR
004D: jf @back
0792: disembark_instantly_actor $PLAYER_ACTOR
01F7: set_player $PLAYER_CHAR ignored_by_cops 1

Either let the actor walk/run by walkstyle or let him do animation
both at same time isn't possible
some animations are suitably for "walking" (walk animation) like "Cop_move_FWD"

First about walk/run by walkstyle
0792: is normaly the last chance to to clear the actors behavior but it don't removes the walkstyle
overwrite the walkstyle with another one can fix that
and then use 0792 before he should do an animation

{$CLEO .cs}
:ActorWalk_1
03A4: name_thread 'WALKACT'

:ActorWalk_2
wait 0
00D6: if  0
0256:   player $PLAYER_CHAR defined
jf @ActorWalk_2
if
0AB0:   key_pressed 8//--------------------------------- key Backspace
jf @ActorWalk_2
0247: load_model #FBI
0247: load_model #M4
04ED: load_animation "GHANDS"

:ActorWalk_5
wait 0
if  and
0248:   model #FBI available
0248:   model #M4 available
04EE:   animation "GHANDS" loaded
jf @ActorWalk_5


:ActorWalk_7
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 4.0  4.0  0.2
009A: 10@ = create_actor_pedtype 24 model #FBI at 1@ 2@ 3@
0249: release_model #fbi
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
05D3: AS_actor 10@ goto_point 1@ 2@ 3@ mode 4 999999 ms // versionA
0245: set_actor 10@ walk_style_to "Drunkman"
0@ = 0

:ActorWalk_13
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @ActorWalk_57
if
8118: not  actor 10@ dead
jf @ActorWalk_57
if  and
0@ == 0
00FE:   actor 10@ sphere 0 in_sphere 1@ 2@ 3@ radius 1.5 1.5 1.5
jf @ActorWalk_13
0245: set_actor 10@ walk_style_to "Swat"
0792: disembark_instantly_actor 10@
0812: actor 10@ perform_animation_sequence "gsign4LH" IFP_file "GHANDS"  4.0  0  1  1  0 -1 ms

0@ = 1
jump @ActorWalk_13

:ActorWalk_57
04EF: release_animation "GHANDS"
01C2: remove_references_to_actor 10@

jump @ActorWalk_2 QUOTE I have 3ds max too, tell me if changing the walkcycles or adding a new walkcycle will work in this.

yes, it will work. I made a zombimod with Beeswax, he made the zombies and the zombi walk animation to replace it with WALK_drunk
then i let them walk by drunkman style like in script above



Then about Cop_move_FWD
You need to set the actors angle permanetly while he do the animation
and let the animation loop, parameter loopA must be 1
0812: actor 10@ perform_animation_sequence "Cop_move_FWD" IFP_file "POLICE" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 ms

{$CLEO .cs}
:ActorWalk_1
03A4: name_thread 'WALKACT'

:ActorWalk_2
wait 0
00D6: if  0
0256:   player $PLAYER_CHAR defined
jf @ActorWalk_2
if
0AB0:   key_pressed 8//--------------------------------- key Backspace
jf @ActorWalk_2
0247: load_model #FBI
0247: load_model #M4
04ED: load_animation "POLICE"

:ActorWalk_5
wait 0
if  and
0248:   model #FBI available
0248:   model #M4 available
04EE:   animation "POLICE" loaded
jf @ActorWalk_5


:ActorWalk_7
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 8.0  4.0  0.2
009A: 10@ = create_actor_pedtype 24 model #FBI at 1@ 2@ 3@
0249: release_model #fbi
0@ = 0

:ActorWalk_13
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @ActorWalk_57
if
8118: not  actor 10@ dead
jf @ActorWalk_57
if
0@ == 0
jf @ActorWalk_13
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
00A0: store_actor 10@ position_to 11@ 12@ 13@
00A0: store_actor $PLAYER_ACTOR position_to 21@ 22@ 23@
0063: 11@ -= 21@ // (float)
0063: 12@ -= 22@ // (float)
0604: get_Z_angle_for_point 11@ 12@ store_to 30@
000B: 30@ += 180.0
0173: set_actor 10@ Z_angle_to 30@
0812: actor 10@ perform_animation_sequence "Cop_move_FWD" IFP_file "POLICE"  4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 ms
if
00FE:  actor 10@ sphere 0 in_sphere 1@ 2@ 3@ radius 1.5 1.5 1.5
jf @ActorWalk_13
0812: actor 10@ perform_animation_sequence "Door_Kick" IFP_file "POLICE"  4.0  0  1  1  0 -1 ms
0@ = 1
jump @ActorWalk_13

:ActorWalk_57
04EF: release_animation "POLICE"
01C2: remove_references_to_actor 10@
jump @ActorWalk_2

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#612

Posted 04 May 2013 - 10:19 AM

QUOTE
i advice to avoid using globals unless you need it indeed in another script
being used in all my 3 scripts.
QUOTE
they are immune_to_car_headshots, but i think it's enough if they are in a vehicle, unless motorbike
Yea they die and that too very akwardly... they stick to the bottom of heli.. lol.gif , that I will fix by stimulating helicopter crash opcode zaz.
QUOTE
your check if actor $COPPILT_1 is defined ....
....if he's not defenied, then the code jumps to COPSYST_100
what happens at COPSYST_100?

the script checks further if the player is in view of cops and then the cops are to ignore the player if negative and the script continues and goes on.. the cops go to the last place but.. they walk like a cool headed noob.. so I decided to add some realism.. I also added weapon detection. if player fires the script loops back to ignored 0.
My tip: I often use 03F0: and 045A: to display script values
in your case i would add these codes to display the content of $COPPILT_1
CODE

:COPSYST_13
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @COPSYST_13
03F0: enable_text_draw 1
045A: draw_text_1number 100.0 160.0 GXT 'NUMBER' number $COPPILT_1
I didnt get ya.. what it is supposed to do here...?
QUOTE
Either let the actor walk/run by walkstyle or let him do animation
both at same time isn't possible
some animations are suitably for "walking" (walk animation) like "Cop_move_FWD"

First about walk/run by walkstyle
0792: is normaly the last chance to to clear the actors behavior but it don't removes the walkstyle
overwrite the walkstyle with another one can fix that
and then use 0792 before he should do an animation
CODE
{$CLEO .cs}
:ActorWalk_1
03A4: name_thread 'WALKACT'

:ActorWalk_2
wait 0
00D6: if  0
0256:  player $PLAYER_CHAR defined
jf @ActorWalk_2
if
0AB0:  key_pressed 8//--------------------------------- key Backspace
jf @ActorWalk_2
0247: load_model #FBI
0247: load_model #M4
04ED: load_animation "GHANDS"

:ActorWalk_5
wait 0
if  and
0248:  model #FBI available
0248:  model #M4 available
04EE:  animation "GHANDS" loaded
jf @ActorWalk_5


:ActorWalk_7
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 4.0  4.0  0.2
009A: 10@ = create_actor_pedtype 24 model #FBI at 1@ 2@ 3@
0249: release_model #fbi
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
05D3: AS_actor 10@ goto_point 1@ 2@ 3@ mode 4 999999 ms // versionA
0245: set_actor 10@ walk_style_to "Drunkman"
0@ = 0

:ActorWalk_13
wait 0
if
0256:  player $PLAYER_CHAR defined
jf @ActorWalk_57
if
8118: not  actor 10@ dead
jf @ActorWalk_57
if  and
0@ == 0
00FE:  actor 10@ sphere 0 in_sphere 1@ 2@ 3@ radius 1.5 1.5 1.5
jf @ActorWalk_13
0245: set_actor 10@ walk_style_to "Swat"
0792: disembark_instantly_actor 10@
0812: actor 10@ perform_animation_sequence "gsign4LH" IFP_file "GHANDS"  4.0  0  1  1  0 -1 ms

0@ = 1
jump @ActorWalk_13

:ActorWalk_57
04EF: release_animation "GHANDS"
01C2: remove_references_to_actor 10@
jump @ActorWalk_2
QUOTE
I have 3ds max too, tell me if changing the walkcycles or adding a new walkcycle will work in this.
yes, it will work. I made a zombimod with Beeswax, he made the zombies and the zombi walk animation to replace it with WALK_drunk
then i let them walk by drunkman style like in script above



Then about Cop_move_FWD
You need to set the actors angle permanetly while he do the animation
and let the animation loop, parameter loopA must be 1
0812: actor 10@ perform_animation_sequence "Cop_move_FWD" IFP_file "POLICE" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 ms
CODE
{$CLEO .cs}
:ActorWalk_1
03A4: name_thread 'WALKACT'

:ActorWalk_2
wait 0
00D6: if  0
0256:  player $PLAYER_CHAR defined
jf @ActorWalk_2
if
0AB0:  key_pressed 8//--------------------------------- key Backspace
jf @ActorWalk_2
0247: load_model #FBI
0247: load_model #M4
04ED: load_animation "POLICE"

:ActorWalk_5
wait 0
if  and
0248:  model #FBI available
0248:  model #M4 available
04EE:  animation "POLICE" loaded
jf @ActorWalk_5


:ActorWalk_7
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 8.0  4.0  0.2
009A: 10@ = create_actor_pedtype 24 model #FBI at 1@ 2@ 3@
0249: release_model #fbi
0@ = 0

:ActorWalk_13
wait 0
if
0256:  player $PLAYER_CHAR defined
jf @ActorWalk_57
if
8118: not  actor 10@ dead
jf @ActorWalk_57
if
0@ == 0
jf @ActorWalk_13
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
00A0: store_actor 10@ position_to 11@ 12@ 13@
00A0: store_actor $PLAYER_ACTOR position_to 21@ 22@ 23@
0063: 11@ -= 21@ // (float)
0063: 12@ -= 22@ // (float)
0604: get_Z_angle_for_point 11@ 12@ store_to 30@
000B: 30@ += 180.0
0173: set_actor 10@ Z_angle_to 30@
0812: actor 10@ perform_animation_sequence "Cop_move_FWD" IFP_file "POLICE"  4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 ms
if
00FE:  actor 10@ sphere 0 in_sphere 1@ 2@ 3@ radius 1.5 1.5 1.5
jf @ActorWalk_13
0812: actor 10@ perform_animation_sequence "Door_Kick" IFP_file "POLICE"  4.0  0  1  1  0 -1 ms
0@ = 1
jump @ActorWalk_13

:ActorWalk_57
04EF: release_animation "POLICE"
01C2: remove_references_to_actor 10@
jump @ActorWalk_2
You are really perfect in this zaz.. but I want the actor 10 to go to the last seen area of the player and not after the player... also I want him to stop in the last seen area.. going a little forward wont harm the script.. but if that damn cop follows cj wherever he goes that will be very... umm... strange and it will not look as if cj is hiding..

can u give me the script for cj moving to 1@ 2@ 3@ with the same walk method like u have shown above...? where 1@ 2@ 3@ is the player offset 0.0 0.0 0.0 ..? and the cop stopping and the place like if you have tried my script.. the player stopping at the place and looking here and there..? and can we work together zaz.. sigh.gif ?

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#613

Posted 04 May 2013 - 04:48 PM

about if 056D: actor $COPILOT_1 defined: i described a method to see if that check works
if it don't work because anything is wrong in the script blocks after COPSYST_100, then i don't know because you didn't post that code

QUOTE
can u give me the script for cj moving to 1@ 2@ 3@ with the same walk method like u have shown above...?
you can do it yourself, by removing this line and paste it there where it is placed in the other script
CODE
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#614

Posted 05 May 2013 - 11:09 AM Edited by MRobinson, 11 May 2013 - 10:14 AM.

Post Deleted by the User

thedarkline
  • thedarkline

    Player Hater

  • Members
  • Joined: 15 May 2013

#615

Posted 17 May 2013 - 08:19 PM

sorry if i want to add a new safehouse in gta vc what should i do

Xzax
  • Xzax

    Player Hater

  • Members
  • Joined: 21 Feb 2010

#616

Posted 20 August 2013 - 09:29 PM

Hey guys I want to find out how to display an image ingame using cleo script ?

for example i have image : image.png

I want it appear in my screen in the game at some corner....

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#617

Posted 20 August 2013 - 09:50 PM

There's no easy way to display a PNG image via CLEO without other external plugins. You can either

32gusti
  • 32gusti

    Player Hater

  • Members
  • Joined: 04 Sep 2013
  • Indonesia

#618

Posted 10 September 2013 - 09:49 AM

hai, ZAZ how to adding effects/particle on the car explosion


ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#619

Posted 10 September 2013 - 05:42 PM

hai, ZAZ how to adding effects/particle on the car explosion

read the lesson about Particle Effects


In45do
  • In45do

    Coding like a Dummy...

  • Members
  • Joined: 15 Jan 2012
  • Indonesia

#620

Posted 07 December 2013 - 03:19 PM

Great tutorial!
I have one question, how do I detect if CJ's can't open a car? (locked car detection)


SIimShady
  • SIimShady

    Player Hater

  • Members
  • Joined: 07 Dec 2013

#621

Posted 07 December 2013 - 05:28 PM

Thank you so much, it really helped me :)


aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#622

Posted 07 December 2013 - 07:46 PM

Great tutorial!
I have one question, how do I detect if CJ's can't open a car? (locked car detection)

Maybe using 09B3 would help? You can see what returned values mean from here. If it returns 1, it's unlocked.

  • In45do likes this

In45do
  • In45do

    Coding like a Dummy...

  • Members
  • Joined: 15 Jan 2012
  • Indonesia

#623

Posted 08 December 2013 - 12:52 AM

 

Great tutorial!
I have one question, how do I detect if CJ's can't open a car? (locked car detection)

Maybe using 09B3 would help? You can see what returned values mean from here. If it returns 1, it's unlocked.

 

Thanks alot! :^:


iFarbod
  • iFarbod

    PAWN & PHP Coder!

  • Members
  • Joined: 17 Dec 2013
  • None

#624

Posted 06 January 2014 - 04:35 PM

Why this code crashes my game??

 

{$CLEO .cs}


//-------------MAIN---------------
0000: NOP


:TEST
wait 0
Model.Load(#MINIGUN_BASE)
038B: load_requested_models


1@ = Object.Create(#MINIGUN_BASE, 2484.3088, -1656.756, 13.3327)
Object.Angle(1@) = 88.3608
wait 5000
Object.Destroy(1@)


jump @TEST


i want an object not a lot of. this code creates and after 5 secs destroy it and create another one can anyone fixes it?

sry for my bad english


ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#625

Posted 20 January 2014 - 05:37 PM

Consider that object placement can be stored in User Files Savegames by making savegame
Take care to avoid savegames when there are cleoscripts running that spawns objects
If you load such a savegame, the script spawns the object again, unless...
... you give instruction to run the script only for one time, with 0A95: enable_thread_saving

{$CLEO .cs}
:Object
thread 'OBJECT'
wait 1000
0A95: enable_thread_saving
Model.Load(#MINIGUN_BASE)
038B: load_requested_models
1@ = Object.Create(#MINIGUN_BASE, 2484.3088, -1656.756, 13.3327)
Object.Angle(1@) = 88.3608
0A93: end_custom_thread

viva yo
  • viva yo

    Player Hater

  • Members
  • Joined: 18 Oct 2010

#626

Posted 02 May 2014 - 11:16 PM

HI, can someone help me?

 

I installed a cleo file wich enbles you to switch between high an low beams when you are in a car. The problem is that the button to switch between the lights is already used by another cleo file, so I opened the headlights CLEO file (head.cs) to chang the button; I replaced key_pressed 71 for key_pressed 72, but the game crashes when I enter in a car. What I did wrong?


ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#627

Posted 04 May 2014 - 06:32 PM

this needs to see the complete script, both scripts
please open a new topic for your help request in the coding section, it doesn't belong to the tutorial


indo_14
  • indo_14

    Player Lover

  • Members
  • Joined: 27 Oct 2011
  • Red-Cross

#628

Posted 06 May 2014 - 11:24 AM

Hi, ZAZ, can you help me?

 

i want to make a CLEO script that makes the armies (6 stars wanted level) is replaced with SWAT

Sorry for being very Noob


Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#629

Posted 06 May 2014 - 12:57 PM

Actually this is a pretty interesting request. Hope ZAZ won't mind :p

Test this - I've used a feature used in III in Decoy, I think SA still has it.

Untested:

{$CLEO}
0000: SWAT

while true
    wait 250
    if 010F:   player 0 wanted_level > 5
    then
        0AB1: call_scm_func @SET_SWAT_REQUIRED 1 flag true

        while 010F:   player 0 wanted_level > 5
            wait 250
        end

        0AB1: call_scm_func @SET_SWAT_REQUIRED 1 flag false
    end
end

:SET_SWAT_REQUIRED
0AA7: call_function 0x56E230 num_params 1 pop 1 -1 1@
1@ += 0x1E
0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0
if 0@ == true
then 08BD: set 2@ bit 3
else 08C3: clear 2@ bit 3
end
0A8C: write_memory 1@ size 1 value 2@ virtual_protect 0
0AB2: ret 0

indo_14
  • indo_14

    Player Lover

  • Members
  • Joined: 27 Oct 2011
  • Red-Cross

#630

Posted 07 May 2014 - 02:59 AM

ok, i will note that coz' my PC had a prob




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users