Raised This Month: $ Target: $400
 0% 

Pass params w/ set_task...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 06-07-2004 , 15:01   Pass params w/ set_task...
Reply With Quote #1

I've got a function called
ohh_that_tickles(vIndex)

and I want to do a set task on that function, but I need to set the index of the player its going to be called on. I keep trying to pass the params in the set_task function, but cannot get it to work...

Code:
set_task(0.4,"ohh_that_tickles", 0, vIndex)
[/small]
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-07-2004 , 15:38  
Reply With Quote #2

params to set tack have to be passed as an array.

Code:
ohh_that_tickles(vIndex[1])
Code:
new vIndexa[1]
vIndexa[0] = vIndex
set_task(0.4,"ohh_that_tickles", 0, vIndexa)
like that
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
SidLuke
Senior Member
Join Date: Mar 2004
Location: Poland, Chrzanow
Old 06-07-2004 , 17:29   Re: Pass params w/ set_task...
Reply With Quote #3

jtp10181 is right but try:
Code:
set_task(0.4,"ohh_that_tickles", vIndex) public ohh_that_tickles(id){ //code }
SidLuke is offline
Send a message via AIM to SidLuke Send a message via MSN to SidLuke
ts2do
Senior Member
Join Date: Mar 2004
Old 06-07-2004 , 20:20  
Reply With Quote #4

also if you have many tasks and want to remove one I suggest using something like this for a few
Code:
set_task(0.4,"ohh_that_tickles", vIndex+1234) public ohh_that_tickles(id){ id-=1234 //code }
__________________
ts2do is offline
Send a message via AIM to ts2do
SidLuke
Senior Member
Join Date: Mar 2004
Location: Poland, Chrzanow
Old 06-07-2004 , 20:36  
Reply With Quote #5

Quote:
Originally Posted by ts2do
also if you have many tasks and want to remove one I suggest using something like this for a few
Code:
set_task(0.4,"ohh_that_tickles", vIndex+1234) public ohh_that_tickles(id){ id-=1234 //code }
or
Code:
#define TICKLES_OFFSET 1234 set_task(0.4,"ohh_that_tickles", vIndex+TICKLES_OFFSET) public ohh_that_tickles(id){ id -= TICKLES_OFFSET //code }
SidLuke is offline
Send a message via AIM to SidLuke Send a message via MSN to SidLuke
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 06-07-2004 , 22:29  
Reply With Quote #6

Thanks guys. Real help.

Any idea what params are passed on DeathMSG?

I know how to do read_data, but could someone point me in a direction?
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
ts2do
Senior Member
Join Date: Mar 2004
Old 06-07-2004 , 23:34  
Reply With Quote #7

1 = killer
2 =victim
3=headshot
4=weapon
__________________
ts2do is offline
Send a message via AIM to ts2do
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 06-07-2004 , 23:40  
Reply With Quote #8

Nice, thanks a lot.

Not too long until its done and ready for a beta release ;)

and its SO simple! (Sorry for all the Q's...I'm rusty...since AMXX came about, I got divided on coding so I decided to wait until things had settled down again and here we are)
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 06-07-2004 , 23:43  
Reply With Quote #9

Can you pass multiple params?...and how?
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
[FBX]
Senior Member
Join Date: May 2004
Old 06-08-2004 , 00:24  
Reply With Quote #10

set_task(float(time), stringfunctionname[], stringarguments[], intnumofarguments)

the difficult part is passing multiple arrays. Lets say you pass two size 40 arrays, then stringarguments should be those two concatinated together with the first starting at stringarguments[0] and the 2nd starting at stringarguments[20]. intnumofarguments would then be 40.
[FBX] is offline
Reply



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 14:49.


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