Raised This Month: $ Target: $400
 0% 

passing ids thru set_task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 10-15-2006 , 22:51   passing ids thru set_task
Reply With Quote #1

How would I pass a targetid and id using set_task or a different way
PHP Code:
public item_carbomb(){
    new 
arg[33], caridcaridFloat:origin[3], tauthid[64], enttid
    read_argv
(1,arg,32)
    
id str_to_num(arg)
    
    
ent entity_get_vector(id,EV_VEC_origin,origin);
    
tid get_id_by_steamid(tauthid)
    
get_user_aiming(id,carid,car,100)
    if(
carid == ent)
    {
        
client_print(id,print_chat,"[CarMod] You're setting up the bomb....")
        
setbomb(id,tid)
        return 
PLUGIN_HANDLED
    
}
    else
    {
        
client_print(id,print_chat,"[CarMod] You need to be near a car.")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}

public 
setbomb(id,tid)
{
    
client_print(id,print_chat,"[CarMod] You set up the bomb!")
    
hasbomb[tid] += 1
    
return PLUGIN_HANDLED

I want it to wait like 10 seconds before it sets up the bomb.
wonsae is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-15-2006 , 23:29   Re: passing ids thru set_task
Reply With Quote #2

Code:
your_function()
{
  //you have stuff here
  new parm[2]
  parm[0] = id
  parm[1] = tid
  set_task(10.0,"setbomb",0,parm,2)
}
public setbomb(parm[])
{
    new id = parm[0]
    new tid = parm[1]

    client_print(id,print_chat,"[CarMod] You set up the bomb!")
    hasbomb[tid] += 1
    return PLUGIN_HANDLED
}

Last edited by Emp`; 10-15-2006 at 23:32.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 10-16-2006 , 06:56   Re: passing ids thru set_task
Reply With Quote #3

thanks, I'll try it
wonsae is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode