• 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] Funny JASS code

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
function Work takes everything returns nothing
Syntax error, everything is not a valid type. You need a type before it.

Is this a global or local or what?
If it is a local it is a syntax error as there is no hours difined at the start of the function.
If it is a global your loop will only work the first function call as you never set hours back to 0.

call DoNothing( )
Does nothing but an empty function call. Just delete it as it has no use in JASS.
 
Level 11
Joined
Mar 31, 2009
Messages
732
JASS:
function Work takes effort everything returns nothing
    local integer hours = 0
    
    loop
        exitwhen (hours > 8 + udg_overtime)
        DisplayTextToForce(GetPlayerByName("Boss"), "Today my team has created a timeline and established our resource needs. Tomorrow we plan to revise our timeline and reestablish our resource needs.")
        set hours = hours + 1
    endloop
 
    if udg_DaysWorked = 10 then
        call Payday( )
    endif
 
    set udg_DaysWorked = udg_DaysWorked + 1
endfunction

Request fulfilled. Code is not MUI and MPI and stuff.
 
Level 4
Joined
Feb 16, 2010
Messages
114
make it a:
function Work takes unit returns nothing
//unit = person
and everyone's happy :D
I'm new at scripting but this is just... funny :D .
 
Status
Not open for further replies.
Top