The following is the index for the Pinned Coding Snippets topic with notes from the author of the snippets. In case you need a second opinion, my own (and Deji's) personal, but often useless, commentary is included when you hover over the Description.
GTASA Coding Snippets | | |
---|
Title | Description | Author |
---|
Enable Radio for All Vehicles | "Now you have radio stations enabled for all vehicles." | Deji |
---|
Edit Motion Blur | "You can increase it to increase the blur, which can be fun." | Deji |
---|
Random Coords in Area | "Randomly generate some points around [an] X and Y." | gtasearcher |
---|
CLEO Basic Starter | "Ever got tired of always re-writing the same lines for all your new CLEOs? Just copy this..." | gtasearcher |
---|
Fancy Camera Movement | "The camera will orbit around the first car you enter. Just another example on how to use (co)sine as well as how you'd perform smooth camera movement." | Deji |
---|
Mission Select Script | "Proper way to add mission select script." | Trickstar |
---|
Spike Strip Spawning | "This is code from Vigilante Justice for creating a simple stinger and storing the coords of it's width and length... to variables so you can add the part to check if the car has run over the strip and pop it's tires, etc." | Deji |
---|
Retrieving Offset According to Dimensions | "This is also a bit of code from Vigilante Justice that finds the offset of a vehicle, which is accurate no matter which vehicle it is. This code in particular creates a sphere behind the car." | Deji |
---|
Placing Objects on a Car | "See the above post for more info." | Deji |
---|
Searchlight Creation | "Creates a searchlight at a set point, permanently checks for cars/peds/player and starts following them." | gtasearcher |
---|
CLEO Keyboard | "This can be used for user-input, which results in great mods." | Deji |
---|
All Possible Actors | "By using some basic coding tricks, you can either find any actor according to specific requirements or inflict an action upon all actors." | Deji |
---|
Siggi's CLEO Starter | "Just a quick reply to the old post of gtasearcher..." | Siggi |
---|
Memory Hacking Coronas | "Use this code to look for a certain corona that you created and want to modify." | Adler |
---|
Optimized Code Starting | "Since everyone is going on about CLEO Starters and optimizing them, let me post my methods of generally saving bytes and such." | Deji |
---|
Optimized Code Starting | "Contrary to what I have stated before... Long strings always save more bytes than short strings." | Deji |
---|
Player Task Check | "For people who really want to make sure the player is not included in any task." | Siggi |
---|
Random Coords Around a Player/Car/Object | "A function I use very often for creating random coords in a special radius around the player, a car, or an object." | Siggi |
---|
Alternative CLEO Keyboard | "My version uses SA cheats pool." | Silent |
---|
HSL to RGB Convert | "Function shown below converts value of Hue, Saturation, and Lighting to RGB values, so they can be used for eg. for choosing text draw, fade or car color." | Silent |
---|
Writing Newlines to Files | "Sanny doesn't have the ability to replace a sequence of characters with the newline character... And we can't add a newline in the string because that breaks it. So, we gotta use hex..end, and I'll show you how to do it!" | Deji |
---|
Typewriter Text | "This time we will make text appear on screen sign-by-sign, like it is written on typewritter." | Silent |
---|
Repetitive Code with FOR Loop | "Do [a] certain code for a special number of actors without stretching the code." | Siggi |
---|
Additional Variables | "I originally posted this stuff in this Sanny Builder Forum topic." | Deji |
---|
Free Car Camera | "So basically, you can move the camera around in the car freely." | Deji |
---|
GetTrailerAttachedToCar | "Simple function done as request. Works as IF and SET pseudo-opcode." | Silent |
---|
Speed Testing Code | "It's a nice idea to test code for its speed." | Deji |
---|
Speed Testing Code II | "I think that would be even more accurate using GetLocalTime, but meh." | Silent |
---|
Spawn Current Cop | "This is more like an example of how the EXE is programmed to completely ignore the SCM in certain situations." | Deji |
---|
Bit Toggle | "Just a little something I was using to test the ped structure for GTAG v2." | Deji |
---|
Exponentiation Float or Integer | "As I know there is no opcode that would be raise raise number to given exponent." | fastman92 |
---|
Subtraction Money | "This function gets parameter with amount of money to subtract." | fastman92 |
---|
Shorstring to Integer | "I wanted to make keyboard where I can type number and next to use it as integer. It wasn`t simply possible, so I decided to create this function." | fastman92 |
---|
Display Ped/Car/Object IDs | "Requested by methodunderg in the GTAForums Coding Request Topic." | Adler |
---|
Decimal String to Integer | "4 days ago I posted function that converts only short string to integer. Now it`s better and allows ya to convert short or long string, whatever you want." | fastman92 |
---|
Two Integer Adding and INT Limit | "Integer can store number up to 2147483647 and -2147483647. If you have [too] many numbers and you can check if after adding will be proper result of sum." - Deji's Addendum | fastman92 |
---|
Parse an Opcode | "Confusing, eh?" | Deji |
---|
Handling of CLEO Global Variables | "I created functions that allow to simply handle CLEO global variables. | fastman92 |
---|
0771 (License Plate Town ID) | "0771 could be considered as a NOPcode, but I've found a way to get it to work..." | Deji |
---|
Get Car Component Coordinates | Retrieving world coordinates of car components | Deji |
---|
Load Path File | "This allows you to open an .rrr file in CLEO from outside the carrec.img file and use it to assign a cars path." | Deji |
---|
Count Peds in a Car | A function to count the number of peds in the passed car, including the driver. | fastman92 |
---|
create_thread For CLEO Scripts (Fixed Version) | Creates a new thread within a CLEO Script. | Deji |
---|
11 Extra Variables | "Yeah, we really can have 11 variables more in any thread without almost any tricks..." | Silent |
---|
GetTrailerAttachedCar | Gets the handle of the trailer attached to a car. | fastman92 |
---|
Recreate the Player | Very simple... but very useful to stop the users of a mod doing silly things like killing the player... Well, that's what I'll be doing with it anyway. | Deji |
---|