UtilitiesNotes:
Here's a short list of the includes you should use for writing code more efficiently:
fixes.incSystems
Patching SA-MP bugs you find is not an easy task particularly - you can use this include to patch various SA-MP bugs that have yet to be fixed.
» Read more
Cuff Offsets
MP2 spent a while to get the offsets of the cuff objects for every skin. This is a must-use if you want to use the cuff objects - just for it all to look neat and in place when you apply the object.
» Read more
foreach
foreach replaces some* loops (normally the main player loop) with a faster, more efficient loop.
This is a much neater way to deal with groups of data you need to loop. Not just for player loops, but also for custom arrays using the iterator functions.
» Read more
SQLite Improved
The built-in SQLite is more powerful than most people realize. One issue, however, is that the native functions given are very few and low-level. This library is doing something about that!
While this library mainly has functions that facilitate development, it also brings new functionality and solves crucial bugs.
» Read more
y_ini
In short, y_ini is an include which uses the native SA-MP file functions to provide an easy-to-use set of scripting functions to process INI files. There are plenty of advantages to using this over other released includes, which are outlined in the release thread.
» Read more
y_commands
Personally, I've always preferred using zcmd over y_commands, however y_commands has an advantage - it has support for the other YSI libraries, and more functions available to save you time coding.
This library allows you to create commands efficiently and with ease - you don't have to spend ages using strtok, you can use this in combination with sscanf and save yourself plenty of time.
» Read more
sscanf
There are two (major) versions of sscanf; a version in an include and a version in a plugin. The plugin version has much greater functionality and is a lot more stable - so I'll forward you to that instead of the include.
sscanf allows you to split data from strings in to different variables by a delimiter (it can be anything, as long as it's one character).
The correct pronunciation is apparently es-scan-eff.
» Read more
svAddons
This script adds some useful functions that the SA:MP team decided to not include in the default server package. This include requires your server to be running on 0.3e.
» Read more
svCheats
This script allows you to select all of the cheats you want protection against, change the settings for the cheats, and give certain people a certain security level to bypass anticheat checks.
» Read more
y_timers
This include allows you to quickly and easily define timer functions, that is functions which are to be called after a given time. The library provides two systems: tasks, which are functions that run all the time in the background (for example streamers); and timers, which are functions you can start, stop, and call on a delay at will.
» Read more
Mainly to annoy the OP, but also a set of libraries to save you from writing a load of code for something you have already in a matter of seconds set out for you. Here's the list:y_languages and y_text
y_text is the single most complex library in YSI 3.0, but using it is (hopefully) very simple. The library works on the idea from HTML/CSS/JavaScript of separation of content, style and logic.
Whereas, y_languages is intended for scripters to be able to write multilingual modes with the aid of the include.
» Read more
y_groups
What are groups? An admin level is a group of players, a gang is a group of players, a team is a group of players, a faction is group of players - why have different code for each of these things? y_groups is an abstraction of all of these things now supported by most of the YSI libraries to allow you to define exactly who can do what.
» Read more
jBan
jBan is a simple include that will allow server owners to easily have a player banning system using a MySQL database as the storage center for the ban information. It should be compatible with just about every script out there.
» Read more
gCamera
gCamera is an include which allows you to add VERY EASILY speed cameras near highways, it will detect when a player passes it at high speed.
You can set the speed limit in kmh AND mph, and also the limit & fine PER CAMERA! It also includes an pretty awesome flash effect made with textdraws!
» Read more
Player Inventory
It's an easy to use function-adding include to implement inventory for players. It even saves and loads items.
» Read more
Cuff Offsets
MP2 spent a few hours (or days maybe?) nolifing to get the offsets of the cuff objects for every skin. This is a must-use if you want to use the cuff objects - just for it all to look neat and in place. » Read more |
I think his point is instead of scripting everything from scratch, use libraries as a 'base'.
|
*cough*
It took about half an hour to an hour using a small script to make it fast. Thanks for including it though |
I'm a bit confused as to what this topic is trying to be. Is it a tutorial on using includes? Is it an includes directory (of which there already is one in another forum), or what?
|
If I were to create a roleplay script I would split a lot of it into sections, my first would be an AC include to hook the default functions like GivePlayerMoney ect.
Then I'd also use includes for features such as Bank, fishing, ect. although I haven't thought it through on what would go into which include. Here's a rough idea #include <anticheat> #include <z_cmd> #include <colours> #include <gen_commands> #include <fishing> #include <bank> #include <police> Or I'd use includes within includes like #include <commands> and then inside commands.inc it'd be split up with <police_commands> ect. I've been using other languages and I really like having several files ~1000 lines over one big file with ~100,000 lines |
If I were to create a roleplay script I would split a lot of it into sections, my first would be an AC include to hook the default functions like GivePlayerMoney ect.
Then I'd also use includes for features such as Bank, fishing, ect. although I haven't thought it through on what would go into which include. Here's a rough idea #include <anticheat> #include <z_cmd> #include <colours> #include <gen_commands> #include <fishing> #include <bank> #include <police> Or I'd use includes within includes like #include <commands> and then inside commands.inc it'd be split up with <police_commands> ect. I've been using other languages and I really like having several files ~1000 lines over one big file with ~100,000 lines |