-
Автор темы
- #1
ибо я овощь безмозглый надо пофиксить луашку длинной в целых 16 строк!
при убийстве выдает такой высер в консоль :(
[neverlose.cc][Lua]Paste goes wrong at lua(draw callback) Healthshot Effect: stack index 3, expected number, received no value: not a numeric type (bad argument into 'int(const char *, int)')
stack traceback:
[C]: in function 'GetInt'
[string "local enable = cheat.Checkbo..."]:6: in function <[string "local enable = cheat.Checkbo..."]:4>
памагите...
Код:
local enable = cheat.Checkbox("Healthshot")
local duration = cheat.SliderFloat("Effect Duration", 0, 2)
local function on_event(e)
if e:GetName() == "player_death" and enable:GetBool() then
local iVictim = g_EntityList.GetClientEntity(g_EngineClient.GetPlayerForUserId(e:GetInt("userid")))
local iAttacker = g_EntityList.GetClientEntity(g_EngineClient.GetPlayerForUserId(e:GetInt("attacker")))
local player = g_EntityList.GetClientEntity(g_EngineClient.GetLocalPlayer())
if iAttacker == player and iVictim ~= player then
player:SetProp("DT_CSPlayer", "m_flHealthShotBoostExpirationTime", g_GlobalVars.curtime + duration:GetFloat())
end
end
end
cheat.RegisterCallback("events", on_event)
[neverlose.cc][Lua]Paste goes wrong at lua(draw callback) Healthshot Effect: stack index 3, expected number, received no value: not a numeric type (bad argument into 'int(const char *, int)')
stack traceback:
[C]: in function 'GetInt'
[string "local enable = cheat.Checkbo..."]:6: in function <[string "local enable = cheat.Checkbo..."]:4>
памагите...