找回密码
 点一下
查看: 1629|回复: 3

求救,有什么方法可以获得玩家选中的单位啊,或者可以获得玩家拥有的英雄

[复制链接]
发表于 2011-7-8 13:09:25 | 显示全部楼层 |阅读模式
RT:如题。。。。
 楼主| 发表于 2011-7-8 15:24:26 | 显示全部楼层
唉~木有人回答,管理们千万别怪jass冷,问的问题都没人答怎么会不冷,昨天一个,今天一个都没得到想要的答案。。。
回复

使用道具 举报

发表于 2011-7-13 00:55:46 | 显示全部楼层
[jass]function GetUnitsSelectedAll takes player whichPlayer returns group
    local group g = CreateGroup()
    call SyncSelections()
    call GroupEnumUnitsSelected(g, whichPlayer, null)
    return g
endfunction

function TriggerRegisterPlayerSelectionEventBJ takes trigger trig, player whichPlayer, boolean selected returns event
    if selected then
        return TriggerRegisterPlayerUnitEvent(trig, whichPlayer, EVENT_PLAYER_UNIT_SELECTED, null)
    else
        return TriggerRegisterPlayerUnitEvent(trig, whichPlayer, EVENT_PLAYER_UNIT_DESELECTED, null)
    endif
endfunction[/jass]

lz想要的,应该就是这些当中的部分呢~
回复

使用道具 举报

发表于 2011-8-7 08:36:15 | 显示全部楼层
很简单    用1个全局变量

比如 玩家1选择 1个单位 设置 这个变量等于触发单位

然后  你比如想对 玩家1选中的单位  升级 加属性 都随便你了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-3 23:53 , Processed in 0.106132 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表