Lua [ARZ] Auto /heal

Azenizzka

Участник
Автор темы
27
23
Данный скрипт облегчит работу сотрудникам больниц на Аризоне. При наведении на игрока ПКМ(когда появляется треугольник над игроком) скрипт сам прописывает /heal 'id' 'цена лечения'.

Активация: /aheal 'Цена за лечение'
 

Вложения

  • aheal.lua
    1.7 KB · Просмотры: 36

Xros 2

Потрачен
530
127
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
нихуя себе кто-то додумался
 

diva

Известный
247
44
Lua:
script_name("Auto /heal")
script_version("1.0")
script_authors("xNokiaAngelx")

local sampev = require 'lib.samp.events'
local enable = true
local interiorCheck = false
local interiorCheck2 = false
local pzuCheck = true
local enter = false

-------------------------------------------------------------------------

function main()
    repeat wait(0)
    until isSampAvailable()
    while true do
        wait(0)
        local cmdResult = sampIsChatCommandDefined("autoheal")
        if not cmdResult then
            local result = sampRegisterChatCommand("autoheal", toggleScript)
        end
        if interiorCheck and pzuCheck then sendCmd("/heal") interiorCheck = false end
    end
end

-------------------------------------------------------------------------

function toggleScript()
    enable = not enable
    if enable then
        sampAddChatMessage("[AUTO /gydytis] {34eb37}DISABLED. {b88d0f}DISABLE su /autoheal.", 0x1cd031)
    else
        sampAddChatMessage("[AUTO /heal] {eb3434}ENABLE. {b88d0f}ENABLE su /autoheal.", 0x1cd031)
    end
end

-------------------------------------------------------------------------

function sampev.onSendInteriorChangeNotification(interior)
    if not enable then return end
    if interior ~= 0 then interiorCheck = true interiorCheck2 = true end
end

-------------------------------------------------------------------------

function sendCmd(cmd)
    sampSendChat(cmd)
end

-------------------------------------------------------------------------

function sampev.onServerMessage(color, text)
    if not enable then return end
    if interiorCheck2 and pzuCheck and string.find(text, "Unknown command") then enter = true end
    interiorCheck2 = false
    if enter then
        enter = false
        sampAddChatMessage("[AUTO /heal] You don't have the key.", 0xff0000)
        return false
    end
end

-------------------------------------------------------------------------

function sampev.onTogglePlayerSpectating(state)
    if state then pzuCheck = false else pzuCheck = true end
end
 
  • Эм
Реакции: Azenizzka