找回密码
 点一下
查看: 944|回复: 4

关于可以A小兵不能打己方英雄j的问题

[复制链接]
发表于 2011-9-16 13:44:12 | 显示全部楼层 |阅读模式
在地图中添加了一段可以A小兵不能打己方英雄的j,然后保存的时候jasshelper显示Too
many arguement given to function:GetUnitLifePercent

代码:
function Trig_Prevent_Team_KillActions takes nothing returns nothing
    if ((IsPlayerAlly(GetOwningPlayer(GetAttacker()), GetOwningPlayer(GetTriggerUnit())) == true) and (GetUnitLifePercent(whichUnit, UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE) > 41.00)) then
        call IssueTargetOrder( GetAttacker(), "move", GetTriggerUnit() )
    else
        if ((IsPlayerAlly(GetOwningPlayer(GetAttacker()), GetOwningPlayer(GetTriggerUnit())) == true) and (IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) != true) and (GetUnitLifePercent(whichUnit, UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE) <= 40.00)) then
            call IssueTargetOrder( GetAttacker(), "attack", GetTriggerUnit() )
        else
        endif
    endif
endfunction

//===========================================================================
function InitTrig_Prevent_Team_Kill takes nothing returns nothing
    set gg_trg_Prevent_Team_Kill = CreateTrigger()
    call YDWESaveTriggerName(gg_trg_Prevent_Team_Kill, "Prevent Team Kill")
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Prevent_Team_Kill, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddAction(gg_trg_Prevent_Team_Kill, function Trig_Prevent_Team_KillActions)
endfunction
主要是这段 if ((IsPlayerAlly(GetOwningPlayer(GetAttacker()), GetOwningPlayer(GetTriggerUnit())) == true) and (GetUnitLifePercent(whichUnit, UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE) > 41.00)) then
求解
发表于 2011-9-16 14:43:29 | 显示全部楼层
GetUnitLifePercent()这个函数只需要unit一个变量。
回复

使用道具 举报

发表于 2011-9-19 17:47:47 | 显示全部楼层
Too
many arguement given to function:GetUnitLifePercent
金山翻译..
太多分析一个惯于功能:getunitlifepercent

表示一个翻译器.可以解决很多问题.
回复

使用道具 举报

发表于 2011-9-19 18:31:37 | 显示全部楼层
ls是来搞笑的么。。
回复

使用道具 举报

发表于 2011-9-19 19:08:43 | 显示全部楼层
翻译机威武……
过多参数传入函数:GetUnitLifePercent
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-10-5 20:23 , Processed in 0.064755 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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