mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2026-06-18 22:51:03 +00:00
Lua example
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
print("example.lua")
|
||||||
|
|
||||||
|
--CreateTimer Testing
|
||||||
|
local mytimer = MP.CreateTimer()
|
||||||
|
--.--.--.--.--.--.--.
|
||||||
|
|
||||||
|
--GetOSName Testing
|
||||||
|
print("OS Name: "..MP.GetOSName())
|
||||||
|
--.--.--.--.--.--.-
|
||||||
|
|
||||||
|
--GetServerVersion Testing
|
||||||
|
local major, minor, patch = MP.GetServerVersion()
|
||||||
|
print("Server Version: "..major.."."..minor.."."..patch)
|
||||||
|
--.--.--.--.--.--.--.--.--
|
||||||
|
|
||||||
|
--Events Testing--
|
||||||
|
function handleChat(player_id, player_name, message)
|
||||||
|
print("Lua handleChat:", player_id, player_name, message, "; Uptime: "..mytimer:GetCurrent())
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
MP.RegisterEvent("onChatMessage", "handleChat")
|
||||||
|
--.--.--.--.--.--.
|
||||||
|
|
||||||
|
function onInit()
|
||||||
|
print("Initializing ready!")
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user