Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
tysman

CLEO Player Changer

Recommended Posts

tysman

Hello so I have this player changer script, when the game loads you play as a niko bellic ped, and if you press Shift and A keys together you will play as CJ, what I need help with is I would like to be able to press Shift and Q and play as niko again, and be able to go back and forth between peds (in a loop). I would also like, if you played as niko and you die you will spawn at the hospital as niko and if you play as CJ and you die you will spawn as CJ at the hospital.

 

// 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 'NIKO' :NIKO_11wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @NIKO_11 Model.Load(#NIKO):NIKO_36wait 0 if   Model.Available(#NIKO)else_jump @NIKO_36 09C7: change_player $PLAYER_CHAR model_to #NIKO Player.Build($PLAYER_CHAR):NIKO_69wait 0 if and0AB0:   key_pressed 16 0AB0:   key_pressed 65 else_jump @NIKO_69 Model.Destroy(#NIKO)Actor.RemoveReferences($PLAYER_CHAR)09C7: change_player $PLAYER_CHAR model_to $PLAYER_CHAR Player.Build($PLAYER_CHAR):NIKO_115wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @NIKO_158 if   Actor.Dead($PLAYER_CHAR)else_jump @NIKO_163 jump @NIKO_115 :NIKO_158Actor.RemoveReferences($PLAYER_CHAR):NIKO_163Model.Destroy(#NIKO)Actor.RemoveReferences($PLAYER_CHAR)jump @NIKO_11 

 

Share this post


Link to post
Share on other sites
tysman

I got it to change back to Niko using these codes, but I can't go back to CJ when I press Shift and A. I need them to loop between each other confused.gif

 

:NIKO_85wait 0 if and0AB0:   key_pressed 16 0AB0:   key_pressed 81 else_jump @NIKO_85 Model.Destroy(#NIKO)Actor.RemoveReferences($PLAYER_CHAR)09C7: change_player $PLAYER_CHAR model_to #NIKO Player.Build($PLAYER_CHAR)

 

Edited by tysman

Share this post


Link to post
Share on other sites
Node
I got it to change back to Niko using these codes, but I can't go back to CJ when I press Shift and A. I need them to loop between each other confused.gif

 

:NIKO_85wait 0 if and0AB0:   key_pressed 16 0AB0:   key_pressed 81 else_jump @NIKO_85 Model.Destroy(#NIKO)Actor.RemoveReferences($PLAYER_CHAR)09C7: change_player $PLAYER_CHAR model_to #NIKO Player.Build($PLAYER_CHAR)

 

Add a

jump @NIKO_85

 

at the bottom of the script under "Player.build($PLAYER_CHAR)"

Share this post


Link to post
Share on other sites
ZAZ

 

{$CLEO .cs}//-------------MAIN---------------thread 'NIKO':NIKO_11wait 0if Player.Defined($PLAYER_CHAR)else_jump @NIKO_11if //and0AB0:   key_pressed 8// backspace//0AB0:   key_pressed 16//  shift key//0AB0:   key_pressed 65//  a keyelse_jump @NIKO_11:NIKO_13wait 0023C: load_special_actor 'CESAR' as 1 // models 290-299if023D:   special_actor  1 loadedelse_jump @NIKO_1309C7: change_player $PLAYER_CHAR model_to #SPECIAL010296: unload_special_actor  1wait 1000:NIKO_115wait 0if Player.Defined($PLAYER_CHAR)else_jump @NIKO_115if Actor.Dead($PLAYER_ACTOR)else_jump @NIKO_115wait 2000:NIKO_125wait 0if Player.Defined($PLAYER_CHAR)else_jump @NIKO_125Model.Load(#NULL):NIKO_135wait 0 if   Model.Available(#NULL)else_jump @NIKO_13509C7: change_player $PLAYER_CHAR model_to #NULLjump @NIKO_11 

 

I got a bug when i use your keypress combo

and it crashes with changed model when a mission cutscene starts

Share this post


Link to post
Share on other sites
TheSiggi

This code always worked for me, just replace #MACCER with #NIKO

 

 

{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'MACCER' 0000: NOP :MACCER_130001: wait 20 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @MACCER_335 00D6: if 03EE:   player $PLAYER_CHAR controllable 004D: jump_if_false @MACCER_335 00D6: if and80DF:   not actor $PLAYER_ACTOR driving 0AB0:   key_pressed 99 004D: jump_if_false @MACCER_335 00D6: if 0039:   [email protected] == 0 004D: jump_if_false @MACCER_256 023C: load_special_actor 'MACCER' as 1 // models 290-299 0006: [email protected] = 0 :MACCER_1070001: wait 0 ms 00D6: if 023D:   special_actor 1 loaded 004D: jump_if_false @MACCER_133 0002: jump @MACCER_158 :MACCER_1330001: wait 4 ms 000A: [email protected] += 1 0019:   [email protected] > 30 004D: jump_if_false @MACCER_107 :MACCER_1580169: set_fade_color_RGB 0 0 0 016A: fade 0 time 500 0001: wait 500 ms 0665: get_actor $PLAYER_ACTOR model_to [email protected] 09C7: change_player $PLAYER_CHAR model_to #SPECIAL01 070D: rebuild_player $PLAYER_CHAR 0489: set_actor $PLAYER_ACTOR muted 1 0296: unload_special_actor 1 0006: [email protected] = 1 0001: wait 1000 ms 016A: fade 1 time 1000 :MACCER_229016B:   fading 004D: jump_if_false @MACCER_249 0001: wait 0 ms 0002: jump @MACCER_229 :MACCER_2490002: jump @MACCER_335 :MACCER_2560169: set_fade_color_RGB 0 0 0 016A: fade 0 time 500 0001: wait 500 ms 09C7: change_player $PLAYER_CHAR model_to [email protected] 070D: rebuild_player $PLAYER_CHAR 0489: set_actor $PLAYER_ACTOR muted 0 0006: [email protected] = 0 0001: wait 1000 ms 016A: fade 1 time 1000 :MACCER_315016B:   fading 004D: jump_if_false @MACCER_335 0001: wait 0 ms 0002: jump @MACCER_315 :MACCER_3350002: jump @MACCER_13

 

 

lost the high level source though :S

Share this post


Link to post
Share on other sites
fastman92

I have added new ped in peds.ide and DFF, TXD file to gta3.img, called nikobellic.

Automatically after loading the game i am Niko Bellic, i can switch between CJ and Niko Bellic by typing "NIKO"

Requires CLEO4, if you want it to get it working on CLEO3 it takes one minute for me, do it yourself anyway...

Being Niko Bellic (changed player) can cause this bug:

 

 

{$CLEO}CONSTNIKO_PED = #NIKOBELLICEND gosub @[email protected] = TRUE:SWITCHwait 0if0ADC:   test_cheat "NIKO"else_jump @SWITCH   if   [email protected] == TRUE   then   09C7: change_player $PLAYER_CHAR model_to #NULL   [email protected] = FALSE   else   gosub @CHANGE_PLAYER_TO_NIKO_BELIC   [email protected] = TRUE   endjump @SWITCH   :CHANGE_PLAYER_TO_NIKO_BELICModel.Load(NIKO_PED):CHANGE_PLAYER_TO_NIKO_BELIC_AVAILABLEwait 0ifModel.Available(NIKO_PED)else_jump @CHANGE_PLAYER_TO_NIKO_BELIC_AVAILABLE09C7: change_player $PLAYER_CHAR model_to NIKO_PEDModel.Destroy(NIKO_PED)return

 

Share this post


Link to post
Share on other sites
tysman

Thanks guys for the help, all I had to do was the code

 

jump @NIKO_69

 

 

Now I can loop between each model, the only problem I am experiencing is when you press the keys to change the player, if you have niko or CJ jumping in the air while holding Shift then pressing A or Q you can move the player after it changes, but if you do it quicker without CJ or niko jumping while holding shift and you press A or Q then you can no longer move the player. Is there a code I can use to make the player move no matter what you do in the script confused.gif

Share this post


Link to post
Share on other sites
TheNathanNS
Thanks guys for the help, all I had to do was the code

 

jump @NIKO_69

 

 

Now I can loop between each model, the only problem I am experiencing is when you press the keys to change the player, if you have niko or CJ jumping in the air while holding Shift then pressing A or Q you can move the player after it changes, but if you do it quicker without CJ or niko jumping while holding shift and you press A or Q then you can no longer move the player. Is there a code I can use to make the player move no matter what you do in the script confused.gif

no i dont think there is yet

i wanted to do a video where im going through all my skins while skydiving but for me i can only change if i aint in a car or flying etc

 

Share this post


Link to post
Share on other sites
ZAZ
the only problem I am experiencing is when you press the keys to change the player, if you have niko or CJ jumping in the air while holding Shift then pressing A or Q you can move the player after it changes, but if you do it quicker without CJ or niko jumping while holding shift and you press A or Q then you can no longer move the player. Is there a code I can use to make the player move no matter what you do in the script confused.gif

maybe it's because the walk function of key A

set him first frozen and then a tiny wait before changing

Share this post


Link to post
Share on other sites
tysman

This is the CLEO script from Jurassic Park Operation Andreas, that turns CJ into Grant if you press the Tab key. The player doesn't jump (cause it is the Tab key) and you can move after it changes. Let me know if there is something in this code that I can use to make my player move no matter what

 

// 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 'MYERS' Model.Load(#WMYMECH)Model.Load(#KNIFECUR)038B: load_requested_models :MYERS_22wait 0 if and  Player.Defined($PLAYER_CHAR)  Player.Controllable($PLAYER_CHAR)jf @MYERS_47 :MYERS_47wait 500 if 0AB0:   key_pressed 9 jf @MYERS_47 01B2: give_actor $PLAYER_ACTOR weapon 4 ammo 99999 // Load the weapon model before using this 09C7: change_player $PLAYER_CHAR model_to #WMYMECH Player.Build($PLAYER_CHAR)jf @MYERS_98 :MYERS_98wait 500 if 0AB0:   key_pressed 9 jf @MYERS_98 048F: actor $PLAYER_ACTOR remove_weapons 0794: restore_player_clothes Player.Build($PLAYER_CHAR)wait 1000 jump @MYERS_22

 

Edited by tysman

Share this post


Link to post
Share on other sites
tysman

Maybe this will help

 

Player.Controllable($PLAYER_CHAR)

 

but I don't know confused.gif

Share this post


Link to post
Share on other sites
ZAZ

 

Maybe this will help

 

Player.Controllable($PLAYER_CHAR)

 

but I don't know confused.gif

No and the Jurassic Park script is not good

use model #null to change back to CJ

 

{$CLEO .cs}//-------------MAIN---------------thread 'PLAYMODL':PLAYMODL_11wait 0if Player.Defined($PLAYER_CHAR)else_jump @PLAYMODL_11if0AB0:   key_pressed 8// backspaceelse_jump @PLAYMODL_11Model.Load(#WMYMECH)Model.Load(#KNIFECUR):PLAYMODL_35wait 0 if  and  Model.Available(#WMYMECH)  Model.Available(#KNIFECUR)else_jump @PLAYMODL_3509C7: change_player $PLAYER_CHAR model_to #WMYMECHwait 100001B2: give_actor $PLAYER_ACTOR weapon 4 ammo 99999:PLAYMODL_115wait 0if Player.Defined($PLAYER_CHAR)else_jump @PLAYMODL_115if0AB0:   key_pressed 8// backspaceelse_jump @PLAYMODL_115Model.Load(#NULL):PLAYMODL_135wait 0 if   Model.Available(#NULL)else_jump @PLAYMODL_13509C7: change_player $PLAYER_CHAR model_to #NULLwait 1000jump @PLAYMODL_11 

 

Share this post


Link to post
Share on other sites
tysman

Is #null CJ?

Share this post


Link to post
Share on other sites
TheSiggi

Obviously, yes.

Share this post


Link to post
Share on other sites
tysman

OK thanks

Share this post


Link to post
Share on other sites
tysman

Actually I decided to go with typing there names to spawn them or single key press to fix not moving issue, so the only help I need on is how do I make it so if CJ was spawned and died or busted he will spawn at the hospital or police station. And the same for niko if he spawned

 

// 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 'NIKO' :NIKO_11wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @NIKO_11 Model.Load(#NIKO):NIKO_36wait 0 if   Model.Available(#NIKO)else_jump @NIKO_36 09C7: change_player $PLAYER_CHAR model_to #NIKO Player.Build($PLAYER_CHAR):NIKO_69wait 0if   Player.Defined($PLAYER_CHAR)else_jump @NIKO_69 if and 0AB0:   key_pressed 16 0AB0:   key_pressed 65 else_jump @NIKO_69 Model.Destroy(#NIKO)Actor.RemoveReferences($PLAYER_CHAR)Model.Load(#NULL):NIKO_75wait 0 if   Model.Available(#NULL)else_jump @NIKO_75 09C7: change_player $PLAYER_CHAR model_to #NULL:NIKO_85wait 0if   Player.Defined($PLAYER_CHAR)else_jump @NIKO_85 if and0AB0:   key_pressed 16 0AB0:   key_pressed 81 else_jump @NIKO_85 Model.Destroy(#NULL)Actor.RemoveReferences($PLAYER_CHAR)Model.Load(#NIKO):NIKO_95wait 0 if and  Model.Available(#NIKO)else_jump @NIKO_95 09C7: change_player $PLAYER_CHAR model_to #NIKOjump @NIKO_69:NIKO_115wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @NIKO_158 if   Actor.Dead($PLAYER_CHAR)else_jump @NIKO_163 jump @NIKO_115 :NIKO_158Actor.RemoveReferences($PLAYER_CHAR):NIKO_163Model.Destroy(#NIKO)Actor.RemoveReferences($PLAYER_CHAR)jump @NIKO_11 

 

Edited by tysman

Share this post


Link to post
Share on other sites
ZAZ
Actually I decided to go with typing there names to spawn them or single key press to fix not moving issue, so the only help I need on is how do I make it so if CJ was spawned and died or busted he will spawn at the hospital or police station. And the same for niko if he spawned

 

Have you defined your Niko as ped in peds.ide with an id number?

If not, so load this model as special actor

and don't use Player.Build($PLAYER_CHAR) when you change CJ to another model

and also i posted in my first post a script how to changed him back to cj when he dies

but it crashes with changed model when a mission cutscene starts

you can avoid that with an onmission check

 

:NIKO_125wait 0if andPlayer.Defined($PLAYER_CHAR)0038:   $ONMISSION == 0else_jump @NIKO_125Model.Load(#NULL)

 

Share this post


Link to post
Share on other sites
fastman92

Please note that some models like #NULL don`t need to be loaded by script and are always kept in memory to use.

No need for Model.Load(#NULL), if Model.Available(#NULL), Model.Destroy(#NULL), it doesn`t crash, but it is useless.

Share this post


Link to post
Share on other sites
tysman

thanks guys for helping, so how do I make it so if CJ was spawned and died or busted he will spawn at the hospital or police station. And the same for niko if he spawned

Share this post


Link to post
Share on other sites
tysman

I can use this code for when each Actor would die or get busted

 

0112:   wasted_or_busted // mission only

 

But how would I use this code if I want to spawn the actor in front of the hospital or police station if they died or got busted?

Share this post


Link to post
Share on other sites
ZAZ
I can use this code for when each Actor would die or get busted

 

0112:   wasted_or_busted // mission only

 

But how would I use this code if I want to spawn the actor in front of the hospital or police station if they died or got busted?

can you read the comment behind the opcode line?

Share this post


Link to post
Share on other sites
OrionSR

See if these codes can do the trick for you. 016C and 016D are the normal restarts at the hospital or police department. 08DF and 08E0 are the codes used to provide the girlfriend bonuses for Katie and Barbara.

 

 

016C: restart_if_wasted_at 2027.77 -1420.52 15.99 angle 137.0 town_number 0 016D: restart_if_busted_at 1550.68 -1675.49 14.51 angle 90.0 town_number 0 08DF: override_restart_if_wasted_at -2570.511 1139.582 54.8547 within_radius 1500.0 angle 160.0 08E0: override_restart_if_busted_at -1379.843 2635.74 54.4315 within_radius 1500.0 angle 170.6194 

 

 

 

 

Share this post


Link to post
Share on other sites
tysman

thanks, I did read the comment behind the opcode line, I have used this code in one of my cleo scrips that are not on mission and the code works fine smile.gif

Share this post


Link to post
Share on other sites
ZAZ

 

thanks, I did read the comment behind the opcode line, I have used this code in one of my cleo scrips that are not on mission and the code works fine smile.gif

I tested it also in a normal script and noticed that it won't work as it should like in a mission script

to check if player is wasted or busted outside a mission we have this:

 

if Player.Defined($PLAYER_CHAR)else_jump @

 

Edited by ZAZ

Share this post


Link to post
Share on other sites
tysman

OK now i know what that code is for smile.gif thanks

Share this post


Link to post
Share on other sites
tysman

I got it to work with the dying or getting busted. All I had to do was add the

 

Player.Defined($PLAYER_CHAR)

 

for each of the players when they will spawn and it works perfectly, thanks ZAZ for letting me know what those codes are for. And thanks everybody else for helping to smile.gif have some cookie.gifcookie.gifcookie.gif

Share this post


Link to post
Share on other sites
ZAZ

 

I got it to work with the dying or getting busted. All I had to do was add the

 

Player.Defined($PLAYER_CHAR)

 

for each of the players when they will spawn and it works perfectly, thanks ZAZ for letting me know what those codes are for. And thanks everybody else for helping to smile.gif  have some cookie.gif  cookie.gif  cookie.gif

but it hasn't the exatly meaning like "is $PLAYER_ACTOR dead"

for example if $PLAYER_ACTOR is caught in an endless animation and his health is empty

then you can only brake it by checking

if

0118: actor $PLAYER_ACTOR dead

Share this post


Link to post
Share on other sites
tysman

So I would use this code if I was using an animation and wanted to check if the actor was dead.

 

0118: actor $PLAYER_ACTOR dead 

 

Edited by tysman

Share this post


Link to post
Share on other sites
metacortex

Yes. Would you please review your motives for posting, thanks.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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.