Skip to content

Releases: drakeee/samp-plugin-lua

v0.2.5 Released

22 Jul 19:40
Compare
Choose a tag to compare
  • Added "tocolor" function which provide to convert color/number from 64 bit to
    32 bit (Lua is in 64bit, PAWN is in 32bit, therefore there was some
    mix-up). Usage:
tocolor(r, g, b, a)
tocolor(r, g, b)
tocolor(hex color)

I.E.:
tocolor(255, 0, 0, 255)
tocolor(255, 0, 0)
tocolor(0xFF0000FF)

P.S.: If I have more free time I will make a wiki for this plugin.

v0.2.4 Released

21 Jul 22:51
Compare
Choose a tag to compare
  • Fixed a bug where callbacks weren't called correctly.

v0.2.3 Released

18 Jul 21:51
Compare
Choose a tag to compare
  • Fixed stack leak when using call.
  • Fixed call function: arguments starts at index 1 and not 3
  • Fixed prescript when using "export" will not call function correctly if no argument passed.
  • Accepted "export" calls:
export['resourcename'].someFunctionName([arguments ...])
export['resourcename']:someFunctionName([arguments ...])
export['resourcename']['someFunctionName']([arguments ...])
export.resourcename.someFunctionName([arguments ...])
export.resourcename:someFunctionName([arguments ...])
export.resourcename['someFunctionName']([arguments ...])

local resource = export['resourcename']
resource.someFunctionName([arguments ...])
resource:someFunctionName([arguments ...])
resource['someFunctionName']([arguments ...])

v0.2.2 Released

10 Jul 21:19
Compare
Choose a tag to compare
  • I think that tests was successfull and the plugin no longer in Alpha state.
  • Resources can be loaded from server.cfg with the following setting: luascripts resourcename
  • Inside the resource Lua files now load into the same virtual machine and therefore functions are shared within the same resource.
  • Lua virtual machines were not perfectly stopped.
  • Fixed the timer.
  • New object manager implemented.
  • Resources now need to be in the following folder: "lua/resources/".
  • Added makefile therefore it can be compile in Linux (usage: make LUASAMP). I didn't tested under Linux so there can be some issues/crashes with it.
  • Fixed various crashes with timer when resource is being stopped.
  • Some junk codes removed.
  • New functions added to the argument reader.
  • Added Lua stack debug function.

Added "call" function that allows to call a function from other resource (given resource need to running). i.e.:

  • call("resourcename", "functioname", [arguments...])

If you don't like the previous method you can call function with the "export" global variable (it is similar to MTA "exports" global variable). i.e.:

  • export["resourcename"].testFunction("some string", 10, 20.0, true)
  • export["resourcename"]:testFunction("some string", 10, 20.0, true)
  • export["resourcename"]["testFunction"]("some string", 10, 20.0, true)
  • Added "isResourceRunning" function that allows to check if a given resource is running or not.
  • Now you can load modules too that allows to implement several Lua function. Modules can be loaded from server.cfg with the following setting: luamodules modulename.dll
  • Added Modul SDK which helps to make module (MTA mysql module imported for example).

Lua in SA-MP v0.1.2 (Alpha)

03 Jul 17:18
Compare
Choose a tag to compare
  • setTimer, killTimer function added.
  • New arguments reader added.
  • Fixed various issues with using function reader.

Lua in SA-MP v0.1 (Alpha)

01 Jul 20:50
Compare
Choose a tag to compare
Adding SA-MP macros