AlliedModders

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

gcz 07-28-2017 21:48

set_task problem
 
How to fix this

Code:

new Float:vOrigin[3]
vOrigin[0] = 0.0
vOrigin[1] = 0.0
vOrigin[2] = 0.0
set_task(5.0, "Game_Start", Float:{0.0, 0.0, 0.0})
set_task(5.0, "Game_Start", vOrigin[0], vOrigin[1], vOrigin[2])

// Game_Start(Float:{0.0, 0.0, 0.0})


TBagT 07-29-2017 11:58

Re: set_task problem
 
It seems you're trying to parse float values to a task function, you can send it like this.

PHP Code:

set_task(5.0"Game_Start"_vOriginsizeof vOrigin );

public 
Game_Start( const Float:origins[ ] ) { ... } 


Bugsy 07-29-2017 12:33

Re: set_task problem
 
TBagT's method will work. But I would make sure to tag the Game_Start functions origins parameter with the 'Float' tag.

PHP Code:

public Test() 
{
    new 
FloatvOrigin];
    
vOrigin] = 1.2;
    
vOrigin] = 3.4;
    
vOrigin] = 5.6;
    
set_task5.0 "Game_Start" vOrigin sizeofvOrigin ) );
}

public 
Game_Start( const Float:origins[ ] ) 
{
    
server_print"%f %f %f" origins] , origins] ,origins] );


Output:
Code:

1.200000 3.400000 5.599999

gcz 07-29-2017 21:08

Re: set_task problem
 
:D thank you for tutorial


All times are GMT -4. The time now is 23:00.

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