[Plugin] Lua in SAMP (alpha)
#1


Lua in SAMP
Introduction

This plugin, as the name suggests, makes possible the use of Lua in SA:MP Servers, which is known by its easy syntax and the various possibilities to do incredible things on it.

So, how can i create plugin for lua? It's easy to do.Download "l_base" Plugin Development Kit.And write your own plugin:
Pre-coming plugins: ml_mysql 5.0 <transported from MTA-MYSQL> (Not pre-comes on Linux)


Kalcor and I do not recommend the use of this plugin for public servers, this is just an experiment.

Requirements
  • Microsoft Windows 9x/NT 5.0+, Linux
  • SA:MP Server 0.3e
Speed

In strings 5x faster, In booleans 22x faster than pawn.

Changes from Pawn
  • We currently include SA-MP Constants.
  • We have added two event: onLoad, onUnload
  • The SetTimerEx function was removed and in its place we've added only SetTimer with optional parameters at the end:
      • Timer.set(function, interval, repeat, ...)
        • Remember that the "function" parameter isn't a string
        • You don't have to use the parameters string list anymore
        • Auto start
      • Timer.create(function, interval, repeat, ...)
        • Remember that the "function" parameter isn't a string
        • You don't have to use the parameters string list anymore
        • Create but pause
      • Timer : start()
        • Start the timer (Timer.set auto call this)
      • Timer : stop()
        • Stop timer, stop thread reset repeated count
      • Timer : pause()
        • Pause thread, pause timer, store repeat count
      • Timer : isPaused()
        • Is paused
      • Timer : isStopped()
        • Is stopped
    • Functions with referenced string parameters in Pawn have been changed to return a string, they are:
    • GetPlayerName
    • GetWeaponName
    • GetPlayerIp
    • etc...
    • Functions with referenced float parameters in Pawn have been changed in Lua, they are:
      • GetVehicleRotationQuat: returns w,x,y,z ( Lua allows multiple return )
      • All these functions return a float value:
        • GetPlayerFacingAngle
        • GetVehicleZAngle
        • GetVehicleHealth
        • GetPlayerHealth
        • GetPlayerArmour
      • All these functions return a x,y,z
        • GetPlayerPos
        • GetVehiclePos
        • GetObjectPos
        • GetObjectRot
        • GetPlayerObjectPos
        • GetPlayerObjectRot
        • GetPlayerVelocity
        • GetVehicleVelocity
        • GetPlayerCameraPos
        • GetPlayerCameraFrontVector
        • GetPlayerCameraUpVector
  • Added the RCON/console commands: start, stop and restart,
    loadplugin, unloadplugin, reloadplugin
Setting up
In README.txt (Open with Notepad++)

This project is now private for some reasons.I can put it when it come fully.(may be)


I will add LUA lessons to Tutorials category.
Reply


Messages In This Thread
Lua in SAMP (alpha) - by Rancho - 18.08.2012, 14:50
Re: Lua in SAMP (alpha) - by xSiiLenTx - 18.08.2012, 14:53
Re: Lua in SAMP (alpha) - by ipsBruno - 18.08.2012, 15:03
Re: Lua in SAMP (alpha) - by RanSEE - 18.08.2012, 15:07
Re: Lua in SAMP (alpha) - by davve95 - 18.08.2012, 15:20
Re: Lua in SAMP (alpha) - by MegadreamsBE - 18.08.2012, 16:11
Re: Lua in SAMP (alpha) - by [DOG]irinel1996 - 18.08.2012, 16:31
Re: Lua in SAMP (alpha) - by MegadreamsBE - 18.08.2012, 16:41
Re: Lua in SAMP (alpha) - by Rancho - 18.08.2012, 16:41
Re: Lua in SAMP (alpha) - by MegadreamsBE - 18.08.2012, 16:55
Re: Lua in SAMP (alpha) - by Baboon - 18.08.2012, 17:06
Re: Lua in SAMP (alpha) - by MegadreamsBE - 18.08.2012, 17:08
Re: Lua in SAMP (alpha) - by Rancho - 18.08.2012, 19:08
Re: Lua in SAMP (alpha) - by Rancho - 18.08.2012, 19:18
Re: Lua in SAMP (alpha) - by Arca - 18.08.2012, 19:19
Re: Lua in SAMP (alpha) - by TheArcher - 18.08.2012, 19:27
Re: Lua in SAMP (alpha) - by Arca - 18.08.2012, 19:47
Re: Lua in SAMP (alpha) - by Rancho - 18.08.2012, 19:52
Re: Lua in SAMP (alpha) - by Arca - 18.08.2012, 19:53
Re: Lua in SAMP (alpha) - by Rancho - 18.08.2012, 19:58
Re: Lua in SAMP (alpha) - by Rancho - 19.08.2012, 12:53
Re: Lua in SAMP (alpha) - by Rancho - 20.08.2012, 09:57
Re: Lua in SAMP (alpha) - by Optimus_Sprite - 20.08.2012, 11:08
Re: Lua in SAMP (alpha) - by Rancho - 20.08.2012, 11:19
Re: Lua in SAMP (alpha) - by Arca - 20.08.2012, 19:44
Re: Lua in SAMP (alpha) - by Rancho - 21.08.2012, 07:13
Re: Lua in SAMP (alpha) - by Toni - 21.08.2012, 07:26
Re: Lua in SAMP (alpha) - by Rancho - 21.08.2012, 11:23
Respuesta: Lua in SAMP (alpha) - by Rancho - 21.08.2012, 13:19
Re: Lua in SAMP (alpha) - by Arca - 22.08.2012, 19:16

Forum Jump:


Users browsing this thread: 3 Guest(s)