{"id":15120052,"url":"https://github.com/IS4Code/YALP","last_synced_at":"2025-09-28T04:30:30.014Z","repository":{"id":144158954,"uuid":"144915322","full_name":"IS4Code/YALP","owner":"IS4Code","description":"Yet Another Lua Plugin for SA-MP","archived":false,"fork":false,"pushed_at":"2024-06-28T16:25:30.000Z","size":441,"stargazers_count":16,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-27T02:08:31.410Z","etag":null,"topics":["lua","pawn-package","sa-mp"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IS4Code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-16T00:08:04.000Z","updated_at":"2024-08-11T18:46:50.000Z","dependencies_parsed_at":"2023-04-11T20:45:17.320Z","dependency_job_id":null,"html_url":"https://github.com/IS4Code/YALP","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IS4Code%2FYALP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IS4Code%2FYALP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IS4Code%2FYALP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IS4Code%2FYALP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IS4Code","download_url":"https://codeload.github.com/IS4Code/YALP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234485017,"owners_count":18840727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","pawn-package","sa-mp"],"created_at":"2024-09-26T02:00:36.434Z","updated_at":"2025-09-28T04:30:24.664Z","avatar_url":"https://github.com/IS4Code.png","language":"C++","readme":"YALP v1.1\r\n==========\r\n\r\n_YALP_, short for _Yet Another Lua Plugin_, aims to be a simple yet extendable SA-MP plugin allowing to use [Lua](https://www.lua.org/) for SA-MP server programming.\r\n\r\nCompared to older Lua plugins, _YALP_ doesn't export any of the SA-MP natives or callbacks directly. Instead, it exposes a set of functions to interact with the server via a virtual filterscript, mimicking calls to AMX functions. The actual server API can be ported entirely with Lua, which removes the need to update the plugin for new versions of SA-MP and maintain all functions, and also allows the use of other plugins.\r\n\r\n## Installation\r\nDownload the latest [release](//github.com/IllidanS4/YALP/releases/latest) for your platform to the \"plugins\" directory and add \"YALP\" (or \"YALP.so\" on Linux) to the `plugins` line in server.cfg.\r\n\r\nInclude [YALP.inc](pawno/include/YALP.inc) to create and control Lua machines on-the-fly.\r\n\r\n## Building\r\nUse Visual Studio to build the project on Windows, or `make` on Linux.\r\n\r\n## Example\r\n```lua\r\nlocal interop = require \"interop\"\r\nlocal native = interop.native\r\n\r\nlocal commands = {}\r\n\r\nfunction commands.lua(playerid, params)\r\n  -- no need to import native functions, simply call them! \r\n  native.SendClientMessage(playerid, -1, \"Hello from Lua!\")\r\n  return true\r\nend\r\n\r\nfunction commands.setpos(playerid, params)\r\n  -- even a function from any plugin can be used\r\n  local fail, x, y, z = interop.vacall(native.sscanf, interop.asboolean, params, \"fff\")(0.0, 0.0, 0.0)\r\n  -- return values can be easily specified\r\n  if fail then\r\n    return native.SendClientMessage(playerid, -1, \"Wrong arguments!\")\r\n  end\r\n  native.SetPlayerPos(playerid, x, y, z)\r\n  return true\r\nend\r\n\r\nfunction interop.public.OnPlayerCommandText(playerid, cmdtext)\r\n  -- properly convert values to Lua (YALP cannot determine their types)\r\n  playerid = interop.asinteger(playerid)\r\n  cmdtext = interop.asstring(cmdtext)\r\n  \r\n  -- take advantage of everything Lua has to offer\r\n  local ret\r\n  cmdtext:gsub(\"^/([^ ]+) ?(.*)$\", function(cmd, params)\r\n    local handler = commands[string.lower(cmd)]\r\n    if handler then\r\n      ret = handler(playerid, params)\r\n    end\r\n  end)\r\n  return ret\r\nend\r\n```\r\n\r\n## Credits\r\n* [Zeex](//github.com/Zeex) for creating [subhook](//github.com/Zeex/subhook), the backbone of this plugin.\r\n* The creators of Lua.","funding_links":[],"categories":["Lua"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIS4Code%2FYALP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIS4Code%2FYALP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIS4Code%2FYALP/lists"}