mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2026-02-16 02:20:52 +00:00
Lua example
This commit is contained in:
27
docs/ru/plugins/lua/example.lua
Normal file
27
docs/ru/plugins/lua/example.lua
Normal file
@@ -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