• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Function

Status
Not open for further replies.
Level 5
Joined
Oct 15, 2009
Messages
136
could you please tell me how do I make that this info only shows whenever the players press the ESC key?

JASS:
scope Test initializer init    
    function init takes nothing returns nothing
        local string array Status
        local string t = "|c009999ffCurrent Status: |r"
        local integer confirm = GetRandomInt(1, 2) //1(True), 2(False)
        local integer index = 0
            if(confirm == 1) then
                call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, t + "Avaliable")
                call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "|c009999ff========================|r")
            
                set Status[index] = "|c009999ffName:|r GasQueen"
                set Status[index+1] = "|c009999ffAge:|r 16"
                set Status[index+2] = "|c009999ffLocation:|r Argentina"
                set Status[index+3] = "|c009999ffOccupation:|r Student"
                    loop
                        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, Status[index])
                        set index = index + 1 
                        exitwhen index == 4
                    endloop  
            else
                call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, t + "Not Avaliable")
            endif
    endfunction
endscope
 
JASS:
scope Test initializer Init    
    function Info takes nothing returns nothing
        local string array Status
        local string t = "|c009999ffCurrent Status: |r"
        local integer confirm = GetRandomInt(1, 2) //1(True), 2(False)
        local integer index = 0
            if(confirm == 1) then
                call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, t + "Avaliable")
                call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "|c009999ff========================|r")
            
                set Status[index] = "|c009999ffName:|r GasQueen"
                set Status[index+1] = "|c009999ffAge:|r 16"
                set Status[index+2] = "|c009999ffLocation:|r Argentina"
                set Status[index+3] = "|c009999ffOccupation:|r Student"
                    loop
                        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, Status[index])
                        set index = index + 1 
                        exitwhen index == 4
                    endloop  
            else
                call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, t + "Not Avaliable")
            endif
    endfunction
    
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 11
        loop
            if GetPlayerSlotState(Player(i))==PLAYER_SLOT_STATE_PLAYING and GetPlayerController(Player(i))==MAP_CONTROL_USER then
                call TriggerRegisterPlayerEvent(t,Player(i),EVENT_PLAYER_END_CINEMATIC)
            endif
            exitwhen i == 0
            set i = i - 1
        endloop
        call TriggerAddAction(t,function Info)
    endfunction
endscope

This should work. :)
 
Level 5
Joined
Oct 15, 2009
Messages
136
It surely worked fine; I asked this cause I haven't reach to triggers yet. And I didn't really know how to make things like this. Thanks.
 
Status
Not open for further replies.
Top