All Projects → THE-FYP → SAMP.Lua

THE-FYP / SAMP.Lua

Licence: MIT License
A SA-MP API library for MoonLoader

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to SAMP.Lua

samp-node-lib
NodeJS library for Scripting San Andreas Multiplayer:SAMP depends on samp-node plugin
Stars: ✭ 23 (-42.5%)
Mutual labels:  gta-sa, samp
gta-samp-mouse-only
Play GTA San Andreas Multiplayer with mouse only and no keyboard
Stars: ✭ 22 (-45%)
Mutual labels:  gta-sa, samp
samp-foreach
foreach standalone include (non y_iterate version)
Stars: ✭ 20 (-50%)
Mutual labels:  samp
samp-ptl
SA:MP Plugin Template Library (C++17)
Stars: ✭ 16 (-60%)
Mutual labels:  samp
PacPaw
Pawn package manager for SA-MP
Stars: ✭ 14 (-65%)
Mutual labels:  samp
eSelection
Dynamic model selection library for SA-MP servers
Stars: ✭ 28 (-30%)
Mutual labels:  samp
protection
Flexible server protection system (development)
Stars: ✭ 23 (-42.5%)
Mutual labels:  samp
samp-plugin-timerfix
High accuracy timing events for SA-MP servers.
Stars: ✭ 18 (-55%)
Mutual labels:  samp
SS-Gang-System-SQLITE
SS Gang System for SA-MP
Stars: ✭ 23 (-42.5%)
Mutual labels:  samp
gtasa-discord-plugin
Discord Rich Presence plugin for GTA:SA
Stars: ✭ 32 (-20%)
Mutual labels:  gta-sa
VehFuncs
New vehicle features for GTA San Andreas mods
Stars: ✭ 30 (-25%)
Mutual labels:  gta-sa
GWRP-0.3
Игровой режим для San Andreas Multiplayer
Stars: ✭ 22 (-45%)
Mutual labels:  samp
rustext
Fix Russian text plugin for SA-MP: GameText's, TextDraw's and Menu's
Stars: ✭ 15 (-62.5%)
Mutual labels:  samp
gtasa-savegame-editor
GUI tool to edit GTA San Andreas savegames.
Stars: ✭ 56 (+40%)
Mutual labels:  gta-sa
Pawn.Regex
🔎 Plugin that adds support for regular expressions in Pawn
Stars: ✭ 34 (-15%)
Mutual labels:  samp
v2saconv
GTAV > GTASA resource converter. Converts YTD/YDR/YDD/YFT resources to DFF/TXD and generates COL files.
Stars: ✭ 68 (+70%)
Mutual labels:  gta-sa
code-parse.inc
Pre-processor macros for analysing PAWN functions.
Stars: ✭ 23 (-42.5%)
Mutual labels:  samp
Open-GTO
RPG gamemode for SA-MP
Stars: ✭ 45 (+12.5%)
Mutual labels:  samp
Pawn.CMD
🚀 Plugin-powered command processor for SA:MP server
Stars: ✭ 80 (+100%)
Mutual labels:  samp
sampvoice
Software Development Kit for implementing Pawn voice systems for SA:MP servers.
Stars: ✭ 79 (+97.5%)
Mutual labels:  samp

SAMP.Lua

SAMP.Lua is a lua library for MoonLoader that adds some features to make SA:MP modding simpler.

Currently this library is work in progress. At this moment the only implemented module is SAMP.Events.

Installation

Copy the entire folder samp into the moonloader/lib/ directory.

SAMP.Events

Gives ability to handle SA:MP incoming and outcoming low-level network packets by very easy way.

Usage

local sampev = require 'samp.events'

-- intercept outgoing chat messages
function sampev.onSendChat(msg)
  print('You said: ' .. msg)
end

You can rewrite data. Just return all arguments in the right order within a table.

function sampev.onSendChat(msg)
  return {'I said: ' .. msg}
end

You can also interrupt processing any packets by returning false.

function sampev.onSetPlayerPos(position)
  -- prevent server from changing player's position
  return false
end
Adding your own packet handler
local sampev = require 'samp.events'
local raknet = require 'samp.raknet'
sampev.INTERFACE.INCOMING_RPCS[raknet.RPC.PLAYSOUND] = {'onPlaySound', {soundId = 'int32'}, {coordinates = 'vector3d'}}

function sampev.onPlaySound(sound, coords)
  -- add log message
  print(string.format('Sound %d at coords %0.2f, %0.2f, %0.2f', sound, coords.x, coords.y, coords.z))
  -- and mute sound
  return false
end

The same way you can add your own types for more complex packet structures. See source code for more information and examples.

Links

MoonLoader: http://blast.hk/moonloader/
Official thread at BlastHack: http://blast.hk/threads/14624/

Credits

FYP, MISTER_GONWIK and contributors.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].