Lua Reload Weapon

ollydbg

Известный
Автор темы
163
115
Версия 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
Description: the script allows you to reload your weapon at any time, based on the cleo to reload the weapon, the improvement is that it does not activate if the chat is open

use: press R

Requeriments:
moonloader, sampfuncs

the code is open, you can change the activation key if you want
 

Вложения

  • Reload_Weapon.lua
    617 байт · Просмотры: 367
Последнее редактирование:

chapo

чопа сребдс // @moujeek
Модератор
8,868
11,575
1632044266346.png

1632044299361.png
 

chapo

чопа сребдс // @moujeek
Модератор
8,868
11,575
everyone makes mistakes haha
fixed @chapo
1. while not isSampfuncsLoaded() do wait(0) end
2. Why is a condition necessary if the same action occurs in both cases?
Lua:
script_author("ollydbg")
script_version_number(2)
require "lib.moonloader"

function main()
    while not isSampfuncsLoaded() do wait(0) end
    while true do
        wait(0)
        if isKeyDown(VK_R) and not sampIsCursorActive() then  -- R
            writeMemory(getCharPointer(PLAYER_PED) + 1440 + readMemory(getCharPointer(PLAYER_PED) + 1816, 1, false) * 28 + 4, 4, 2, true)
        end
    end
end
 
  • Bug
  • Нравится
Реакции: kruleS, atomlin и scroll.

ollydbg

Известный
Автор темы
163
115
1. while not isSampfuncsLoaded() do wait(0) end
2. Why is a condition necessary if the same action occurs in both cases?
Lua:
script_author("ollydbg")
script_version_number(2)
require "lib.moonloader"

function main()
    while not isSampfuncsLoaded() do wait(0) end
    while true do
        wait(0)
        if isKeyDown(VK_R) and not sampIsCursorActive() then  -- R
            writeMemory(getCharPointer(PLAYER_PED) + 1440 + readMemory(getCharPointer(PLAYER_PED) + 1816, 1, false) * 28 + 4, 4, 2, true)
        end
    end
end
sampIsCursorActive () needs sampfuncs
so the second condition is for the script to work in any version of samp or without sampfuncs
Lua:
elseif not _r and isPlayerPlaying(PLAYER_CHAR) then
 
Последнее редактирование: