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

[SCM]Cleo useful functions


Shmoopy
 Share

Recommended Posts

0909e890_o.png









651c423d_o.png





  • Sets :
- Ped mass : Default value is 70.0
0AB1: set_actor @ActorMass params 2 actor $PLAYER_ACTOR mass 70.0
:ActorMasswait 0if    Actor.Defined([email protected])then0A96: [email protected] = actor [email protected] [email protected] += 1400A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0end0AB2: ret 0
- Ped air resistance : Default value is 0.0
0AB1: set_actor @ActorAirres params 2 actor $PLAYER_ACTOR air_resistance 0.0
:ActorAirreswait 0if    Actor.Defined([email protected])then0A96: [email protected] = actor [email protected] [email protected] += 1520A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0end0AB2: ret 0
  • Gets :


- Ped brightness : Returns a float value , 50.0 means that CJ is fully exposed to sunlight This was used by rockstar in the mission where CJ must steal the Lyrics , it checks whether CJ is hiding in the shadows or not .


0AB1: get_actor @ActorBrightness params 1 actor $PLAYER_ACTOR brightness $result
:ActorBrightnesswait 0if    Actor.Defined([email protected])then0A96: [email protected] = actor [email protected] [email protected] += 3000A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0end0AB2: ret 1 [email protected]


- Ped speed : Returns a float value of the acutal ped movement speed .


0AB1: get_actor @ActorSpeed params 1 actor $PLAYER_ACTOR speed $result
:ActorSpeedwait 0if    Actor.Defined([email protected])then0A96: [email protected] = actor [email protected] [email protected] += 720A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0end0AB2: ret 1 [email protected]










ebdad267_o.png































48b7e13b_o.png







Edited by Fable11
Link to comment
Share on other sites

There is no need to put wait 100 after each code instruction.

Why the result of last two functions is a number if their description says: true means. You have to use return_true and return_false opcodes instead.

And giant empty spaces in the beginning of each function confuse me. For what?

Link to comment
Share on other sites

There is no need to put wait 100 after each code instruction.

Why the result of last two functions is a number if their description says: true means. You have to use return_true and return_false opcodes instead.

And giant empty spaces in the beginning of each function confuse me. For what?

 

Yes i need to rewrite the topic

 

 

If i dont put a wait beween

 

0A96: [email protected] = actor [email protected] struct

 

and

 

0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0

 

wouldn't the game execute both opcodes instantly and therefore crash ?

Edited by Fable11
Link to comment
Share on other sites

No.

Link to comment
Share on other sites

0001 - WAIT
Sanny Builder opcodes.txt: 0001: wait 0 ms
Sanny Builder SASCM.INI: 0001=1,wait %1d% ms
Sanny Builder keyword: wait ( wait 0 )
Description: WAIT command stops processing of the current thread and lets the GTA SA to process other active SCM threads and execute different actions. The number specifies a minimum number of milliseconds of current thread inactivity. When a number of milliseconds is less or equal to zero, then current thread will be executed as soon as possible. GTA SA stops the current thread, executes other actions and comes back to process this thread again until it encounters WAIT command again.
Native name: WAIT
Opcode definition:

void wait (int time);

Parameters:
1) Passed: integer, time to wait expressed in milliseconds. 1000 ms = 1 second
Returns true or false? No.

Edited by fastman92
Link to comment
Share on other sites

1 second takes 1000 milliseconds. Your mistype. :p

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

Good to see an attempt to help the fellow modder, but try again when you have 100 or more functions and some better coding standards :p Or perhaps you intended this to be a topic where we can all post some helpful functions.. I really don't know...

Link to comment
Share on other sites

Good to see an attempt to help the fellow modder, but try again when you have 100 or more functions and some better coding standards :p Or perhaps you intended this to be a topic where we can all post some helpful functions.. I really don't know...

Like i give a sh*t about your opinion :p , i'll post whatever i want whenever i want , so stop acting like u're the best out there .

Link to comment
Share on other sites

so stop acting like u're the best out there .

Isn't that true though?

Link to comment
Share on other sites

 

Good to see an attempt to help the fellow modder, but try again when you have 100 or more functions and some better coding standards :p Or perhaps you intended this to be a topic where we can all post some helpful functions.. I really don't know...

Like i give a sh*t about your opinion :p , i'll post whatever i want whenever i want , so stop acting like u're the best out there .

 

 

I was actually trying to be supportive, but whatever. One of the most important things to learn in coding is how to take all sorts of criticism, because while it may feel harsh, it's probably true.

Link to comment
Share on other sites

Ped speed snippet looks wrong too. Besides, isn't GET_CHAR_SPEED pretty much the thing you wanted to achieve?

Link to comment
Share on other sites

 

I was actually trying to be supportive

 

 

but try again when you have 100 or more functions and some better coding standards

 

Yes indeed

Link to comment
Share on other sites

We're playing the quote game?

 

take all sorts of criticism, because while it may feel harsh, it's probably true.

Just let it go.

Edited by Deji
Link to comment
Share on other sites

aStiffSausage

Idea of this topic is good, though I kind of think it's too much in hands of one person. A topic like this, with just links in first post to posts which contain coding snippet, would keep the thread pretty organised and would help a lot when it comes to searching. And, limiting coding snippets to one per post, would allow direct linking to correct snippet.

Example of first post:

Ped mass
Ped air resistance
Car handling and offsets to different values

You probably got the idea. :p

Link to comment
Share on other sites

Isn't better to make a wiki article then, so anyone can contribute, add new functions, fix mistakes, etc?

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