WarCraft: Source

 

Delayed

Page history last edited by Anonymous 1 yr ago

Delayed

 


 

This command allows for you to call a fuction after X amount of seconds have passed. The advantage to using this over something like gamethread is that the delay is not fired if said user dies or if the round ends.

 

The correct syntax is:

 

wcs.Command(<userid>).Delayed(<time>, <function>, [parameters], [endround])

 

  • Userid - The player that you want the delay command linked to
  • Time - The time to wait to call the function
  • Fuction - The fuction that will be called after said time expires
  • Parameters - The parameters to pass into the called function
  • Endround - This means the delay stops at the end of the round instead of when the userid dies

 


Example:

 

def item_pickup(ev):

    if ev["item"] == "weapon_awp":

        wcs.Command(ev['userid']).Delayed(5, es.server.queuecmd, 'est_removeweapon %s weapon_awp'%ev['userid'])

        # Removes a user's awp after 5 seconds

 

Comments (0)

You don't have permission to comment on this page.