Setup
Installation
Follow the instructions below to run the
gusti-drawtext
script on your serverExtract file
Copy / Cut
gusti-drawtext
into your server's resources folderOpen server.cfg
Add the
gusti-drawtext
script by ensuregusti-drawtext
in server.cfgRestart server
Finished
Now you can enjoy the features of the
gusti-drawtext
script on your server
Dependency
Usage
Custom Commands
/client/custom.lua
RegisterCommand(Config.Commands.createDrawText, function()
TriggerEvent('gusti-drawtext:createDrawText')
end, false)
Custom Notification
/client/custom.lua
function ShowNotification(text, _type, time)
if _type == 'info' then
_type = 'inform'
end
lib.notify({
title = 'Draw Text',
description = text,
duration = time or 3000,
showDuration = true,
position = 'top',
type = _type -- (inform, error, success, warning)
})
end
Configuration
/config.lua
Config, Locales = {}, {}
Config.CheckForUpdates = true -- Check for update available?
Config.Locale = 'en' -- (en / id) {en = english / id = indonesia}
Config.Commands = {
createDrawText = 'drawtext', -- for create text
deleteDrawText = 'removedrawtext', -- for delete text
}
Config.DialogInput = { -- lib.inputDialog
title = "Draw Text",
options = {
{ type = 'textarea', label = 'Text', required = true, min = 4, max = 32, autosize = true },
{ type = 'color', label = 'Color', default = '#FFFFFF' },
{ type = 'slider', label = 'Font Type', min = 0, max = 8, default = 0 },
{ type = 'slider', label = 'Font Scale', min = 1, max = 100, default = 30 },
{ type = 'slider', label = 'View Distance', min = 1, max = 20, default = 1 },
{ type = 'checkbox', label = 'RGB Rainbow?' },
}
}
Config.RayCast = {
createDrawText = {
distance = 1000.0,
colorPrimary = { r = 0, g = 255, b = 0, a = 200 }, -- green
},
deleteDrawText = {
distance = 1000.0,
colorPrimary = { r = 255, g = 255, b = 255, a = 200 }, -- white
colorSecondary = { r = 255, g = 0, b = 0, a = 200 }, -- red
}
}
Config.DrawTextControl = {
createDrawText = {
confirm = 38, -- [E]
cancel = 177, -- [BACKSPACE]
},
deleteDrawText = {
confirm = 38, -- [E]
cancel = 177, -- [BACKSPACE]
}
}
-- LOCALES (DON'T TOUCH)
function _L(_id)
if Locales[Config.Locale][_id] then
return Locales[Config.Locale][_id]
else
print("Locale '".._id.."' doesn't exist")
end
end
Last updated