XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > Warcraft> Академия: форум для вопросов> Jass
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

Ответ
 
umbrella_gaming
Мировое господство
offline
Опыт: 2,592
Активность:
Работает только у красного игрока
подскажите пожалуйста почему неработает получение ресурсов у других игроков
((код jass
function Trig_dok_info_Opakil takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(pl, PLAYER_STATE_RESOURCE_LUMBER) + udg_trans[a] * 50)

-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFF00C850" + ( I2S(( udg_trans[a] * 50 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function Trig_dok_info_Opakil1 takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans1[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(pl, PLAYER_STATE_RESOURCE_LUMBER) + udg_trans1[a] * 100)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFF00C850" + ( I2S(( udg_trans1[a] * 100 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function Trig_dok_info_Opakil2 takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans2[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(pl, PLAYER_STATE_RESOURCE_LUMBER) + udg_trans2[a] * 150)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFF00C850" + ( I2S(( udg_trans2[a] * 150 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function Trig_dok_info_Opakil3 takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans3[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(pl, PLAYER_STATE_RESOURCE_LUMBER) + udg_trans3[a] * 250)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFF00C850" + ( I2S(( udg_trans3[a] * 250 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
////ЗОЛОТО
function GOLDL takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans4[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD) + udg_trans4[a] * 2)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFFFFFF00" + ( I2S(( udg_trans4[a] * 2 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function GOLDL2 takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans5[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD) + udg_trans5[a] * 3)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFFFFFF00" + ( I2S(( udg_trans5[a] * 3 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function GOLDL3 takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans6[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD) + udg_trans6[a] * 4)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFFFFFF00" + ( I2S(( udg_trans6[a] * 4 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function GOLDL4 takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans7[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD) + udg_trans7[a] * 5)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFFFFFF00" + ( I2S(( udg_trans7[a] * 5 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function GOLDL5 takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans8[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD) + udg_trans8[a] * 6)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFFFFFF00" + ( I2S(( udg_trans8[a] * 6 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function GOLDL6 takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans9[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD) + udg_trans9[a] * 10)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFFFFFF00" + ( I2S(( udg_trans9[a] * 10 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function GOLDL7 takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans10[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD) + udg_trans10[a] * 16)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFFFFFF00" + ( I2S(( udg_trans10[a] * 16 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function GOLDL8 takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans11[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD) + udg_trans11[a] * 32)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFFFFFF00" + ( I2S(( udg_trans11[a] * 32 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function GOLDL9 takes unit pick, player pl, integer a, real x, real y returns nothing
set udg_TempUnit_HP = GetUnitState(pick,UNIT_STATE_MAX_LIFE)
if udg_trans12[a] > 0 then
call SetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pl, PLAYER_STATE_RESOURCE_GOLD) + udg_trans12[a] * 47)
-------------------------
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, ( "|cFFFFFF00" + ( I2S(( udg_trans12[a] * 47 )) + "|r" ) ), 0.023)
call SetTextTagPos(bj_lastCreatedTextTag, x, y, 0)
call SetTextTagColor(bj_lastCreatedTextTag, 255, 255, 255, 255)
-------------------------
call SetTextTagVelocity(bj_lastCreatedTextTag, 0.0,0.03)
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, udg_String_Duration )
call SetTextTagFadepoint( bj_lastCreatedTextTag, 1.65 )
set bj_lastCreatedTextTag = null
-------------------------
endif
endfunction
function Trig_dok_info_Func001A takes nothing returns nothing
local unit pick=GetEnumUnit()
local player pl=GetOwningPlayer(pick)
local integer a=GetPlayerId(pl)+1
local real x=GetUnitX(pick)
local real y=GetUnitY(pick)
local integer typeUnit=GetUnitTypeId(pick)
if typeUnit == 'h02S' then
call Trig_dok_info_Opakil(pick,pl,a,x,y)
else
if typeUnit == 'h02R' then
call Trig_dok_info_Opakil1(pick,pl,a,x,y)
else
if typeUnit == 'h02P' then
call Trig_dok_info_Opakil2(pick,pl,a,x,y)
else
if typeUnit == 'h035' then
call Trig_dok_info_Opakil3(pick,pl,a,x,y)

// GOLD
else
if typeUnit == 'e017' then
call GOLDL(pick,pl,a,x,y)

else
if typeUnit == 'e018' then
call GOLDL2(pick,pl,a,x,y)

else
if typeUnit == 'e019' then
call GOLDL3(pick,pl,a,x,y)

else
if typeUnit == 'e01A' then
call GOLDL4(pick,pl,a,x,y)

else
if typeUnit == 'e01B' then
call GOLDL5(pick,pl,a,x,y)

else
if typeUnit == 'e01C' then
call GOLDL6(pick,pl,a,x,y)

else
if typeUnit == 'e01D' then
call GOLDL7(pick,pl,a,x,y)

else
if typeUnit == 'e01E' then
call GOLDL8(pick,pl,a,x,y)

else
if typeUnit == 'e015' then
call GOLDL9(pick,pl,a,x,y)

endif

endif

endif
endif
endif

endif

endif

endif

endif

endif

endif
endif
endif

set pick=null
set pl=null
endfunction
function Trig_dok_info_Actions takes nothing returns nothing
local group g = CreateGroup()

call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, filterGetUnitsInRectOfPlayer)
call ForGroup( g, function Trig_dok_info_Func001A )
call DestroyBoolExpr(filterGetUnitsInRectOfPlayer)
call DestroyGroup(g)
set g=null
endfunction
===========================================================================
function InitTrig_dok_info takes nothing returns nothing
set gg_trg_dok_info = CreateTrigger( )
call TriggerRegisterTimerEvent(gg_trg_dok_info, 1.00, true)
call TriggerAddAction( gg_trg_dok_info, function Trig_dok_info_Actions )
endfunction
))
Старый 12.08.2013, 10:11
Faion
Noblesse Oblige
offline
Опыт: 30,395
Активность:
Не вижу отладочных сообщений.
Старый 12.08.2013, 10:46
DioD

offline
Опыт: 45,134
Активность:
читаем, вставляем отладочный выход, думаем
тему не закрываю, однако писать в неё до ответа автора или включения отладки в первый пост запрещено, буду штрафовать@удалять
Старый 12.08.2013, 14:46
umbrella_gaming
Мировое господство
offline
Опыт: 2,592
Активность:
уже нашел....
Старый 12.08.2013, 15:00
Ответ

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 20:25.