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

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

Ответ
 
kvaDrug

offline
Опыт: 1,601
Активность:
Не работает функция
Код:
function show_player_number takes nothing returns nothing
 local player p=GetLocalPlayer()
 call DisplayTimedTextToPlayer(p, 0, 0, 60, I2S(GetPlayerId(p)) )
endfunction

function InitTest takes nothing returns nothing
 local trigger t=CreateTrigger()
 call TriggerAddAction(t, function show_player_number)
 call TriggerRegisterPlayerUnitEvent(t, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 call TriggerRegisterPlayerUnitEvent(t, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 call TriggerRegisterPlayerUnitEvent(t, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 call TriggerRegisterPlayerUnitEvent(t, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 call TriggerRegisterPlayerUnitEvent(t, Player(4), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 call TriggerRegisterPlayerUnitEvent(t, Player(5), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 call TriggerRegisterPlayerUnitEvent(t, Player(6), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 call TriggerRegisterPlayerUnitEvent(t, Player(7), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 call TriggerRegisterPlayerUnitEvent(t, Player(8), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 call TriggerRegisterPlayerUnitEvent(t, Player(9), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 call TriggerRegisterPlayerUnitEvent(t, Player(10), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 call TriggerRegisterPlayerUnitEvent(t, Player(11), EVENT_PLAYER_UNIT_SPELL_CAST, null)
 set t=null
endfunction


В чем тут может быть дело? (При касте спела должен выводится номер игрока)
Старый 19.10.2008, 16:39
agentex

offline
Опыт: 34,834
Активность:
попробуй GetLocalPlayer() заменить GetOwningPlayer(GetTriggerUnit())
Старый 19.10.2008, 16:46
J
expert
offline
Опыт: 48,447
Активность:
Код:
function show_player_number takes nothing returns nothing
    call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, I2S(GetPlayerId(GetOwningPlayer(GetTriggerUnit()))))
endfunction
Старый 19.10.2008, 16:49
Ответ

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

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

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

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



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