В связи с чем?Как вывести игроку сообщение такое как "Недостаточно золота"?
GameRules:SendCustomMessage("bla bla bla", 0, 0)
function vengefulspirit_nether_swap_lua:CastFilterResultTarget( hTarget )
if self:GetCaster() == hTarget then
return UF_FAIL_CUSTOM
end
if ( hTarget:IsCreep() and ( not self:GetCaster():HasScepter() ) ) or hTarget:IsAncient() then
return UF_FAIL_CUSTOM
end
local nResult = UnitFilter( hTarget, DOTA_UNIT_TARGET_TEAM_BOTH, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_CREEP, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, self:GetCaster():GetTeamNumber() )
if nResult ~= UF_SUCCESS then
return nResult
end
return UF_SUCCESS
end
function vengefulspirit_nether_swap_lua:GetCustomCastErrorTarget( hTarget )
if self:GetCaster() == hTarget then
return "#dota_hud_error_cant_cast_on_self"
end
if hTarget:IsAncient() then
return "#dota_hud_error_cant_cast_on_ancient"
end
if hTarget:IsCreep() and ( not self:GetCaster():HasScepter() ) then
return "#dota_hud_error_cant_cast_on_creep"
end
return ""
end
Это хорошо, что можно возвращать стандартные сообщения, а как сделать свои. Чтобы вместо "Недостаточно золота" я мог написать что то свое
function loki_replicate:CastFilterResultTarget( hTarget )
if self:GetCaster() == hTarget then
return UF_FAIL_CUSTOM
end
if hTarget:IsIllusion() then
return UF_FAIL_CUSTOM
end
if ( hTarget:IsCreep() and ( not self:GetCaster():HasScepter() ) ) or hTarget:IsAncient() then
return UF_FAIL_CUSTOM
end
if hTarget:GetUnitName() == "npc_dota_hero_pudge" then
return UF_FAIL_CUSTOM
end
if hTarget:HasModifier("modifier_arc_warden_tempest_double") then
return UF_FAIL_CUSTOM
end
if hTarget:GetUnitName() == "npc_dota_hero_necrolyte" then
return UF_FAIL_CUSTOM
end
if hTarget:GetUnitName() == "npc_dota_hero_skeleton_king" then
return UF_FAIL_CUSTOM
end
local nResult = UnitFilter( hTarget, DOTA_UNIT_TARGET_TEAM_BOTH, DOTA_UNIT_TARGET_HERO , DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, self:GetCaster():GetTeamNumber() )
if nResult ~= UF_SUCCESS then
return nResult
end
return UF_SUCCESS
end
--------------------------------------------------------------------------------
function loki_replicate:GetCustomCastErrorTarget( hTarget )
if self:GetCaster() == hTarget then
return "#dota_hud_error_cant_cast_on_self"
end
if hTarget:GetUnitName() == "npc_dota_hero_skeleton_king" then
return "#dota_hud_error_cant_cast_on_lich"
end
if hTarget:GetUnitName() == "npc_dota_hero_necrolyte" then
return "#dota_hud_error_cant_cast_on_vitiate"
end
if hTarget:GetUnitName() == "npc_dota_hero_pudge" then
return "#dota_hud_error_cant_cast_on_pudge"
end
if hTarget:HasModifier("modifier_arc_warden_tempest_double") then
return "#dota_hud_error_already_dublicate"
end
if hTarget:IsAncient() then
return "#dota_hud_error_cant_cast_on_ancient"
end
if hTarget:IsIllusion () then
return "#dota_hud_error_cant_cast_on_illusion"
end
if hTarget:IsCreep() and ( not self:GetCaster():HasScepter() ) then
return "#dota_hud_error_cant_cast_on_creep"
end
return ""
end
"dota_hud_error_cant_cast_on_pudge" "Нельзя скопироовать Паджика"
"dota_hud_error_cant_cast_on_zoom" "Нельзя использовать на Зума"
Что то я искал искал, но заветную строку так и не нашел![]()
if hTarget:GetUnitName() == "npc_dota_hero_skeleton_king" then
return UF_FAIL_CUSTOM
end
"dota_hud_error_cant_cast_on_pudge" "Нельзя скопироовать Паджика"
"dota_hud_error_cant_cast_on_zoom" "Нельзя использовать на Зума"
if hTarget:GetUnitName() == "npc_dota_hero_necrolyte" then
return "#dota_hud_error_cant_cast_on_vitiate"
end