AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_task behaving erratically (https://forums.alliedmods.net/showthread.php?t=76427)

Prajch 08-24-2008 11:30

set_task behaving erratically
 
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?

Exolent[jNr] 08-24-2008 12:33

Re: set_task behaving erratically
 
The task parameters come before the task id.

Code:
public other(taskArguments[], id)

Emp` 08-24-2008 12:34

Re: set_task behaving erratically
 
Edit: Exolent beat me :[

Exolent[jNr] 08-24-2008 12:35

Re: set_task behaving erratically
 
haha! hi Emp!

Prajch 08-24-2008 15:54

Re: set_task behaving erratically
 
That's... strange. Well thanks, that was really bothering me.

Iwon 08-24-2008 18:13

Re: set_task behaving erratically
 
would
PHP Code:

static other(taskArguments[], id

work too?

ConnorMcLeod 08-24-2008 18:15

Re: set_task behaving erratically
 
No.

xPaw 08-25-2008 07:06

Re: set_task behaving erratically
 
try
PHP Code:

set_task(0.5"other"idtaskArguments[], 4); 


ConnorMcLeod 08-25-2008 07:08

Re: set_task behaving erratically
 
Quote:

Originally Posted by xPaw (Post 675334)
try
PHP Code:

set_task(0.5"other"idtaskArguments[], 4); 


Won't compile.

Prajch 08-25-2008 09:02

Re: set_task behaving erratically
 
The problem is already solved, thanks though.


All times are GMT -4. The time now is 03:17.

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