Quantcast

Jump to content

» «
Photo

[SCM]Cleo useful functions

14 replies to this topic
Shmoopy
  • Shmoopy

    Thug (͡ ͜ʖ ͡)

  • Members
  • Joined: 16 Jun 2009
  • None

#1

Posted 08 October 2013 - 04:20 PM Edited by Fable11, 10 October 2013 - 11:35 AM.

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
:ActorMass
wait 0
if
    Actor.Defined(0@)
then
0A96: 2@ = actor 0@ struct
2@ += 140
0A8C: write_memory 2@ size 4 value 1@ virtual_protect 0
end
0AB2: ret 0
                   - Ped air resistance : Default value is 0.0                        

0AB1: set_actor @ActorAirres params 2 actor $PLAYER_ACTOR air_resistance 0.0

:ActorAirres
wait 0
if
    Actor.Defined(0@)
then
0A96: 2@ = actor 0@ struct
2@ += 152
0A8C: write_memory 2@ size 4 value 1@ virtual_protect 0
end
0AB2: 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

:ActorBrightness
wait 0
if
    Actor.Defined(0@)
then
0A96: 1@ = actor 0@ struct
1@ += 300
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0
end
0AB2: ret 1 2@


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


0AB1: get_actor @ActorSpeed params 1 actor $PLAYER_ACTOR speed $result

:ActorSpeed
wait 0
if
    Actor.Defined(0@)
then
0A96: 1@ = actor 0@ struct
1@ += 72
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0
end
0AB2: ret 1 2@








 


ebdad267_o.png


 

























 


48b7e13b_o.png

 





Seemann
  • Seemann

    Ruhe

  • Members
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2013 "Sanny Builder"

#2

Posted 09 October 2013 - 03:11 PM

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?


Shmoopy
  • Shmoopy

    Thug (͡ ͜ʖ ͡)

  • Members
  • Joined: 16 Jun 2009
  • None

#3

Posted 09 October 2013 - 05:18 PM Edited by Fable11, 09 October 2013 - 05:24 PM.

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: 1@ = actor 0@ struct

 

and

 

0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0

 

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


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

#4

Posted 09 October 2013 - 05:33 PM

No.

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#5

Posted 09 October 2013 - 05:41 PM Edited by fastman92, 09 October 2013 - 06:13 PM.

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.


Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci Racing
  • Joined: 19 Aug 2006
  • Unknown

#6

Posted 09 October 2013 - 06:13 PM

1 second takes 1000 milliseconds. Your mistype. :p


Deji
  • Deji

    Coding like a Rockstar!

  • Feroci Racing
  • Joined: 24 Dec 2007
  • None

#7

Posted 10 October 2013 - 03:36 PM

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


Shmoopy
  • Shmoopy

    Thug (͡ ͜ʖ ͡)

  • Members
  • Joined: 16 Jun 2009
  • None

#8

Posted 10 October 2013 - 03:50 PM

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 .

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

#9

Posted 10 October 2013 - 03:53 PM

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


Isn't that true though?

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci Racing
  • Joined: 24 Dec 2007
  • None

#10

Posted 10 October 2013 - 03:57 PM

 

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.

  • Silent likes this

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

#11

Posted 10 October 2013 - 04:06 PM

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

Shmoopy
  • Shmoopy

    Thug (͡ ͜ʖ ͡)

  • Members
  • Joined: 16 Jun 2009
  • None

#12

Posted 10 October 2013 - 04:14 PM

 

I was actually trying to be supportive

 

 

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

 

Yes indeed


Deji
  • Deji

    Coding like a Rockstar!

  • Feroci Racing
  • Joined: 24 Dec 2007
  • None

#13

Posted 10 October 2013 - 04:24 PM Edited by Deji, 10 October 2013 - 04:24 PM.

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.

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#14

Posted 11 October 2013 - 06:08 PM

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


Seemann
  • Seemann

    Ruhe

  • Members
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2013 "Sanny Builder"

#15

Posted 13 October 2013 - 10:33 AM

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

  • TheGodfather. likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users