initial commit

master
rubin 2 years ago
commit 3c3b610b86
  1. 465
      drugs-mats.lua

@ -0,0 +1,465 @@
script_name('Drugs-Mats')
script_author("Serhiy_Rubin")
local sampev, vkeys, inicfg = require 'lib.samp.events', require 'lib.vkeys', require 'inicfg'
local check_inventory, drugs_timer, not_drugs_timer, renderText, d = 1, 0, false, {}, {}
local sleep = 0
local check_get_mats = true
local check_boostinfo = 0
local bonus_drugs = 1
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
local result, PlayerId = sampGetPlayerIdByCharHandle(PLAYER_PED)
my_name = sampGetPlayerNickname(PlayerId)
local ip, port = sampGetCurrentServerAddress( )
inikeys = string.format('%s %s-%s', my_name, ip:gsub('%.', '-'), port)
posX, posY = convertGameScreenCoordsToWindowScreenCoords(88.081993103027, 322.58331298828)
ini = inicfg.load({
render = {
font = 'Segoe UI',
size = 10,
flag = 13,
align = 2,
x = posX,
y = posY,
height = 4
},
global = {
cmd = 'us',
key = 'VK_U'
},
[inikeys] = {
hp = 160,
hp_one_gram = 10,
max_use_gram = 15,
seconds = 60,
run = true,
drugs = 0,
mats = 0,
server_cmd = 'usedrugs',
inventory = true,
boostinfo = true
},
lines = {
one = '{1a9614}drugs !a!n{dedede}mats !m',
two = '{e81526}cooldown !s!n{dedede}mats !m'
}
})
inicfg.save(ini)
font = renderCreateFont(ini.render.font, ini.render.size, ini.render.flag)
text_to_table()
while true do
wait(0)
GetMats()
doDialog()
if ini[inikeys].run and not sampIsScoreboardOpen() and sampIsChatVisible() and not isKeyDown(116) and not isKeyDown(121) then
second_timer = os.difftime(os.time(), drugs_timer)
render_table = ( (second_timer <= ini[inikeys].seconds * bonus_drugs and second_timer > 0) and renderText[4] or renderText[3] )
local Y, Height = ini.render.y, (renderGetFontDrawHeight(font) - (renderGetFontDrawHeight(font) / ini.render.height) )
for i = 1, #render_table do
if render_table[i] ~= nil then
string_gsub = render_table[i]:gsub("!a", ini[inikeys].drugs)
string_gsub = string_gsub:gsub("!s", tostring(math.ceil(ini[inikeys].seconds * bonus_drugs - second_timer)))
string_gsub = string_gsub:gsub("!m", tostring(ini[inikeys].mats))
if ini.render.align == 1 then X = ini.render.x end
if ini.render.align == 2 then X = ini.render.x - (renderGetFontDrawTextLength(font, string_gsub) / 2) end
if ini.render.align == 3 then X = ini.render.x - renderGetFontDrawTextLength(font, string_gsub) end
renderFontDrawText(font, string_gsub, X, Y, 0xFFFFFFFF)
Y = Y + Height
end
end
if isKeyJustPressed(vkeys[ini.global.key]) and not sampIsDialogActive() and not sampIsChatInputActive() and not sampIsCursorActive() then
local text = string.format("math.ceil(((%d + 1) - %d) / %d)", ini[inikeys].hp, getCharHealth(playerPed), ini[inikeys].hp_one_gram)
sampAddChatMessage(text,-1)
local gramm = math.ceil(((ini[inikeys].hp + 1) - getCharHealth(playerPed)) / ini[inikeys].hp_one_gram)
local text = string.format("if %s > %s then %s = %s end", gramm, ini[inikeys].max_use_gram, gramm, ini[inikeys].max_use_gram)
sampAddChatMessage(text,-1)
if gramm > ini[inikeys].max_use_gram then gramm = ini[inikeys].max_use_gram end
local text = string.format("if %s <= %s and %s > 0 then gramm = 1 end", second_timer, math.floor(ini[inikeys].seconds * bonus_drugs), gramm, second_timer)
sampAddChatMessage(text,-1)
if second_timer <= math.floor(ini[inikeys].seconds * bonus_drugs) and second_timer > 0 then gramm = 1 end
sampSendChat(string.format('/%s %d', ini[inikeys].server_cmd, gramm))
sampAddChatMessage(gramm,-1)
end
if pos then
sampSetCursorMode(3)
curX, curY = getCursorPos()
ini.render.x = curX
ini.render.y = curY
if isKeyJustPressed(1) then
sampSetCursorMode(0)
pos = false
inicfg.save(ini)
end
end
end
end
end
function text_to_table()
renderText[3] = {}
renderText[4] = {}
for str in string.gmatch(ini.lines.one:gsub("!n", "\n"), '[^\n]+') do
renderText[3][#renderText[3] + 1] = str
end
for str in string.gmatch(ini.lines.two:gsub("!n", "\n"), '[^\n]+') do
renderText[4][#renderText[4] + 1] = str
end
end
function ShowDialog(int, dtext, dinput, string_or_number, ini1, ini2)
d[1], d[2], d[3], d[4], d[5], d[6] = int, dtext, dinput, string_or_number, ini1, ini2
if int == 1 then
dialogLine, dialogTextToList = {}, {}
dialogLine[#dialogLine + 1] = '{59fc30} > Íàñòðîéêè äëÿ àêêàóíòà\t{FFFFFF}'..my_name
dialogLine[#dialogLine + 1] = ' Ñêðèïò\t'..(ini[inikeys].run and "{59fc30}ON" or "{ff0000}OFF")
dialogLine[#dialogLine + 1] = ' Ïðîâåðêà èíâåíòàðÿ [SRP/ERP]\t'..(ini[inikeys].inventory and "{59fc30}ON" or "{ff0000}OFF")
dialogLine[#dialogLine + 1] = ' Ïðîâåðêà /boostinfo [SRP]\t'..(ini[inikeys].boostinfo and "{59fc30}ON" or "{ff0000}OFF")
if ini[inikeys].run then
dialogLine[#dialogLine + 1] = ' Ñìåíèòü ïîçèöèþ\t'
end
dialogLine[#dialogLine + 1] = ' Ñåðâåðíàÿ êîìàíäà ïðèíÿòü íàðêî\t'..ini[inikeys].server_cmd
dialogTextToList[#dialogLine] = "{FFFFFF}Ââåäèòå êîìàíäó êîòîðàÿ èñïîëüçóåòñÿ äëÿ ïðèíÿòèÿ íàðêîòèêîâ íà âàøåì ñåðâåðå!"
dialogLine[#dialogLine + 1] = ' Ñåêóíä äî ñëåäóþùåãî ïðèíÿòèÿ íàðêî\t'..ini[inikeys].seconds
dialogTextToList[#dialogLine] = "{FFFFFF}Ââåäèòå ÷åðåç ñêîëüêî ìîæíî ïðèíÿòü íàðêîòèê íà âàøåì ñåðâåðå!"
dialogLine[#dialogLine + 1] = ' Ìàêñèìàëüíîå HP\t'..ini[inikeys].hp
dialogTextToList[#dialogLine] = "{FFFFFF}Ââåäèòå âàøå ìàêñèìàëüíîå HP!"
dialogLine[#dialogLine + 1] = ' Ìàêñèìóì ãðàìì ìîæíî èñïîëüçîâàòü\t'..ini[inikeys].max_use_gram
dialogTextToList[#dialogLine] = "{FFFFFF}Ââåäèòå ñêîëüêî ìàêñèìóì ãðàìì íàðêîòèêîâ ìîæíî èñïîëüçîâàòü çà ðàç!"
dialogLine[#dialogLine + 1] = ' HP äàåò 1 ãðàìì íàðêîòèêîâ\t'..ini[inikeys].hp_one_gram
dialogTextToList[#dialogLine] = "{FFFFFF}Ââåäèòå ñêîëüêî HP äàåò 1 ãðàìì íàðêîòèêîâ!"
dialogLine[#dialogLine + 1] = '{59fc30} > Îáùèå íàñòðîéêè\t'
dialogLine[#dialogLine + 1] = ' Êíîïêà äëÿ èñïîëüçâàíèÿ íàðêî\t'..ini.global.key:gsub("VK_", '')
dialogLine[#dialogLine + 1] = ' Ñîêðàùåííàÿ êîìàíäà\t'..ini.global.cmd
dialogTextToList[#dialogLine] = "{FFFFFF}Ââåäèòå ñîêðàùåííóþ êîìàíäó äëÿ ïðèíÿòèÿ íàðêîòèêîâ!"
dialogLine[#dialogLine + 1] = ' Òåêñò êîãäà òàéìåð ñòîèò\t'..ini.lines.one
dialogTextToList[#dialogLine] = "{FFFFFF}Ââåäèòå òåêñò òàéìåðà êîãäà îí îòêëþ÷åí.\n\tÌîæíî èñïîëüçîâàòü çàìåíû è öâåòà HEX\n\t {036d80}!n{FFFFFF} - ïåðåõîä íà íîâóþ ñòðîêó\n\t {036d80}!a{FFFFFF} - çàìåíèòñÿ íà îñòàòîê íàðêîòèêîâ\n\t {036d80}!m{FFFFFF} - çàìåíèòñÿ íà îñòàòîê ìàòåðèàëîâ"
dialogLine[#dialogLine + 1] = ' Òåêñò êîãäà èä¸ò òàéìåð\t'..ini.lines.two
dialogTextToList[#dialogLine] = "{FFFFFF}Ââåäèòå òåêñò òàéìåðà êîãäà îí ðàáîòàåò.\n\tÌîæíî èñïîëüçîâàòü çàìåíû è öâåòà HEX\n\t {036d80}!n{FFFFFF} - ïåðåõîä íà íîâóþ ñòðîêó\n\t {036d80}!a{FFFFFF} - çàìåíèòñÿ íà îñòàòîê íàðêîòèêîâ\n\t {036d80}!s{FFFFFF} - çàìåíèòñÿ íà îñòàòîê ñåêóíä\n\t {036d80}!m{FFFFFF} - çàìåíèòñÿ íà îñòàòîê ìàòåðèàëîâ"
dialogLine[#dialogLine + 1] = ' Øðèôò\t'..ini.render.font
dialogTextToList[#dialogLine] = "{FFFFFF}Ââåäèòå íàçâàíèå øðèôòà"
dialogLine[#dialogLine + 1] = ' Ðàçìåð\t'..ini.render.size
dialogTextToList[#dialogLine] = "{FFFFFF}Ââåäèòå ðàçìåð øðèôòà"
dialogLine[#dialogLine + 1] = ' Ñòèëü\t'..ini.render.flag
dialogTextToList[#dialogLine] = "{FFFFFF}Óñòàíàâëèâàéòå ñòèëü ïóòåì ñëîæåíèÿ.\n\nÒåêñò áåç îñîáåííîñòåé = 0\nÆèðíûé òåêñò = 1\nÍàêëîííîñòü(Êóðñèâ) = 2\nÎáâîäêà òåêñòà = 4\nÒåíü òåêñòà = 8\nÏîä÷åðêíóòûé òåêñò = 16\nÇà÷åðêíóòûé òåêñò = 32\n\nÑòàíäàðò: 13"
dialogLine[#dialogLine + 1] = ' Âûðàâíèâàíèå\t'..( ini.render.align == 1 and "Îò ëåâîãî êðàÿ" or ( ini.render.align == 2 and "Ïî ñåðåäèíå" or ( ini.render.align == 3 and " Îò ïðàâîãî êðàÿ" or '' ) ) )
dialogLine[#dialogLine + 1] = ' Îòñòóï íîâîé ñòðîêè\t'..ini.render.height
dialogTextToList[#dialogLine] = "{FFFFFF}Ââåäèòå ÷èñëî îò 2 äî 10."
dialogLine[#dialogLine + 1] = '{59fc30}Êîíòàêòû àâòîðà\t'
local text = ""
for k,v in pairs(dialogLine) do
text = text..v.."\n"
end
sampShowDialog(0, 'Drugs-Mats: Íàñòðîéêè', text, "Âûáðàòü", "Çàêðûòü", 4)
end
if int == 2 then
d[7] = true
sampShowDialog(0, "Drugs-Mats: Èçìåíåíèå íàñòðîåê", dtext, "Âûáðàòü", "Íàçàä", 1)
end
if int == 3 then
sampShowDialog(0, "Drugs-Mats: Êîíòàêòû àâòîðà", "{FFFFFF}Âûáåðè ÷òî ñêîïèðîâàòü\t\nÍèê íà Samp-Rp\tSerhiy_Rubin\nÑòðàíè÷êà {4c75a3}VK{FFFFFF}\tvk.com/id353828351\nÃðóïïà {4c75a3}VK{FFFFFF} ñ ìîäàìè\tvk.com/club161589495\n{10bef2}Skype{FFFFFF}\tserhiyrubin\n{7289da}Discord{FFFFFF}\tSerhiy_Rubin#3391", "Êîïèðîâàòü", "Íàçàä", 5)
end
end
function doDialog()
local caption = sampGetDialogCaption()
if caption == 'Drugs-Mats: Íàñòðîéêè' then
local result, button, list, input = sampHasDialogRespond(0)
if result and button == 1 then
if dialogLine ~= nil and dialogLine[list + 1] ~= nil then
local str = dialogLine[list + 1]
if str:find('Ñêðèïò') then
ini[inikeys].run = not ini[inikeys].run
inicfg.save(ini)
ShowDialog(1)
end
if str:find('Ñìåíèòü ïîçèöèþ') then
lua_thread.create(function()
wait(200)
pos = true
end)
end
if str:find('Ïðîâåðêà èíâåíòàðÿ') then
ini[inikeys].inventory = not ini[inikeys].inventory
inicfg.save(ini)
ShowDialog(1)
end
if str:find('Ñåðâåðíàÿ êîìàíäà ïðèíÿòü íàðêî') then
ShowDialog(2, dialogTextToList[list + 1], ini[inikeys].server_cmd, true, inikeys, 'server_cmd')
end
if str:find('boostinfo') then
ini[inikeys].boostinfo = not ini[inikeys].boostinfo
inicfg.save(ini)
ShowDialog(1)
end
if str:find('Ñåêóíä äî ñëåäóþùåãî ïðèíÿòèÿ íàðêî') then
ShowDialog(2, dialogTextToList[list + 1], ini[inikeys].seconds, false, inikeys, 'seconds')
end
if str:find('Ìàêñèìàëüíîå HP') then
ShowDialog(2, dialogTextToList[list + 1], ini[inikeys].hp, false, inikeys, 'hp')
end
if str:find('Ìàêñèìóì ãðàìì ìîæíî èñïîëüçîâàòü') then
ShowDialog(2, dialogTextToList[list + 1], ini[inikeys].max_use_gram, false, inikeys, 'max_use_gram')
end
if str:find('HP äàåò 1 ãðàìì íàðêîòèêîâ') then
ShowDialog(2, dialogTextToList[list + 1], ini[inikeys].hp_one_gram, false, inikeys, 'hp_one_gram')
end
if str:find('Ñîêðàùåííàÿ êîìàíäà') then
ShowDialog(2, dialogTextToList[list + 1], ini.global.cmd, true, 'global', 'cmd')
end
if str:find('Òåêñò êîãäà òàéìåð ñòîèò') then
ShowDialog(2, dialogTextToList[list + 1], ini.lines.one, true, 'lines', 'one')
end
if str:find('Òåêñò êîãäà èä¸ò òàéìåð') then
ShowDialog(2, dialogTextToList[list + 1], ini.lines.two, true, 'lines', 'two')
end
if str:find('Øðèôò') then
ShowDialog(2, dialogTextToList[list + 1], ini.render.font, true, 'render', 'font')
end
if str:find('Ðàçìåð') then
ShowDialog(2, dialogTextToList[list + 1], ini.render.size, true, 'render', 'size')
end
if str:find('Ñòèëü') then
ShowDialog(2, dialogTextToList[list + 1], ini.render.flag, true, 'render', 'flag')
end
if str:find('Âûðàâíèâàíèå') then
ini.render.align = ( ini.render.align == 1 and 2 or ( ini.render.align == 2 and 3 or ( ini.render.align == 3 and 1 or 2 ) ) )
inicfg.save(ini)
ShowDialog(1)
end
if str:find('Îòñòóï íîâîé ñòðîêè') then
ShowDialog(2, dialogTextToList[list + 1], ini.render.height, false, 'render', 'height')
end
if str:find('Êîíòàêòû àâòîðà') then
ShowDialog(3)
end
if str:find('Êíîïêà äëÿ èñïîëüçâàíèÿ íàðêî') then
lua_thread.create(function()
wait(150)
local keys = ""
repeat
wait(0)
for k, v in pairs(vkeys) do
if not sampIsDialogActive() then
sampShowDialog(0, "Ñìåíà êëàâèøè", "{FFFFFF}Íàæìèòå íà ëþáóþ êëàâèøó\nÎíà áóäåò èñïîëüçîâàòüñÿ äëÿ èñïîëüçîâàíèÿ íàðêîòèêà", "Âûáðàòü", "Çàêðûòü", 0)
end
if wasKeyPressed(v) and k ~= "VK_ESCAPE" and k ~= "VK_RETURN" and k ~= "VK_SPACE" then
keys = k
end
end
until keys ~= ""
ini.global.key = keys
inicfg.save(ini)
ShowDialog(1)
end)
end
end
end
end
if caption == "Drugs-Mats: Èçìåíåíèå íàñòðîåê" then
if d[7] then
d[7] = false
sampSetCurrentDialogEditboxText(ini[d[5]][d[6]])
end
local result, button, list, input = sampHasDialogRespond(0)
if result then
if button == 1 then
local gou = ( d[4] and (#input > 0 and true or false) or (input:find("^%d+$") and true or false))
if gou then
d[3] = (d[4] and tostring(input) or tonumber(input))
ini[d[5]][d[6]] = d[3]
inicfg.save(ini)
if d[5]:find('render') then
renderReleaseFont(font)
font = renderCreateFont(ini.render.font, ini.render.size, ini.render.flag)
end
if d[5]:find('lines') then
text_to_table()
end
ShowDialog(1)
else
ShowDialog(d[1], d[2], d[3], d[4], d[5], d[6])
end
else
ShowDialog(1)
end
end
end
if caption == "Drugs-Mats: Êîíòàêòû àâòîðà" then
local result, button, list, input = sampHasDialogRespond(0)
if result then
if button == 1 then
if list == 0 then setClipboardText("Serhiy_Rubin") end
if list == 1 then setClipboardText("https://vk.com/id353828351") end
if list == 2 then setClipboardText("https://vk.com/club161589495") end
if list == 3 then setClipboardText("serhiyrubin") end
if list == 4 then setClipboardText("Serhiy_Rubin#3391") end
ShowDialog(3)
else
ShowDialog(1)
end
end
end
end
function sampev.onServerMessage(color, message)
if check_boostinfo == 2 and color == -1 and message:find("Äåéñòâóåò äî") then
return false
end
if check_boostinfo == 2 and color == -1 and message:find("Áîíóñû îòêëþ÷åíû") then
check_boostinfo = 0
return false
end
if (message == " (( Çäîðîâüå íå ïîïîëíÿåòñÿ ÷àùå, ÷åì ðàç â ìèíóòó ))" or message == ' (( Çäîðîâüå ìîæíî ïîïîëíèòü íå ÷àùå, ÷åì ðàç â ìèíóòó ))') then not_drugs_timer = true end
if string.find(message, my_name) then
if string.find(message, "óïîòðåáèë%(à%) íàðêîòèê") then
if not not_drugs_timer then drugs_timer = os.time() else not_drugs_timer = false end
end
if string.find(message, "îðóæèå èç ìàòåðèàëîâ") then
check_get_mats = true
end
end
if message:find('âûáðîñèë') and (message:find('àðêîòèêè') or message:find('àòåðèàëû')) and string.find(message, my_name) then
check_get_mats = true
end
if message:find('Âû âçÿëè íåñêîëüêî êîìïëåêòîâ') then
check_get_mats = true
end
if message:find('Âû îãðàáèëè äîì! Íàâîðîâàííûé ìåòàëë ìîæíî ñäàòü îêîëî ïîðòà.') then
check_get_mats = true
end
if message:find('Ó âàñ (%d+)/500 ìàòåðèàëîâ ñ ñîáîé') then
ini[inikeys].mats = message:match('Ó âàñ (%d+)/500 ìàòåðèàëîâ ñ ñîáîé')
inicfg.save(ini)
end
if string.find(message, " %(%( Îñòàòîê: (%d+) ãðàìì %)%)") then
if not not_drugs_timer then drugs_timer = os.time() else not_drugs_timer = false end
ini[inikeys].drugs = string.match(message, " %(%( Îñòàòîê: (%d+) ãðàìì %)%)")
inicfg.save(ini)
end
if string.find(message, '%(%( Îñòàòîê: (%d+) ìàòåðèàëîâ %)%)') then
ini[inikeys].mats = message:match('%(%( Îñòàòîê: (%d+) ìàòåðèàëîâ %)%)')
inicfg.save(ini)
end
if message:find('Âû êóïèëè %d+ ãðàìì íàðêîòèêîâ çà %d+ âèðò %(Ó âàñ åñòü (%d+) ãðàìì%)') then
ini[inikeys].drugs = message:match('Âû êóïèëè %d+ ãðàìì íàðêîòèêîâ çà %d+ âèðò %(Ó âàñ åñòü (%d+) ãðàìì%)')
inicfg.save(ini)
end
if message:find('Âû êóïèëè (%d+) ãðàìì íàðêîòèêîâ çà %d+ âèðò ó .+') then
local s1 = message:match('Âû êóïèëè (%d+) ãðàìì íàðêîòèêîâ çà %d+ âèðò ó .+')
ini[inikeys].drugs = tonumber(s1) + ini[inikeys].drugs
inicfg.save(ini)
end
end
function sampev.onSendChat(message) sleep = os.clock() * 1000 end
function sampev.onSendCommand(cmd)
local command, params = string.match(cmd:lower(), "^%/([^ ]*)(.*)")
if command == ini.global.cmd:lower() or string.find(command, ini[inikeys].server_cmd) then
if string.find(params, "menu") then
ShowDialog(1)
return false
end
if #params == 0 then
local gramm = math.ceil(((ini[inikeys].hp + 1) - getCharHealth(playerPed)) / ini[inikeys].hp_one_gram)
if gramm > ini[inikeys].max_use_gram then gramm = ini[inikeys].max_use_gram end
second_timer = os.difftime(os.time(), drugs_timer)
if second_timer <= ini[inikeys].seconds and second_timer > 0 then gramm = 1 end
return {string.format('/%s %d', ini[inikeys].server_cmd, gramm)}
end
if command == ini.global.cmd:lower() then
cmd = cmd:lower():gsub(ini.global.cmd:lower(), ini[inikeys].server_cmd)
return { cmd }
end
end
sleep = os.clock() * 1000
end
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if title:find('Èíôîðìàöèÿ') or title:find('Êàðìàíû') then
local nark, mats = false, false
local arr = split(text, "\n")
for i = 1, #arr do
if arr[i]:find('Íàðêîòèêè\t(%d+)') then
ini[inikeys].drugs = arr[i]:match('Íàðêîòèêè\t(%d+)')
nark = true
end
if arr[i]:find('Ìàòåðèàëû\t(%d+)') then
ini[inikeys].mats = arr[i]:match('Ìàòåðèàëû\t(%d+)')
mats = true
end
end
if not nark then ini[inikeys].drugs = 0 end
if not mats then ini[inikeys].mats = 0 end
inicfg.save(ini)
if check_inventory == 2 or (check_inventory_time ~= nil and os.time() - check_inventory_time < 5) then
check_inventory = 0
check_inventory_time = os.time()
sampSendDialogResponse(dialogId, 0, 0, "")
return false
end
end
if dialogId == 22 and title == "Áîíóñû" then
local arr = split(text, "\n")
for i = 1, #arr do
if arr[i]:find('Òàéìåð íà Íàðêî (.+)') then
bonus_drugs = tonumber(arr[i]:match('Òàéìåð íà Íàðêî (.+)'))
break
end
end
if check_boostinfo == 2 then
check_boostinfo = 0
return false
end
end
end
function GetMats()
if not check_get_mats then return end
check_get_mats = false
repeat
wait(0)
until os.clock() * 1000 - sleep > 1200 and sampGetPlayerScore(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))) >= 1 and not sampIsDialogActive() and not sampIsChatInputActive()
local _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
if ini[inikeys].inventory then
check_inventory = 2
repeat
wait(0)
if os.clock() * 1000 - sleep > 1200 and sampGetPlayerScore(id) >= 1 and not sampIsDialogActive() and not sampIsChatInputActive() then
sampSendChat('/inventory')
sleep = os.clock() * 1000
end
until check_inventory ~= 2
end
if ini[inikeys].boostinfo and check_boostinfo_status == nil then
check_boostinfo_status = os.time()
check_boostinfo = 2
repeat
wait(0)
if os.clock() * 1000 - sleep > 1200 and sampGetPlayerScore(id) >= 1 and not sampIsDialogActive() and not sampIsChatInputActive() then
sampSendChat('/boostinfo')
sleep = os.clock() * 1000
end
until check_boostinfo ~= 2
end
end
function split(str, delim, plain)
local tokens, pos, plain = {}, 1, not (plain == false) --[[ delimiter is plain text by default ]]
repeat
local npos, epos = string.find(str, delim, pos, plain)
table.insert(tokens, string.sub(str, pos, npos and npos - 1))
pos = epos and epos + 1
until not pos
return tokens
end
Loading…
Cancel
Save