Quantcast

Jump to content

» «
Photo

Scripting Help

4 replies to this topic
Cell Tennyson
  • Cell Tennyson

    We will eliminate all the Cuban Today!

  • Members
  • Joined: 22 Oct 2012
  • India

#1

Posted 27 August 2013 - 07:40 AM

Hi Friends! smile.gif

I am working on a GTA SA Cleo Mod whereby with the press of a button i should be able to change the Pedtype of any Random ped to the pedtype of Grove Street Families. For example a Ballas Gang member when CJ aims at him (the green triangle comes when aiming with or without gun) his pedtype turns to grove gang members and thereby i will use him to kill his own gang members.. But unfortuntely the Script i have made is not working since there is something wrong in it. Please tell me which line to correct. smile.gif smile.gif

The Script goes like this.

CODE
{$CLEO}
//----------------MAIN---------------

thread 'GANG'

:GANG
wait 0 ms
if
  Player.Defined($PLAYER_CHAR)
else_jump @GANG
if and
09E7:   player $PLAYER_CHAR not_frozen
84AD:   not actor $PLAYER_ACTOR in_water
not Actor.Driving($PLAYER_ACTOR)
else_jump @GANG
077E: get_active_interior_to 0@
if
 0@ == 1
else_jump @GANG

:GANG_1
wait 0 ms
if
  Player.Defined($PLAYER_CHAR)
else_jump @GANG_1
04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 10.0 -1.0 0.0
if
0AE1: 7@ = random_actor_near_point 10@ 11@ 12@ in_radius 10.0 find_next 0 pass_deads 1
else_jump @GANG_3
0665: get_actor 7@ model_to 8@
Actor.DestroyInstantly(7@)
wait 100 ms
gosub @GANG_4
if and
0457:   player $PLAYER_CHAR aiming_at_actor 7@
00E1:   player 0 pressed_key 6
else_jump @GANG_1
009A: 7@ = create_actor_pedtype 8 model 8@ at 10@ 11@ 12@
Actor.SetImmunities(7@, 1, 0, 0, 0, 0)
Model.Destroy(8@)

:GANG_3
wait 0 ms
if
8AE1: not 7@ = random_actor_near_point 10@ 11@ 12@ in_radius 10.0 find_next 1 pass_deads 1
else_jump @GANG_1

:GANG_4
wait 0 ms
Model.Load(8@)
Model.Load(#COLT45)
if
  Model.Available(8@)
  Model.Available(#COLT45)
else_jump @GANG_4
01B2: give_actor $PLAYER_ACTOR weapon 22 ammo 5000 // Load the weapon model before using this
return


Just tell me what is wrong, which line to correct.

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

#2

Posted 27 August 2013 - 11:52 AM

How would player aim at an actor who's destroyed 100ms before the check?

Cell Tennyson
  • Cell Tennyson

    We will eliminate all the Cuban Today!

  • Members
  • Joined: 22 Oct 2012
  • India

#3

Posted 27 August 2013 - 12:38 PM Edited by Cell Tennyson, 27 August 2013 - 12:53 PM.

QUOTE
How would player aim at an actor who's destroyed 100ms before the check?


Ok i've changed the script but still on aiming the Random ped its pedtype is not changing to grove st.
Here is the new script.
CODE
{$CLEO}
//----------------MAIN---------------

thread 'GANG'

:GANG
wait 0 ms
if
  Player.Defined($PLAYER_CHAR)
else_jump @GANG
if and
09E7:   player $PLAYER_CHAR not_frozen
84AD:   not actor $PLAYER_ACTOR in_water
not Actor.Driving($PLAYER_ACTOR)
else_jump @GANG
077E: get_active_interior_to 0@
if
 0@ == 1
else_jump @GANG

:GANG_1
wait 0 ms
if
  Player.Defined($PLAYER_CHAR)
else_jump @GANG_1
04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 10.0 -1.0 0.0
if
0AE1: 7@ = random_actor_near_point 10@ 11@ 12@ in_radius 50.0 find_next 0 pass_deads 1
else_jump @GANG_3
0665: get_actor 7@ model_to 8@
wait 100 ms
gosub @GANG_4
if and
0457:   player $PLAYER_CHAR aiming_at_actor 7@
00E1:   player 0 pressed_key 6
00E1:   player 0 pressed_key 8
else_jump @GANG_1
07AF: 15@ = player $PLAYER_CHAR group
009A: 7@ = create_actor_pedtype 8 model 8@ at 10@ 11@ 12@
Actor.SetImmunities(7@, 1, 0, 0, 0, 0)
Model.Destroy(8@)
0631: put_actor 7@ in_group 15@
0630: put_actor $PLAYER_ACTOR in_group 15@ as_leader
if
00E1:   player 0 pressed_key 9
else_jump @GANG_1
0632: release_group 15@
01C2: remove_references_to_actor 7@ // Like turning an actor into a random pedestrian
jump @GANG

:GANG_3
wait 0 ms
if
8AE1: not 7@ = random_actor_near_point 10@ 11@ 12@ in_radius 50.0 find_next 1 pass_deads 1
else_jump @GANG_1

:GANG_4
wait 0 ms
Model.Load(8@)
Model.Load(#COLT45)
if
  Model.Available(8@)
  Model.Available(#COLT45)
else_jump @GANG_4
return

ZAZ
  • ZAZ

    Kernlochbohrer

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

#4

Posted 27 August 2013 - 08:15 PM

check if aim key is pressed
then check for random actor
if no actor was found then jump back to start loop label
if yes then check if player aims to that random actor
if not then jump back to start loop label
if yes then read coords and model id of randomactor
load model
destroy random actor
spawn new actor with pedtype 8

then keep the code running in a loop which checks if the actor is dead or far away
or if key 9 is pressed
then remove the reference of the actor

while code is running in this loop can you recruit this actor

in your script does the code jump back imeditely to start loop label
CODE
if
00E1:   player 0 pressed_key 9
else_jump @GANG_1

so, the whole action will be repeated because of aim key, maybe the new actor will be replaced again with a new one or another ped will be replaced with a new actor
the script creates then a lot of actors, but it needs to remove reference of every created actor

Cell Tennyson
  • Cell Tennyson

    We will eliminate all the Cuban Today!

  • Members
  • Joined: 22 Oct 2012
  • India

#5

Posted 28 August 2013 - 05:30 AM

Still The Script is not working. Here i've done some improvements but just to get nothing and i think this area needs more concern.
CODE
:GANG_1
wait 0 ms
if and
  Player.Defined($PLAYER_CHAR)
  00E1:   player 0 pressed_key 6
else_jump @GANG_1
04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 10.0 -1.0 0.0
if
0AE1: 7@ = random_actor_near_point 10@ 11@ 12@ in_radius 50.0 find_next 0 pass_deads 1
else_jump @GANG_3
04C4: store_coords_to 13@ 14@ 15@ from_actor 7@ with_offset 10.0 10.0 10.0
0665: get_actor 7@ model_to 8@
009B: destroy_actor 7@
wait 100 ms
gosub @GANG_4
009A: 7@ = create_actor_pedtype 8 model 8@ at 13@ 14@ 15@
if and
00E1:   player 0 pressed_key 6
0457:   player $PLAYER_CHAR aiming_at_actor 7@
00E1:   player 0 pressed_key 9
else_jump @GANG_1
07AF: 6@ = player $PLAYER_CHAR group
Actor.SetImmunities(7@, 1, 0, 0, 0, 0)
0631: put_actor 7@ in_group 15@
0630: put_actor $PLAYER_ACTOR in_group 6@ as_leader
if
00E1:   player 0 pressed_key 9
else_jump @GANG_1
0632: release_group 6@
01C2: remove_references_to_actor 7@ // Like turning an actor into a random pedestrian





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users