请选择 进入手机版 | 继续访问电脑版

 找回密码
 点一下
查看: 1392|回复: 6

又有问题 各位大大看看

[复制链接]
发表于 2010-4-9 18:32:05 | 显示全部楼层 |阅读模式
我菜 勿笑
[jass]function SelectHero takes nothing returns nothing
    local integer i
    local timer tm=CreateTimer()
    set i = GetPlayerState(Player(i),PLAYER_STATE_RESOURCE_FOOD_USED) - 1
    call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_FOOD_USED,i)
    if i==0 then
    else
    call TimerStart( tm, 1.00, false,function SelectHero )
    endif
endfunction
function MobileCamp takes nothing returns nothing
    if IsPlayerAlly(GetTriggerPlayer(),Player(5)) ==true then
         call SetUnitPositionLoc( GetTriggerUnit(), Location(8590,8499))
    else
         call SetUnitPositionLoc( GetTriggerUnit(), Location(-8519,-8777))
    endif
endfunction
function invilization_1 takes nothing returns nothing
    local integer i=0
    local trigger SelectHero=CreateTrigger()         
    local timer tm=CreateTimer()
    call SetMapMusic( gg_snd_bgm, true, 0 )
    call PlayMusic( gg_snd_bgm )
    call TriggerRegisterEnterRectSimple( SelectHero, gg_rct_SelectHeroAura )
    call TriggerAddAction(SelectHero,function MobileCamp)
    call DestroyTrigger(gg_trg_GameInvilization)
    loop
        call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,1000)
        call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_FOOD_CAP,0)
        call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_FOOD_USED,20)
        set i=i+1
        exitwhen i>11
    endloop
    call TimerStart( tm, 1.00, false,function SelectHero )
endfunction

function invilization_all takes nothing returns nothing
    local trigger trg_invilization = CreateTrigger()
    call TriggerAddAction(trg_invilization,function invilization_1)
    call TriggerRegisterTimerEventSingle( trg_invilization, 0.01 )
endfunction
//===========================================================================
function InitTrig_GameInvilization takes nothing returns nothing
    set gg_trg_GameInvilization = CreateTrigger(  )
    call TriggerAddAction( gg_trg_GameInvilization, function invilization_all )
endfunction[/jass]
 楼主| 发表于 2010-4-9 19:53:11 | 显示全部楼层
为什么总是没人 GA人好少
回复

使用道具 举报

发表于 2010-4-9 20:04:40 | 显示全部楼层
其实这些用T都可以了............
自己把问题搞复杂了
回复

使用道具 举报

发表于 2010-4-9 20:48:26 | 显示全部楼层
请描述你的问题。
回复

使用道具 举报

 楼主| 发表于 2010-4-9 21:04:45 | 显示全部楼层
没效果了。
回复

使用道具 举报

发表于 2010-4-9 21:16:50 | 显示全部楼层
[jass]
function SelectHero takes nothing returns nothing
    local integer i
    local timer tm=CreateTimer()
    set i = GetPlayerState(Player(i),PLAYER_STATE_RESOURCE_FOOD_USED) - 1
    call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_FOOD_USED,i)
    if i==0 then
    else
    call TimerStart( tm, 1.00, false,function SelectHero )
    endif
endfunction
[/jass]
明显错了,i既是Player的索引,又是Player的FoodUsed。应该再声明一个integer用来存储Food或者玩家索引。
回复

使用道具 举报

 楼主| 发表于 2010-4-9 22:15:18 | 显示全部楼层
0.0 太感谢了
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-16 12:36 , Processed in 0.084818 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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