Raised This Month: $51 Target: $400
 12% 

task on two id's ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Salamon
Senior Member
Join Date: Dec 2007
Location: P(r)oland
Old 06-27-2008 , 15:17   task on two id's ?
Reply With Quote #1

how create a task on two ids? i mean when im doing a task on 1 id i do set_task(1.0, "bla", id)

public bla(id)

what to do to find 2 id's from public like public bla(id, idtwo)
__________________
This is 10% luck, 20% skill, 15% concentrated power of will,
5% pleasure, 50% pain and 100% reason to remember my name..
Salamon is offline
shine771
Senior Member
Join Date: Jun 2007
Old 06-27-2008 , 15:54   Re: task on two id's ?
Reply With Quote #2

Quote:
set_task(1.0,"lalala",id+1000")
public lalala(taskid) {
new id = taskid-1000
}
shine771 is offline
Salamon
Senior Member
Join Date: Dec 2007
Location: P(r)oland
Old 06-27-2008 , 16:30   Re: task on two id's ?
Reply With Quote #3

but i dont know the "1000" number... im using it in fakemeta forward touch when we have ptr and ptd, toucher and touched

and i need to make a task from it to both 'things', ptr and ptd, and i dont know they id, i can make set_task(1.0, "blabla", ptr+ptd) but still dunno how to calculate both from it....
__________________
This is 10% luck, 20% skill, 15% concentrated power of will,
5% pleasure, 50% pain and 100% reason to remember my name..
Salamon is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 06-27-2008 , 16:31   Re: task on two id's ?
Reply With Quote #4

Code:
public function1() {      //assuming you get id and id2      new param[2];      param[0] = id;      param[1] = id2;      set_task( 1.0 , "function2" , _ , param , 2 ); } public function2( param[] , size ) {      new id, id2;      id = param[0];      id = param[1];      //rest of your function }

At first I went and did math to get a taskid with two id's embedded into it. After I finished typing it, I then remembered you can pass an array.
I was actually pretty crafty with it too. Using the not-so-used-but-should-be-more-often modulus(%).
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Salamon
Senior Member
Join Date: Dec 2007
Location: P(r)oland
Old 06-27-2008 , 16:34   Re: task on two id's ?
Reply With Quote #5

this will make it yup ?

public Forward_Touch(ptr, ptd)
{
new param[2];
param[0] = ptr;
param[1] = ptd;
set_task( 1.0 , "function2" , _ , param , 2 );
}

public function2( param[] , size )
{
new id, id2;
id = param[0];
id2 = param[1];
//rest of your function
}

// nvm WORKING, big thanks :] + ofc ^^
__________________
This is 10% luck, 20% skill, 15% concentrated power of will,
5% pleasure, 50% pain and 100% reason to remember my name..

Last edited by Salamon; 06-27-2008 at 17:37.
Salamon is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 06-27-2008 , 21:43   Re: task on two id's ?
Reply With Quote #6

Quote:
Originally Posted by Xanimos View Post
Code:
public function2( param[] , size )
I thought size was the taskid?
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`
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 04:35.


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