IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Changing CJ into another Actor

 Changing CJ to diffrent Actor
 
putraGTA  
Posted: Tuesday, Jul 31 2012, 10:01
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



Hello., I'am newbie here..,
I want to ask you how to change CJ into another Actor after he killed someone (#SPECIAL01)
In this topic, after CJ kill Tenpenny, I want to change CJ into Tenpenny when I press S.
Here's my cleo script :

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
thread 'NOP'

:NOP_11
wait 0
if
Player.Defined($PLAYER_CHAR)
else_jump @NOP_11
if
$ONMISSION == 0
else_jump @NOP_11
if
00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 262.1767 2896.174 10.1698 radius 100.5 100.5 50.5
else_jump @NOP_11
Model.Load(#AK47)
023C: load_special_actor 'TENPEN' as 1 // models 290-299

:NOP_115
wait 0
if
Model.Available(#AK47)
Model.Available(#SPECIAL01)
else_jump @NOP_115
1@ = Actor.Create(Mission1, #SPECIAL01, 262.1767, 2896.174, 10.1698)
Actor.Angle(1@) = 347.2881
Actor.Health(1@) = 10550
0446: set_actor 1@ immune_to_headshots 0
04D8: set_actor 1@ drowns_in_water 0
0946: set_actor 1@ actions_uninterupted_by_weapon_fire 0
01B2: give_actor 1@ weapon 30 ammo 9999 // Load the weapon model before using this
0245: set_actor 1@ walk_style_to "SWAT"
03FE: set_actor 1@ money 3000
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
$TENPEN_ACTOR = Actor.Health(1@)
$TENPEN_ACTOR /= 40
03C4: set_status_text $TENPEN_ACTOR type 1 GXT 'NA' // global_variable
Model.Destroy(#SPECIAL01)

:NOP_279
wait 0
if
Player.Defined($PLAYER_CHAR)
else_jump @NOP_368
if
not Actor.Dead(1@)
else_jump @NOP_385
if
00F2: actor $PLAYER_ACTOR near_actor 1@ radius 200.0 200.0 0
$TENPEN_ACTOR = Actor.Health(1@)
$TENPEN_ACTOR /= 25
else_jump @NOP_368
jump @NOP_279

:NOP_368
Actor.RemoveReferences(1@)
0151: remove_status_text $TENPEN_ACTOR
jump @NOP_11

:NOP_385
Actor.RemoveReferences(1@)
0151: remove_status_text $TENPEN_ACTOR
end_thread

Pleasse help me.., cryani.gif
PM
  Top
 

 
JACK JONES  
Posted: Tuesday, Jul 31 2012, 10:59
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



CODE
{$CLEO .cs}
03A4: name_thread 'Jack'

:0
0001: wait 250 ms
00D6: if
0256:   player $PLAYER_CHAR defined
jf @0

:3
wait 0
if and    //for more then 1 conditions use "if and"
0038:   $ONMISSION == 0
00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 262.1767 2896.174 10.1698 radius 100.5 100.5 50.5
jf @3
0247: load_model #AK47
023C: load_special_actor 'TENPEN' as 1 // models 290-299
038B: load_requested_models  // you will also need that

:Load
wait 0
if and
0248:   model #AK47 available
023D:   special_actor 1 loaded
jf @Load
009A: 0@ = create_actor_pedtype 4 model #SPECIAL01 at 262.1767 2896.174 10.1698
0173: set_actor 0@ Z_angle_to 347.3
0223: set_actor 0@ health_to 10550
0446: set_actor 0@ immune_to_headshots 0
04D8: set_actor 0@ drowns_in_water 0
0946: set_actor 0@ actions_uninterupted_by_weapon_fire 0
01B2: give_actor 0@ weapon 30 ammo 9999 // Load the weapon model before using this
0245: set_actor 0@ walk_style_to "SWAT"
03FE: set_actor 0@ money 3000
05E2: AS_actor 0@ kill_actor $PLAYER_ACTOR
0296: unload_special_actor 1
0249: release_model #AK47

:1
wait 0
if and
0AB0:  key_pressed 0x53
0118:   actor 0@ dead
jf @2
09C7: change_player $PLAYER_CHAR model_to #SPECIAL01
0687: clear_actor $PLAYER_ACTOR task
jump @Clean

:2
wait 0
if
8256:   NOT   player $PLAYER_CHAR defined
jf @1

:Clean
01C2: remove_references_to_actor 0@ // Like turning an actor into a random pedestrian
0A93: end_custom_thread   // use that instead of the "end_thread"

If you press S after you kill Tenpeni the player skin will change to Tenpeni.
Read CLEO scrypt tutorial by ZAZ:
http://www.gtaforums.com/index.php?showtopic=403594&st=0

This post has been edited by JACK JONES on Tuesday, Jul 31 2012, 11:33
PM
  Top
 

 
putraGTA  
Posted: Tuesday, Jul 31 2012, 14:32
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



Waw thank's @JACK JONES!
that's work completely..
But, the health bar won't appeared sarcasm.gif
How to make the health bar appeared ?
PM
  Top
 

 
JACK JONES  
Posted: Tuesday, Jul 31 2012, 16:01
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



CODE
:J
wait 0
0226: $WWQ = actor 0@ health
03c4: set_status_text_to $WWQ 0 'jack'
jump @J

But you shouldn't use that inside a CLEO because the opcode 03C4 uses a global variable ($) and it can crash the game sometimes when it's in CLEO. If you put that whole code inside a main.scm that wouldn't be a problem but then you'll have to start the game from the begining because the main.scm changes will destroy all of the old save game files confused.gif.

This post has been edited by JACK JONES on Tuesday, Jul 31 2012, 16:58
PM
  Top
 

 
Link2012  
Posted: Tuesday, Jul 31 2012, 18:11
Quote Post


Wut?
Group Icon
Group: Members
Joined: Jan 30, 2011

ba.gif

XXXXX



EDITED, What a crap

@JACK JONES Below
I don't mean anything, I just write something VERY wrong here and edited, my bad.

This post has been edited by Link2012 on Tuesday, Jul 31 2012, 19:09
PMMSN
  Top
 

 
JACK JONES  
Posted: Tuesday, Jul 31 2012, 18:40
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



What do you mean? 03C4 works fine in main.scm.
EDIT: Oh Okey

This post has been edited by JACK JONES on Tuesday, Jul 31 2012, 19:12
PM
  Top
 

 
putraGTA  
Posted: Thursday, Aug 2 2012, 10:15
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



@JACK JONES,
I'am using the health bar opcode for vehicle, but it will crash my game nervous.gif
What happened?
PM
  Top
 

 
JACK JONES  
Posted: Thursday, Aug 2 2012, 10:51
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



Post your scrypt. I'm not a magician - I can't see through your screen lol.gif .
PM
  Top
 

 
putraGTA  
Posted: Friday, Aug 3 2012, 10:52
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



@JACK JONES,
btw did you know the smoke's crack on final mission (end of the line)?
if yes, how to make script to open the smoke's crack and enter the room ?
happy.gif
PM
  Top
 

 
JACK JONES  
Posted: Friday, Aug 3 2012, 12:49
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



CODE
{$CLEO .cs}
03A4: name_thread 'Jack'
Object.Destroy($2721)

:0
wait 250
if
0256:   player $PLAYER_CHAR defined
jf @0
0778: recreate_objects_in_object_group "CARTER"

:1
wait 250
if
8256:   NOT   player $PLAYER_CHAR defined
jf @1

:2
wait 0
jump @0

But watch out for that $2721 number - it has to be the same as in main.scm so open main.scm, find this:
CODE
Object.Init(#IMY_SHASH_WALL, 2522.008, -1272.93, 35.609)

and make sure to put the same number that stands there into the CLEO code. If everything goes right that wall is gone and you can enter the building (I checked).

This post has been edited by JACK JONES on Friday, Aug 3 2012, 13:04
PM
  Top
 

 
putraGTA  
Posted: Friday, Aug 3 2012, 21:35
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



Yeah.,it's work!
But just open the wall, @JACK JONES when I'am enter the smoke's crack, I always stuck in there.
It never let me go inside,why?
PM
  Top
 

 
putraGTA  
Posted: Saturday, Aug 4 2012, 00:18
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



Here the script :
{$CLEO.cs}
03A4: name_thread 'Crack'
Object.Destroy ($2721)
:Crack_0
wait 250
if
0256: player $PLAYER_CHAR defined
jf @Crack_0
0778: recreate_objects_in_object_group "CARTER"
:Crack_1
wait 250
if
8256: not player $PLAYER_CHAR defined
jf @Crack_1
:Crack_2
wait 0
jump @Crack_0
PM
  Top
 

 
JACK JONES  
Posted: Saturday, Aug 4 2012, 07:31
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



Fixed:
CODE
{$CLEO .cs}
03A4: name_thread 'Jack'

:0
wait 0
if
03CA:   object $2721 exists  // checks if the object exists
jf @1  // if no it return to 1
0108: destroy_object $2721

:1
wait 250
if
0256:   player $PLAYER_CHAR defined  // check if a player is still playing
jf @1

:2
wait 0
if
00EC:   actor $PLAYER_ACTOR 0 near_point 2534.8198 -1289.8668 radius 80.0 80.0   // checks if the player is near the factory
jf @2
0778: recreate_objects_in_object_group "CARTER"
jump @0  // goes to the begining
PM
  Top
 

 
putraGTA  
Posted: Saturday, Aug 4 2012, 08:45
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



Bingo! Very cool,
Thank you so much @JACK JONES ! smile.gif
It's working perfectly and I can spawn big smoke smile.gif

@JACK JONES, how to make script that spawn pedestrian with jetpack and kill CJ ?
Everytime I tried my script, but it never work sad.gif
PM
  Top
 

 
JACK JONES  
Posted: Saturday, Aug 4 2012, 14:55
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



Somebody made a great mode for that - look for it on the internet.
PM
  Top
 

 
putraGTA  
Posted: Sunday, Aug 5 2012, 12:20
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



One thing I don't know,
@JACK JONES, did you know how to make particle can damage pedestrian?
(ex: "flamethrower" particle burning a car)
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG