• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] HELP! Scripting Bug!

Status
Not open for further replies.
Level 10
Joined
Jan 24, 2009
Messages
606
The Problem for me is that when it's Supose to let all Players use the Command it's only the first player who Write's it that will be transported Out of it... The script is in vJASS and it's Below(i think it's something with the Loop to do but not sure)



JASS:
scope FinishLoot initializer init
private function c takes nothing returns boolean
    local unit u=SystemTrace_dc(GetTriggerPlayer())
        if u!=null then
            call ItemLoot_clearitem(GetTriggerPlayer())
            call SetUnitPosition(u,-1104,1087)
            if GetTriggerPlayer()==GetLocalPlayer() then
                call PanCameraToTimed(-1104,1087,0)
            endif
            call SystemTrace_dr(u)
        endif
    set u=null
    return false
endfunction
private function init takes nothing returns nothing
    local trigger t=CreateTrigger()
    local integer i=0
    loop
    exitwhen i>10
        call TriggerRegisterPlayerChatEvent(t,Player(i),"-done",true)
        set i=i+1
    endloop
    call TriggerAddCondition(t,Condition(function c))
endfunction
endscope
 
Level 4
Joined
Apr 16, 2009
Messages
85
seems about right to me - i would just disable the trigger to prevent reuse or make a global variable and set it to false when anyone used that and check if it is false every time the trigger runs
 
Status
Not open for further replies.
Top