- 72
- 12
- Версия MoonLoader
- Другое
Захотел сделать скрипт который при наведении на игрока показывает его хп, ид и тд.
Но что-то пошло не так(
Помогите
Но что-то пошло не так(
Помогите
script_name("q")
script_author("atmofersus")
require "lib.moonloader"
require "lib.sampfuncs"
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then
return
end
while not isSampAvailable() do
wait(0)
end
sampAddChatMessage ("qq",0x3968ad)
while true do
wait(0)
result, target = getCharPlayerIsTargeting(playerHandle)
if result then result, playerid = sampGetPlayerIdByCharHandle(target) end -- Если зажата пкм на игроке, то получаем ID.
if result and isKeyDown(VK_1) then -- Если зажата пкм и кнопка 1 на игроке, то...
local name = sampGetPlayerNickname(playerid) -- получаем nickname игрока по ранее полученному ID
local score = sampGetPlayerScore(playerid) -- и счет
local health = sampGetPlayerHealth(playerid) -- хп
sampTextdrawCreate(421, health, 70.0, 200.0)
sampTextdrawSetStyle(421, 2)
end
end
end
script_author("atmofersus")
require "lib.moonloader"
require "lib.sampfuncs"
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then
return
end
while not isSampAvailable() do
wait(0)
end
sampAddChatMessage ("qq",0x3968ad)
while true do
wait(0)
result, target = getCharPlayerIsTargeting(playerHandle)
if result then result, playerid = sampGetPlayerIdByCharHandle(target) end -- Если зажата пкм на игроке, то получаем ID.
if result and isKeyDown(VK_1) then -- Если зажата пкм и кнопка 1 на игроке, то...
local name = sampGetPlayerNickname(playerid) -- получаем nickname игрока по ранее полученному ID
local score = sampGetPlayerScore(playerid) -- и счет
local health = sampGetPlayerHealth(playerid) -- хп
sampTextdrawCreate(421, health, 70.0, 200.0)
sampTextdrawSetStyle(421, 2)
end
end
end
[22:52:09.282495] (error) show hp: Script died due to an error. (01A1C9B4)
[22:57:44.518670] (system) Gang helper: Script terminated. (01A1D77C)
[22:57:44.519670] (system) ML-ReloadAll: Script terminated. (01A1D15C)
[22:57:44.520670] (system) SF Integration: Script terminated. (01A1CFD4)
[22:57:44.520670] (system) Reconect: Script terminated. (01A1CE4C)
[22:57:44.521670] (system) TruckHUD: Script terminated. (01A1C82C)
[22:57:44.523670] (system) Loading script 'D:\SAMP\moonloader\gun help.lua'...
[22:57:44.523670] (debug) New script: 01A1C82C
[22:57:44.526670] (system) Gang helper: Loaded successfully.
[22:57:44.526670] (system) Loading script 'D:\SAMP\moonloader\reload_all.lua'...
[22:57:44.526670] (debug) New script: 01A1CE4C
[22:57:44.528670] (system) ML-ReloadAll: Loaded successfully.
[22:57:44.528670] (system) Loading script 'D:\SAMP\moonloader\SF Integration.lua'...
[22:57:44.528670] (debug) New script: 01A1CFD4
[22:57:44.532671] (system) SF Integration: Loaded successfully.
[22:57:44.533671] (system) Loading script 'D:\SAMP\moonloader\show fps.lua'...
[22:57:44.533671] (debug) New script: 01A1D15C
[22:57:44.536671] (system) show hp: Loaded successfully.
[22:57:44.536671] (system) Loading script 'D:\SAMP\moonloader\show hp.lua'...
[22:57:44.536671] (debug) New script: 01A1D77C
[22:57:44.536671] (error) show hp.lua: D:\SAMP\moonloader\show hp.lua:16: '=' expected near 'result'
[22:57:44.536671] (error) show hp.lua: Script died due to an error. (01A1D77C)
[22:57:44.536671] (system) Loading script 'D:\SAMP\moonloader\TruckHUD.lua'...
[22:57:44.536671] (debug) New script: 01A1D77C
[22:57:44.549672] (system) TruckHUD: Loaded successfully.
[22:57:44.587674] (error) show hp: cannot resume non-suspended coroutine
stack traceback:
[C]: in function 'getCharPlayerIsTargeting'
D:\SAMP\moonloader\show fps.lua:15: in function <D:\SAMP\moonloader\show fps.lua:5>
[22:57:44.587674] (error) show hp: Script died due to an error. (01A1D15C)
[22:57:44.518670] (system) Gang helper: Script terminated. (01A1D77C)
[22:57:44.519670] (system) ML-ReloadAll: Script terminated. (01A1D15C)
[22:57:44.520670] (system) SF Integration: Script terminated. (01A1CFD4)
[22:57:44.520670] (system) Reconect: Script terminated. (01A1CE4C)
[22:57:44.521670] (system) TruckHUD: Script terminated. (01A1C82C)
[22:57:44.523670] (system) Loading script 'D:\SAMP\moonloader\gun help.lua'...
[22:57:44.523670] (debug) New script: 01A1C82C
[22:57:44.526670] (system) Gang helper: Loaded successfully.
[22:57:44.526670] (system) Loading script 'D:\SAMP\moonloader\reload_all.lua'...
[22:57:44.526670] (debug) New script: 01A1CE4C
[22:57:44.528670] (system) ML-ReloadAll: Loaded successfully.
[22:57:44.528670] (system) Loading script 'D:\SAMP\moonloader\SF Integration.lua'...
[22:57:44.528670] (debug) New script: 01A1CFD4
[22:57:44.532671] (system) SF Integration: Loaded successfully.
[22:57:44.533671] (system) Loading script 'D:\SAMP\moonloader\show fps.lua'...
[22:57:44.533671] (debug) New script: 01A1D15C
[22:57:44.536671] (system) show hp: Loaded successfully.
[22:57:44.536671] (system) Loading script 'D:\SAMP\moonloader\show hp.lua'...
[22:57:44.536671] (debug) New script: 01A1D77C
[22:57:44.536671] (error) show hp.lua: D:\SAMP\moonloader\show hp.lua:16: '=' expected near 'result'
[22:57:44.536671] (error) show hp.lua: Script died due to an error. (01A1D77C)
[22:57:44.536671] (system) Loading script 'D:\SAMP\moonloader\TruckHUD.lua'...
[22:57:44.536671] (debug) New script: 01A1D77C
[22:57:44.549672] (system) TruckHUD: Loaded successfully.
[22:57:44.587674] (error) show hp: cannot resume non-suspended coroutine
stack traceback:
[C]: in function 'getCharPlayerIsTargeting'
D:\SAMP\moonloader\show fps.lua:15: in function <D:\SAMP\moonloader\show fps.lua:5>
[22:57:44.587674] (error) show hp: Script died due to an error. (01A1D15C)