samp.directory
← Skripte und Bibliotheken

imshooter/SSI

Pawn libraries for open.mp in the style of YSI

Bibliothek★ 2aktualisiert vor 14 StundenMITPawnsampctl
Auf GitHub öffnen

Mit sampctl installieren

sampctl package install imshooter/SSI

Führe das in deinem Projektordner aus. sampctl lädt das Paket und alles herunter, wovon es abhängt.

Im Pawn-Compiler ausprobieren →

Fügt seine Include-Dateien samt der Bibliotheken, von denen es abhängt, dem Pawn-Compiler in deinem Browser hinzu, bereit zum Einbinden in ein Skript.

Hängt von 2 Paketen ab

README.md

SSI

[!NOTE] Experimental version, already running in production. Made with Claude Opus 5.5.

SSI is a set of Pawn libraries for open.mp, built the way YSI is: collections, iterators, hooks, inline functions, commands, groups and more. Each library is one include that works on its own, and the libraries talk to each other through events, so one can answer another without depending on it.

Installation

Simply install to your project:

sampctl package install imshooter/SSI

Or copy the SSI, SSI_Extra, SSI_Player, SSI_Vehicle and SSI_World folders into the include folder of your compiler, such as qawno/include.

Include in your code and begin using the library:

#include <SSI\collection>

A file that declares hooks includes SSI\hooks after every other include. See Installation for the requirements of each library.

Libraries

SSI

LibraryDescription
amxAccess to the memory of the script beyond its data, for the libraries that read or write code at run time: the code as the server relocated it, and the header with its table of publics.
bitsSets of bits, as y_bit keeps them: one bit for each id up to a size, 32 to a cell.
collectionCollections: the structures of these libraries under one name, as y_iterate keeps every iterator under Iterator:.
commandCommands, as Pawn.CMD and y_commands keep them: a function for each command, found by its name when a player types it.
dictionaryDictionaries hold a value for each key.
extraExtra data: values kept on the ids of something else, with a row of cells for each id and a column for each name.
groupGroups of players, as y_groups keeps them: a name, its members and what they may do.
hooksHooks, as in y_hooks: any number of functions for one callback, and hooks that replace a native or a function.
inlineInline functions: a function written inside another, that reads and changes the arguments of the outer function and the locals it had where the inline is written, and can be called after the outer function returned, as by a timer.
iteratorThe ids the server hands out, in collections this script walks with foreach, as y_foreach keeps its iterators.
queueQueues hand out the rows of an array and take them back first in, first out.
scheduleSchedules hold a time for each id.
stringStrings changed in place and compared, beyond the natives of open.mp.
taskFunctions that run on their own every so many milliseconds, as the tasks of y_timers.
testTests, as in y_testing: functions declared with test that the script runs one after another when it starts, with checks that print what failed and where.
uniqueUnique names: every #include <SSI\unique> moves on to a new suffix of two characters, and SSI_UNIQUE<prefix...suffix> writes the current one where the ... is.
vaVariable arguments: ___(n) passes on the arguments a function got, from its nth on, anywhere among the arguments of a call, as y_va's ___.
versionThe version shared by the SSI libraries and their startup banner.

SSI_Extra

LibraryDescription
inline-argon2Hashing and checking passwords with Argon2id through the async_crypto plugin, answered by an inline.
inline-bcryptHashing and checking passwords with bcrypt, answered by an inline.
inline-dialogDialogs answered by an inline.
inline-mysqlQueries of the mysql component answered by an inline.
inline-objectDynamic objects that call an inline when they finish moving, while a player edits them, or when a player selects one.
inline-pgQueries of the omp-postgresql component answered by an inline, with every value sent apart from the query, so nothing is ever escaped.
inline-timersTimers that call an inline.

SSI_Player

LibraryDescription
animation-preloadAnimation libraries loaded ahead.
fpsFrames per second of each player's game.

SSI_Vehicle

LibraryDescription
colourThe 128 paint colours of the game, from carcols.dat, as RGBA for drawing a swatch of them.
componentsThe tuning parts of the game: their type, name, price, shop and pair, and which vehicle models take each one.
forkliftCrates a forklift lifts, carries and stacks.
freightFreight that rides in the back of a vehicle, each piece in a slot of a grid set for that vehicle.
mathThe geometry of a vehicle in the world: its speed, whether it lies on its roof, and where a point of its body, its bonnet, boot or a wheel is as it leans and turns.
modelName, category and flags of every vehicle model, read by model id.
neonNeon under a vehicle: two tubes of a colour along its sides, or one down the middle of a model narrower than VEHICLE_NEON_NARROW, such as a motorbike.
objectiveMarks the vehicle a player was sent to with the yellow arrow and a radar blip.
partsThe parts of a vehicle one at a time: some parameters, a door, window, tyre, lamp or panel is set while the others keep what the game has.
speed-cameraSpeed cameras: a pole by the road and a sphere of streamer area around it.

SSI_World

LibraryDescription
map-fileLoads a map file kept in scriptfiles, so a map is changed without touching the gamemode.
zoneThe named zones of the map of San Andreas, the ones the story mode writes at the corner of the screen.

Documentation

The wiki has a page for each library, with a quick start and every function, macro and event it declares. Each folder also has a .md file next to each include that links to its page.

Testing

The tests folder holds a game mode for each library that has tests, written with SSI\test. Compile one with the root of this repository and the open.mp includes in the include path, then run it on a server that allows at least one bot and loads the plugins the library needs:

pawncc tests/bits.pwn -i. -i<open.mp includes>

The test prints every failed check and a summary, then closes the server.

License

SSI is released under the MIT License, apart from SSI_Vehicle\model. Its model data comes from y_vehicledata of YSI, so that file stays under the Mozilla Public License 1.1, with the notice of YSI at its top.

Thanks to

  • @Y-Less for YSI, the model for the layout of this repository and for many of its interfaces, and for the vehicle data of y_vehicledata.
  • @IllidanS4 for PawnPlus, which SSI\iterator uses to follow vehicles and actors.
  • @Southclaws for samp-object-loader, the idea SSI_World\map-file follows.

Diese Seite wird aus dem erstellt, was GitHub über das Repository veröffentlicht. samp.directory hostet den Code nicht. Ein Problem mit diesem Eintrag melden

imshooter/SSI: SA-MP Bibliothek | samp.directory