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

我的这些jass语句到底那里出错了?

[复制链接]
发表于 2008-7-9 14:12:00 | 显示全部楼层 |阅读模式
function Trig____________________001_Actions takes nothing returns nothing
    if ( Trig____________________001_Func001C() ) then
        call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_019" )
        call TriggerSleepAction( 20.00 )
        call ReviveHeroLoc( GetTriggerUnit(), GetRectCenter(gg_rct______________000), true )
        call DisplayTextToForce( GetPlayersAll(), ( "很好," + ( GetPlayerName(GetOwningPlayer(GetTriggerUnit())) + "复活了~" ) ) )
    else
        call TriggerSleepAction( 20.00 )
        if ( Trig____________________001_Func001Func007C() ) then
            call DisplayTextToForce(GetPlayersAll(),"Stand up.")
            call CreateUnitAtLoc(Player(1),'ugho',GetUnitLoc(GetTriggerUnit()),0.00)
        else
        endif
        if ( Trig____________________001_Func001Func008C() ) then
            local location loc=GetUnitLoc(GetTriggerUnit())
            call CreateItem('gold', GetLocationX(loc), GetLocationY(loc))
            call RemoveLocation(loc)

        else
        endif
    endif
endfunction
发表于 2008-7-9 14:47:47 | 显示全部楼层
  1. call CreateItem('gold', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
复制代码



变量必须在最前面申明。
回复

使用道具 举报

发表于 2008-7-9 15:10:48 | 显示全部楼层
ls引用错掉了,应该是
[codes=jass]local location loc=GetUnitLoc(GetTriggerUnit()) [/codes]

局部变量必须在函数顶部声明

可以这样,在顶部只写local location loc
在你现在声明的地方写set loc = GetUnitLoc(GetTriggerUnit())
回复

使用道具 举报

 楼主| 发表于 2008-7-9 15:43:49 | 显示全部楼层
这样啊,我去试试了~~
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-20 22:16 , Processed in 0.093254 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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