скрипт

ChromiusJ

x B x A x R x
Автор темы
Друг
4,873
3,175
Версия SA-MP
  1. 0.3.7 (R1)
  2. 0.3.7-R2
  3. 0.3.7-R3
  4. 0.3.7-R4
  5. 0.3DL
ааыыыы:
function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    active = 0
    sampRegisterChatCommand("hl", activatecmd)
    while true do
        wait(0)
        if not isPauseMenuActive() and isPlayerPlaying(playerHandle) then
          if active == 1 then
            local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
            if valid and doesCharExist(ped) then
               local result, id = sampGetPlayerIdByCharHandle(ped)
               if result then
                sampSendChat("/heal  " ..id ..5000)
               end
           end
        end
    end
  end
end
сделал хуню чтобы кидала лечение каждому на кого посмотрю,однако требует чтобы поставил цену когда навожусь,помогите пж,вроде все поставил(также кикает за флуд функциями,мб как-то кд увеличить)
 
Решение
уже поставил задержку а ковычки стоят нихуя не происходит
ты команду написал? у там если что в команде активации стоит функция, если у тебя её нету то не активируется

Lua:
local active = false

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end

    sampRegisterChatCommand("hl", function() active = not active end)
    while true do wait(200)
        if not isPauseMenuActive() and isPlayerPlaying(PLAYER_HANDLE) then
            if active then
                  local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
                  if valid and doesCharExist(ped) then
                    local result, id =...

reversed

Участник
69
17
Lua:
function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    active = 0
    sampRegisterChatCommand("hl", activatecmd)
    while true do wait(200)
        if not isPauseMenuActive() and isPlayerPlaying(PLAYER_HANDLE) then
            if active == 1 then
                  local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
                  if valid and doesCharExist(ped) then
                    local result, id = sampGetPlayerIdByCharHandle(ped)
                    if result then
                        sampSendChat('/heal ' .. id .. ' 5000')
                    end
                end
            end
        end
    end
end
чтобы не кикало просто задержку больше поставь и 5000 тоже нужно поставить в ковычки
 

ChromiusJ

x B x A x R x
Автор темы
Друг
4,873
3,175
Lua:
function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    active = 0
    sampRegisterChatCommand("hl", activatecmd)
    while true do wait(200)
        if not isPauseMenuActive() and isPlayerPlaying(PLAYER_HANDLE) then
            if active == 1 then
                  local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
                  if valid and doesCharExist(ped) then
                    local result, id = sampGetPlayerIdByCharHandle(ped)
                    if result then
                        sampSendChat('/heal ' .. id .. ' 5000')
                    end
                end
            end
        end
    end
end
чтобы не кикало просто задержку больше поставь и 5000 тоже нужно поставить в ковычки
уже поставил задержку а ковычки стоят нихуя не происходит
 

reversed

Участник
69
17
уже поставил задержку а ковычки стоят нихуя не происходит
ты команду написал? у там если что в команде активации стоит функция, если у тебя её нету то не активируется

Lua:
local active = false

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end

    sampRegisterChatCommand("hl", function() active = not active end)
    while true do wait(200)
        if not isPauseMenuActive() and isPlayerPlaying(PLAYER_HANDLE) then
            if active then
                  local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
                  if valid and doesCharExist(ped) then
                    local result, id = sampGetPlayerIdByCharHandle(ped)
                    if result then
                        sampSendChat('/heal ' .. id .. ' 5000')
                    end
                end
            end
        end
    end
end
вот, можешь заменить активацию
 
Последнее редактирование:
  • Нравится
Реакции: ChromiusJ

Похожие темы

  1. Ответы
    2K
    Просмотры
    5M
  2. Ответы
    22
    Просмотры
    2M
  3. Ответы
    4K
    Просмотры
    1M
  4. Ответы
    0
    Просмотры
    552K