• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Code Callback - Passing Arguments?

Status
Not open for further replies.
Level 2
Joined
Jun 25, 2009
Messages
19
Okay, first of all, here's my code:

JASS:
call TimerStart(time, 10, false, function Revive_Player)

It starts a timer, called time, which is supposed to start the function Revive_Player after ten seconds. The problem is that the function needs to be passed variable, u, the unit to be revived. So I tried this:

JASS:
call TimerStart(time, 10, false, function Revive_Player(u))

Which gave the error:
Expected '

Also tried this:

JASS:
call TimerStart(time, 10, false, Revive_Player(u))

Which gave this error for the next line:
Invalid argument type (void)

So what is the proper way of doing it?
 
Status
Not open for further replies.
Top