Raised This Month: $ Target: $400
 0% 

set_task behaving erratically


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 08-24-2008 , 11:30   set_task behaving erratically
Reply With Quote #1

I'm using this:

PHP Code:
public function1(id)
{
   new 
taskArguments[4];
   
set_task(0.5"other"idtaskArguments4);
}
 
public 
other(idtaskArguments[])
{
   
console_print(1"[0] %i [1] %i [2] %i [3] %i"taskArguments[0], taskArguments[1], taskArguments[2], taskArguments[3]);
   return 
PLUGIN_HANDLED;

All these values should read zero, but I'm getting seemingly random numbers in huge ranges; 78 or 48199984 or whatever. The only thing that changes the values is what I set as "id" in my set_task. From 0 to 1 to 2 I get a huge variation, and it never properly sends the argument array. Any ideas?

Last edited by Prajch; 08-24-2008 at 11:33.
Prajch is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-24-2008 , 12:33   Re: set_task behaving erratically
Reply With Quote #2

The task parameters come before the task id.

Code:
public other(taskArguments[], id)
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 08-24-2008 , 12:34   Re: set_task behaving erratically
Reply With Quote #3

Edit: Exolent beat me :[
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`
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-24-2008 , 12:35   Re: set_task behaving erratically
Reply With Quote #4

haha! hi Emp!
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 08-24-2008 , 15:54   Re: set_task behaving erratically
Reply With Quote #5

That's... strange. Well thanks, that was really bothering me.
Prajch is offline
Iwon
BANNED
Join Date: Jul 2008
Old 08-24-2008 , 18:13   Re: set_task behaving erratically
Reply With Quote #6

would
PHP Code:
static other(taskArguments[], id
work too?
Iwon is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-24-2008 , 18:15   Re: set_task behaving erratically
Reply With Quote #7

No.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-25-2008 , 07:06   Re: set_task behaving erratically
Reply With Quote #8

try
PHP Code:
set_task(0.5"other"idtaskArguments[], 4); 
__________________
xPaw is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-25-2008 , 07:08   Re: set_task behaving erratically
Reply With Quote #9

Quote:
Originally Posted by xPaw View Post
try
PHP Code:
set_task(0.5"other"idtaskArguments[], 4); 
Won't compile.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 08-25-2008 , 09:02   Re: set_task behaving erratically
Reply With Quote #10

The problem is already solved, thanks though.
Prajch 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:30.


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