function OnUsedAbility(keys)
print('------------------------------------------------------------')
for i,x in pairs(keys) do print(i,x)
print('------------------------------------------------------------');
end
for i,x in pairs(keys) do print(i,x)
function main:InitGameMode()
GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_GOODGUYS, 3 )
GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_BADGUYS, 3 )
ListenToGameEvent("dota_player_killed", Dynamic_Wrap(main, "OnHeroKilled"), self)
ListenToGameEvent('dota_player_used_ability', OnUsedAbility, self)
end
function OnUsedAbility(keys)
Say(nil, "ON USED ABILITY", false)
print('------------------------------------------------------------')
for i,x in pairs(keys) do print(i,x)
print('------------------------------------------------------------');
hero :RemoveModifierByName("modifier_templar_assassin_refraction_damage")
end
print('------------------------------------------------------------')
print(i,x)
print('------------------------------------------------------------');
[ VScript ]: ------------------------------------------------------------
[ VScript ]: nil nil
[ VScript ]: ------------------------------------------------------------
function main:InitGameMode()
GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_GOODGUYS, 3 )
GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_BADGUYS, 3 )
ListenToGameEvent("dota_player_killed", Dynamic_Wrap(main, "OnHeroKilled"), self)
ListenToGameEvent("dota_player_used_ability", Dynamic_Wrap(main, "OnUsedAbility"), self)
end
function main:OnUsedAbility(keys)
print("--------------------------"ON USED ABILITY"----------------------------------")
for k,v in pairs(keys) do
print(k,v)
end
print("------------------------------------------------------------");
end
function main:OnHeroKilled(keys)
print("--------------------------"OnHeroKilled"----------------------------------")
end
for i,x in pairs(keys) do print(i,x)
function main:InitGameMode()
GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_GOODGUYS, 3 )
GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_BADGUYS, 3 )
ListenToGameEvent("dota_player_killed", Dynamic_Wrap(main, "OnHeroKilled"), self)
ListenToGameEvent('dota_player_used_ability', OnUsedAbility, self)
end
function OnUsedAbility(keys)
Say(nil, "ON USED ABILITY", false)
print('------------------------------------------------------------')
for i,x in pairs(keys) do print(i,x)
print('------------------------------------------------------------');
hero :RemoveModifierByName("modifier_templar_assassin_refraction_damage")
end
for i,x in pairs(keys) do print(i,x)
for i,x in pairs(keys) do print(i,x) end
он описан, я скинул только действующий кодТебе бы статью по lua почитать.
Чего у тебя не описан OnHeroKilled?
for i,x in pairs(keys) do print(i,x)
for i,x in pairs(keys) do print(i,x) end
[ VScript ]: ------------------------------------------------------------
[ VScript ]: __class__ table: 0x001b8628
[ VScript ]: __getbase__ function: 0x001b2e68
[ VScript ]: __getclass__ function: 0x001bcd30
[ VScript ]: __initprops__ table: 0x001f0048
[ VScript ]: __instanceof__ function: 0x001d4f98
[ VScript ]: OnHeroKilled function: 0x001f11a8
[ VScript ]: InitGameMode function: 0x001f1080
[ VScript ]: ------------------------------------------------------------
[ VScript ]: EntIndexToHScript parameter 1: expected integer but got void.
[ Developer ]: ...me\dota_addons\zipn\scripts\vscripts\addon_game_mode.lua:113: Parameter type mismatch
[ Developer ]: stack traceback:
[ Developer ]: [C]: in function 'EntIndexToHScript'
[ Developer ]: ...me\dota_addons\zipn\scripts\vscripts\addon_game_mode.lua:113: in function <...me\dota_addons\zipn\scripts\vscripts\addon_game_mode.lua:104>
[ W VScript ]: Script Runtime Error: ...me\dota_addons\zipn\scripts\vscripts\addon_game_mode.lua:113: Parameter type mismatch
[ W VScript ]: stack traceback:
[ W VScript ]: [C]: in function 'EntIndexToHScript'
[ W VScript ]: ...me\dota_addons\zipn\scripts\vscripts\addon_game_mode.lua:113: in function <...me\dota_addons\zipn\scripts\vscripts\addon_game_mode.lua:104>
Так, скидывай код полного файла, ибо я вижу что ты пытаешься вывести содержимое _G, что довольно странно.вроде но сложная проблема, указать в переменной кастера....
function Activate()
GameRules.main = main()
GameRules.main:InitGameMode()
end
function main:OnUsedAbility(keys)
local player = PlayerResource:GetPlayer( keys.PlayerID )
local ability_name = keys.abilityname
if not player or not ability_name or not IsValidEntity(player) then return end
local hero = PlayerResource:GetSelectedHeroEntity(keys.PlayerID)
if not hero then return end
print('-------------USED ABILITY----------');
for i,x in pairs(keys) do print(i,x) end
print('-----------------------------------------');
end