18.08.2012, 14:50
(
Последний раз редактировалось Rancho; 22.08.2012 в 08:23.
)
Lua in SAMP
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
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
- Timer.set(function, interval, repeat, ...)
- 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
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.