Нашел админ-хелпер для сампа, решил переписать под другой сервер, выходит ошибка, не могу найти где именно. Помогите!
Где "******", это убрал название форума, дабы не было рекламы.
script_name('Admin-Helper')
require 'lib.sampfuncs'
require 'lib.moonloader'
local inicfg = require 'inicfg'
local q = require 'lib.samp.events'
local encoding = require 'encoding'
local requests = require 'requests'
local lanes = require('lanes').configure()
local key = require 'vkeys'
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampAddChatMessage("{CECECE}[{FF6600}Admin-Helper{CECECE}] Скрипт успешно загружен. Разработчик: Shanzix", 0xCECECE)
while true do
wait(0)
if not sampIsChatInputActive() then
if wasKeyPressed(key.VK_MULTIPLY) then
sampSetChatInputText("/a ")
sampSetChatInputEnabled(true)
end
if wasKeyPressed(key.VK_F2) then
sampSetChatInputText("/pm ")
sampSetChatInputEnabled(true)
end
if not sampIsDialogActive() then
if wasKeyPressed(key.VK_F3) then
sampShowDialog(1004, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Игрок на нарушает/Игрок наказан.", "Не наруш.", "Наказан", 1)
end
result, button, list, input = sampHasDialogRespond(1004)
if result then
if button == 1 then
sampSendChat(string.format("/pm %s Не наблюдаю нарушений от игрока. Приятной игры!)", input))
else
sampSendChat(string.format("/pm %s Игрок наказан. Приятной игры на нашем сервере!)", input))
end
end
if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_1) then
sampShowDialog(1000, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Читайте всю информацию на форуме проекта, [*********].", "Отправить", "Отмена", 1)
end
result, button, list, input = sampHasDialogRespond(1000)
if result then
if button == 1 then
sampSendChat(string.format("/pm %s Читайте всю информацию на форуме проекта, *******.", input))
end
end
if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_2) then
sampShowDialog(1001, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Пишите жалобу на форум ******** с доказательствами.", "Отправить", "Отмена", 1)
end
result, button, list, input = sampHasDialogRespond(1001)
if result then
if button == 1 then
sampSendChat(string.format("/pm %s Пишите жалобу на форум [*******] с доказательствами.", input))
end
end
if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_3) then
sampShowDialog(1002, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Ваш ник можно сменить только за деньги [/mm - донат рубли].", "Отправить", "Отмена", 1)
end
result, button, list, input = sampHasDialogRespond(1002)
if result then
if button == 1 then
sampSendChat(string.format("/pm %s Ваш ник можно сменить только за деньги [/mm - донат рубли].", input))
end
end
if wasKeyPressed(key.VK_NUMPAD0) then
sampShowDialog(1003, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Shanzix желает Вам приятной игры на нашей сервер!", "Отправить", "Отмена", 1)
end
result, button, list, input = sampHasDialogRespond(1003)
if result then
if button == 1 then
sampSendChat(string.format("/pm %s Shanzix желает Вам приятной игры на нашей сервер!", input))
end
end
if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_4) then
sampShowDialog(1005, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Промокод можно ввести с любого уровня [/mm - 9].", "Отправить", "Отмена", 1)
end
result, button, list, input = sampHasDialogRespond(1005)
if result then
if button == 1 then
sampSendChat(string.format("/pm %s Промокод можно ввести с любого уровня [/mm - 9].", input))
end
end
if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_5) then
sampShowDialog(1006, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Промокоды на нашем сервере: «#McLine» и «#ЧЕРКЕС»", "Отправить", "Отмена", 1)
end
result, button, list, input = sampHasDialogRespond(1006)
if result then
if button == 1 then
sampSendChat(string.format("/pm %s Промокоды на нашем сервере: «#McLine» и «#ЧЕРКЕС»", input))
end
end
if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_6) then
sampShowDialog(1007, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Работаю по вашей жалобе | Приятной игры!"), "Отправить", "Отмена", 1)
end
result, button, list, input = sampHasDialogRespond(1007)
if result then
if button == 1 then
sampSendChat(string.format("/pm %s Работаю по вашей жалобе | Приятной игры!", input))
end
end
if wasKeyPressed(key.VK_DIVIDE) then
sampSetChatInputText("/st ")
sampSetChatInputEnabled(true)
end
if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_DIVIDE) then
sampSetChatInputText("/offst ")
sampSetChatInputEnabled(true)
end
if wasKeyPressed(key.VK_DECIMAL) then
sampSetChatInputText("/re ")
sampSetChatInputEnabled(true)
end
if wasKeyPressed(109) then
sampSetChatInputText("/goto ")
sampSetChatInputEnabled(true)
end
if wasKeyPressed(107) then
sampSetChatInputText("/gethere ")
sampSetChatInputEnabled(true)
end
if wasKeyPressed(key.VK_NUMPAD1) then
sampSetChatInputText("/kick ")
sampSetChatInputEnabled(true)
end
if wasKeyPressed(key.VK_NUMPAD3) then
sampSetChatInputText("/mute ")
sampSetChatInputEnabled(true)
end
if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_NUMPAD3) then
sampSetChatInputText("/offmute ")
sampSetChatInputEnabled(true)
end
if isKeyDown(key.VK_CONTROL) and wasKeyPressed(key.VK_NUMPAD3) then
sampSetChatInputText("/unmute ")
sampSetChatInputEnabled(true)
end
if wasKeyPressed(key.VK_NUMPAD5) then
sampSetChatInputText("/prison ")
sampSetChatInputEnabled(true)
end
if isKeyDown(key.VK_CONTROL) and wasKeyPressed(key.VK_NUMPAD5) then
sampSetChatInputText("/unprison ")
sampSetChatInputEnabled(true)
end
if wasKeyPressed(key.VK_NUMPAD7) then
sampSetChatInputText("/warn ")
sampSetChatInputEnabled(true)
end
if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_NUMPAD7) then
sampSetChatInputText("/offwarn ")
sampSetChatInputEnabled(true)
end
if isKeyDown(key.VK_CONTROL) and wasKeyPressed(key.VK_NUMPAD7) then
sampSetChatInputText("/unwarn ")
sampSetChatInputEnabled(true)
end
if wasKeyPressed(key.VK_NUMPAD9) then
sampSetChatInputText("/ban ")
sampSetChatInputEnabled(true)
end
if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_NUMPAD9) then
sampSetChatInputText("/offban ")
sampSetChatInputEnabled(true)
end
if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_6) then
sampSetChatInputText("/unban ")
sampSetChatInputEnabled(true)
end
if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_7) then
sampSetChatInputText("/sban ")
sampSetChatInputEnabled(true)
end
end
end
end
Нашел админ-хелпер для сампа, решил переписать под другой сервер, выходит ошибка, не могу найти где именно. Помогите!
Где "******", это убрал название форума, дабы не было рекламы.
script_name('Admin-Helper') require 'lib.sampfuncs' require 'lib.moonloader' local inicfg = require 'inicfg' local q = require 'lib.samp.events' local encoding = require 'encoding' local requests = require 'requests' local lanes = require('lanes').configure() local key = require 'vkeys' function main() if not isSampfuncsLoaded() or not isSampLoaded() then return end while not isSampAvailable() do wait(100) end sampAddChatMessage("{CECECE}[{FF6600}Admin-Helper{CECECE}] Скрипт успешно загружен. Разработчик: Shanzix", 0xCECECE) while true do wait(0) if not sampIsChatInputActive() then if wasKeyPressed(key.VK_MULTIPLY) then sampSetChatInputText("/a ") sampSetChatInputEnabled(true) end if wasKeyPressed(key.VK_F2) then sampSetChatInputText("/pm ") sampSetChatInputEnabled(true) end if not sampIsDialogActive() then if wasKeyPressed(key.VK_F3) then sampShowDialog(1004, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Игрок на нарушает/Игрок наказан.", "Не наруш.", "Наказан", 1) end result, button, list, input = sampHasDialogRespond(1004) if result then if button == 1 then sampSendChat(string.format("/pm %s Не наблюдаю нарушений от игрока. Приятной игры!)", input)) else sampSendChat(string.format("/pm %s Игрок наказан. Приятной игры на нашем сервере!)", input)) end end if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_1) then sampShowDialog(1000, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Читайте всю информацию на форуме проекта, [*********].", "Отправить", "Отмена", 1) end result, button, list, input = sampHasDialogRespond(1000) if result then if button == 1 then sampSendChat(string.format("/pm %s Читайте всю информацию на форуме проекта, *******.", input)) end end if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_2) then sampShowDialog(1001, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Пишите жалобу на форум ******** с доказательствами.", "Отправить", "Отмена", 1) end result, button, list, input = sampHasDialogRespond(1001) if result then if button == 1 then sampSendChat(string.format("/pm %s Пишите жалобу на форум [*******] с доказательствами.", input)) end end if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_3) then sampShowDialog(1002, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Ваш ник можно сменить только за деньги [/mm - донат рубли].", "Отправить", "Отмена", 1) end result, button, list, input = sampHasDialogRespond(1002) if result then if button == 1 then sampSendChat(string.format("/pm %s Ваш ник можно сменить только за деньги [/mm - донат рубли].", input)) end end if wasKeyPressed(key.VK_NUMPAD0) then sampShowDialog(1003, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Shanzix желает Вам приятной игры на нашей сервер!", "Отправить", "Отмена", 1) end result, button, list, input = sampHasDialogRespond(1003) if result then if button == 1 then sampSendChat(string.format("/pm %s Shanzix желает Вам приятной игры на нашей сервер!", input)) end end if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_4) then sampShowDialog(1005, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Промокод можно ввести с любого уровня [/mm - 9].", "Отправить", "Отмена", 1) end result, button, list, input = sampHasDialogRespond(1005) if result then if button == 1 then sampSendChat(string.format("/pm %s Промокод можно ввести с любого уровня [/mm - 9].", input)) end end if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_5) then sampShowDialog(1006, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Промокоды на нашем сервере: «#McLine» и «#ЧЕРКЕС»", "Отправить", "Отмена", 1) end result, button, list, input = sampHasDialogRespond(1006) if result then if button == 1 then sampSendChat(string.format("/pm %s Промокоды на нашем сервере: «#McLine» и «#ЧЕРКЕС»", input)) end end if isKeyDown(key.VK_MENU) and isKeyJustPressed(key.VK_6) then sampShowDialog(1007, "{ffcc00}Введи ID получателя сообщения", "{FFFFFF}/pm [ID] Работаю по вашей жалобе | Приятной игры!"), "Отправить", "Отмена", 1) end result, button, list, input = sampHasDialogRespond(1007) if result then if button == 1 then sampSendChat(string.format("/pm %s Работаю по вашей жалобе | Приятной игры!", input)) end end if wasKeyPressed(key.VK_DIVIDE) then sampSetChatInputText("/st ") sampSetChatInputEnabled(true) end if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_DIVIDE) then sampSetChatInputText("/offst ") sampSetChatInputEnabled(true) end if wasKeyPressed(key.VK_DECIMAL) then sampSetChatInputText("/re ") sampSetChatInputEnabled(true) end if wasKeyPressed(109) then sampSetChatInputText("/goto ") sampSetChatInputEnabled(true) end if wasKeyPressed(107) then sampSetChatInputText("/gethere ") sampSetChatInputEnabled(true) end if wasKeyPressed(key.VK_NUMPAD1) then sampSetChatInputText("/kick ") sampSetChatInputEnabled(true) end if wasKeyPressed(key.VK_NUMPAD3) then sampSetChatInputText("/mute ") sampSetChatInputEnabled(true) end if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_NUMPAD3) then sampSetChatInputText("/offmute ") sampSetChatInputEnabled(true) end if isKeyDown(key.VK_CONTROL) and wasKeyPressed(key.VK_NUMPAD3) then sampSetChatInputText("/unmute ") sampSetChatInputEnabled(true) end if wasKeyPressed(key.VK_NUMPAD5) then sampSetChatInputText("/prison ") sampSetChatInputEnabled(true) end if isKeyDown(key.VK_CONTROL) and wasKeyPressed(key.VK_NUMPAD5) then sampSetChatInputText("/unprison ") sampSetChatInputEnabled(true) end if wasKeyPressed(key.VK_NUMPAD7) then sampSetChatInputText("/warn ") sampSetChatInputEnabled(true) end if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_NUMPAD7) then sampSetChatInputText("/offwarn ") sampSetChatInputEnabled(true) end if isKeyDown(key.VK_CONTROL) and wasKeyPressed(key.VK_NUMPAD7) then sampSetChatInputText("/unwarn ") sampSetChatInputEnabled(true) end if wasKeyPressed(key.VK_NUMPAD9) then sampSetChatInputText("/ban ") sampSetChatInputEnabled(true) end if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_NUMPAD9) then sampSetChatInputText("/offban ") sampSetChatInputEnabled(true) end if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_6) then sampSetChatInputText("/unban ") sampSetChatInputEnabled(true) end if isKeyDown(key.VK_MENU) and wasKeyPressed(key.VK_7) then sampSetChatInputText("/sban ") sampSetChatInputEnabled(true) end end end end
Изменено пользователем SHANZIXоформление длинного кода
Поделиться сообщением
Ссылка на сообщение
Поделиться на других сайтах