Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

    2. Support

    3. Suggestions

GTA 3 mod coding


crashoverride93
 Share

Recommended Posts

crashoverride93

In gta 3 i am trying to do bassicly the same thing I did at this link but in gta 3 instead of vice city http://gtaforums.com/topic/837594-coding-a-small-mod-in-vice-city/?do=findComment&comment=1068377835and again my code is below. Also is there something capable of converting lo level code like mine to high level code because I don't understand the high level syntex ?

 

 

{$CLEO .cs}

 

//-------------MAIN---------------

thread 'HNS'

 

:HNS_1

wait 100 ms

8256: player $PLAYER_CHAR defined

004D: jump_if_false @HNS_1

:HNS_2

wait 0

8184: actor $PLAYER_CHAR health >= 99

8184: not actor $PLAYER_CHAR health <= 101

004D: jump_if_false @HNS_4

 

:HNS_3

wait 0 ms

0335: set_free_paynspray_to 1

jump @HNS_2

 

 

:HNS_4

wait 0 ms

0335: set_free_paynspray_to 0

jump @HNS_2

Link to comment
Share on other sites

Wow you messed it all.

 

 

8184: actor $PLAYER_CHAR health >= 998184: not actor $PLAYER_CHAR health <= 101

 

One opcode = one function. Opcode 8184 is a NOT opcode and it checks if actor's health IS NOT >= x i.e. the health level is < x, where x =number. It doesn't do anything else

 

You also missed the operator IF. You can't simply put 8184: in your script, you have to write IF 8184:

 

$PLAYER_CHAR is used for PLAYER specified opcodes. Use $PLAYER_ACTOR for actor specified.

 

I would change this to

 

if and0184:   actor $PLAYER_ACTOR health >= 998184:   not actor $PLAYER_ACTOR health >= 101then0335: set_free_paynspray_to 1else0335: set_free_paynspray_to 0end
Link to comment
Share on other sites

crashoverride93

I Tried where you told me to no avail and for 5hours I've been modding this one code with no luck I either crash the game or its always free or never free I can't figure out how to do it

Link to comment
Share on other sites

You need to put 0000: at the beginning of your cleo script.

 

 

{$CLEO .cs}//-------------MAIN---------------0000: :HNS_1wait 250 if and0184:   actor $PLAYER_ACTOR health >= 998184:   not actor $PLAYER_ACTOR health >= 101then0335: set_free_paynspray_to 1else0335: set_free_paynspray_to 0end jump @HNS_1
Link to comment
Share on other sites

crashoverride93

OK thanks that works perfectly

is it also possible to add the 125 check

Because from what I have seen it looks like they will conflict

Link to comment
Share on other sites

crashoverride93

I don't have a clue how to add it

I was thinking of adding another thread to check it if there's a simpler way let me know

I kinda feel stupid because I can't figure this out

Link to comment
Share on other sites

crashoverride93

My original Idea was to add it if it fails the one hundred check by jumping to it if it failed the 100 check.

Link to comment
Share on other sites

crashoverride93

My attempt to add it is here but sanny builder don't like it

 

 

 

{$CLEO .cs}

 

//-------------MAIN---------------

 

0000:

 

:HNS_1

wait 250

 

if and

0184: actor $PLAYER_ACTOR health >= 99

8184: not actor $PLAYER_ACTOR health >= 101

then

0335: set_free_paynspray_to 1

else

Jump @HNS_2

 

 

 

:HNS_2

if and

0184: actor $PLAYER_ACTOR health >= 124

8184: not actor $PLAYER_ACTOR health >= 126

then

0335: set_free_paynspray_to 1

else

0335: set_free_paynspray_to 0

end

Jump @HNS_1

Link to comment
Share on other sites

crashoverride93

I got it working

Never mind its stuck on always free

Sanny likes this but its always free I only want two values to work 125 and 100

 

 

{$CLEO .cs}

 

//-------------MAIN---------------

 

0000:

 

:HNS_1

wait 250

 

if and

0184: actor $PLAYER_ACTOR health >= 99

8184: not actor $PLAYER_ACTOR health >= 101

then

0335: set_free_paynspray_to 1

else

Jump @HNS_2

 

 

 

:HNS_2

if and

0184: actor $PLAYER_ACTOR health >= 124

8184: not actor $PLAYER_ACTOR health >= 126

then

0335: set_free_paynspray_to 1

else

0335: set_free_paynspray_to 0

end

Jump @HNS_1

I posted the wrong code

Here is the tweaked one

 

 

{$CLEO .cs}

 

//-------------MAIN---------------

 

0000:

 

:HNS_1

wait 250

 

if and

0184: actor $PLAYER_ACTOR health >= 99

8184: not actor $PLAYER_ACTOR health >= 101

then

004D: jump if false @HNS2

0335: set_free_paynspray_to 1

end

jump @HNS_1

 

 

 

 

 

:HNS_2

if and

0184: actor $PLAYER_ACTOR health >= 124

8184: not actor $PLAYER_ACTOR health >= 126

then

0335: set_free_paynspray_to 1

else

0335: set_free_paynspray_to 0

end

Jump @HNS_1

Link to comment
Share on other sites

crashoverride93

I got it working perfectly 125 and 100

Here is the perfect script with both checks after my mind cleared it became clear.

 

 

{$CLEO .cs}

 

//-------------MAIN---------------

 

0000:

 

:HNS_1

wait 250

 

if and

0184: actor $PLAYER_ACTOR health >= 99

8184: not actor $PLAYER_ACTOR health >= 101

then

0335: set_free_paynspray_to 1

else

0335: set_free_paynspray_to 0

jump @HNS_2

else

0335: set_free_paynspray_to 0

 

end

 

jump @HNS_1

 

 

:HNS_2

if and

0184: actor $PLAYER_ACTOR health >= 124

8184: not actor $PLAYER_ACTOR health >= 126

then

0335: set_free_paynspray_to 1

else

0335: set_free_paynspray_to 0

end

jump @HNS_1

Actually I see where it looks like an error might be but it works perfect

Link to comment
Share on other sites

Why do you write so many posts in a row? Please use the edit button, unless you have something very important to write.

 

Why do you want to create separate threads? Wouldn't this be better?

:HNS_1wait 250if and0184: actor $PLAYER_ACTOR health >= 998184: not actor $PLAYER_ACTOR health >= 101then0335: set_free_paynspray_to 1else0335: set_free_paynspray_to 0endif and0184: actor $PLAYER_ACTOR health >= 1248184: not actor $PLAYER_ACTOR health >= 126then0335: set_free_paynspray_to 1else0335: set_free_paynspray_to 0endjump @HNS_1
Edited by xNCx
Link to comment
Share on other sites

crashoverride93

OK neither 100 or 125 works without the seperat threads because the code cancels each other out notice I jumped after failing and setting it two zero for the other test.

Edited by crashoverride93
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
 Share

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