[LUA]Script doesn't seems to work.

Snagg

Участник
Автор темы
25
7
Lua:
script_description(".")


function main()
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand('ghh', health)
sampRegisterChatCommand('gapp', armor)

wait(-1)
end


function health()
if not isPlayerDead(PLAYER_HANDLE) then
setCharHealth(PLAYER_HANDLE, 100)
else
    print("You are dead!", 1500)
end
end

function armor()
    if not isPlayerDead(PLAYER_HANDLE) then
     addArmourToChar(PLAYER_HANDLE, 100)
 else
      print("You are dead!", 1500)
    end
end


I can't quite get what is wrong, cmd isn't registering.
 

ufdhbi

Известный
Проверенный
1,455
861
Lua:
script_description(".")


function main()
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand('ghh', health)
sampRegisterChatCommand('gapp', armor)

wait(-1)
end


function health()
if not isPlayerDead(PLAYER_HANDLE) then
setCharHealth(PLAYER_HANDLE, 100)
else
    print("You are dead!", 1500)
end
end

function armor()
    if not isPlayerDead(PLAYER_HANDLE) then
     addArmourToChar(PLAYER_HANDLE, 100)
else
      print("You are dead!", 1500)
    end
end


I can't quite get what is wrong, cmd isn't registering.
PLAYER_PED
 
  • Нравится
Реакции: Snagg