• 🏆 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!

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