SA:MP помощь в скрипте

JokerEnergy

Участник
Автор темы
33
1
Версия SA-MP
  1. Любая
Всем здравствуйте!
Нужна помощь
ниже прикрепил код авто одевания маски
Может ли кто нибудь сделать так что бы когда маска одевалась не было анимации одевания маски
local sampev = require'lib.samp.events'
local mask = false

function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampAddChatMessage(string.format("[Stanford Stealer Scripts]: {FFFFFF} Успешно загружен!"), 0x8A5EB6 )

sampRegisterChatCommand("mk", cmd_mk)

while true do
wait(0)

end

end

function cmd_mk()

mask = not mask

if mask == true then sampAddChatMessage("Теперь маска автоматически обновляется",0x00FF00)
else sampAddChatMessage("Маска больше обновляться не будет",0xFF0000)
end
end

function sampev.onServerMessage(color, msg)
if (mask == true) and (msg:find('Время действия маски истекло, вам пришлось ее выбросить')) then
sampAddChatMessage('Ваша маска обновилась!',0x00FF00)
sampSendChat('/mask')
end
end
 

Вложения

  • maska.lua
    873 байт · Просмотры: 0
Решение
Lua:
local sampev = require 'lib.samp.events'

local maskActive = false

function main()
    -- ждём полной загрузки SAMP и SampFuncs
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage("[Stanford Stealer Scripts]: {FFFFFF}Успешно загружен!", 0x8A5EB6)
    sampRegisterChatCommand("mk", toggleMaskRenew)
    while true do wait(0) end
end

function toggleMaskRenew()
    maskActive = not maskActive
    if maskActive then
        sampAddChatMessage("Теперь маска автоматически обновляется", 0x00FF00)
    else
        sampAddChatMessage("Маска больше обновляться не будет", 0xFF0000)
    end
end

function sampev.onServerMessage(color, msg)
    if maskActive...

uqowivad

Известный
27
32
Lua:
local sampev = require 'lib.samp.events'

local maskActive = false

function main()
    -- ждём полной загрузки SAMP и SampFuncs
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage("[Stanford Stealer Scripts]: {FFFFFF}Успешно загружен!", 0x8A5EB6)
    sampRegisterChatCommand("mk", toggleMaskRenew)
    while true do wait(0) end
end

function toggleMaskRenew()
    maskActive = not maskActive
    if maskActive then
        sampAddChatMessage("Теперь маска автоматически обновляется", 0x00FF00)
    else
        sampAddChatMessage("Маска больше обновляться не будет", 0xFF0000)
    end
end

function sampev.onServerMessage(color, msg)
    if maskActive
        and msg:find("Время действия маски истекло, вам пришлось ее выбросить") then
        sampAddChatMessage("Ваша маска обновилась!", 0x00FF00)
        sampSendChat("/mask")
    end
end

function sampev.onApplyPlayerAnimation(playerId, animLib, animName)
    local _, localId = sampGetPlayerIdByCharHandle(1)
    if playerId == localId and animLib == "SHOP" and animName == "ROB_shifty" then
        return false
    end
end
 
  • Влюблен
Реакции: JokerEnergy