Код:
кто знает в чем трабл, не меняет героя на пуджика у даер
Код:
function GameMode:InitGameMode()
GameMode = self
DebugPrint('[BAREBONES] Starting to load Barebones gamemode...')
ListenToGameEvent("dota_player_pick_hero", OnHeroPicked, nil)
ListenToGameEvent('dota_player_pick_hero', Dynamic_Wrap(GameMode, 'OnHeroPicked'), self)
-- Commands can be registered for debugging purposes or as functions that can be called by the custom Scaleform UI
Convars:RegisterCommand( "command_example", Dynamic_Wrap(GameMode, 'ExampleConsoleCommand'), "A console command example", FCVAR_CHEAT )
DebugPrint('[BAREBONES] Done loading Barebones gamemode!\n\n')
end
function GameMode:OnHeroPicked()
local playerCnt = PlayerResource:GetPlayerCount()
for playerID = 0, playerCnt - 1 do
local player = PlayerInstanceFromIndex(playerID + 1) -- index = playerID + 1
local team = player:GetTeamNumber()
end
if team == DOTA_TEAM_BADGUYS then
PlayerResource:ReplaceHeroWith(playerID, "npc_dota_hero_pudge", 0, 0)
end
end