Raised This Month: $ Target: $400
 0% 

set_task problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gcz
Junior Member
Join Date: Feb 2016
Old 07-28-2017 , 21:48   set_task problem
Reply With Quote #1

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})
gcz is offline
Old 07-29-2017, 09:00
Black Rose
This message has been deleted by Black Rose.
TBagT
Member
Join Date: Aug 2016
Location: Lithuania
Old 07-29-2017 , 11:58   Re: set_task problem
Reply With Quote #3

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[ ] ) { ... } 

Last edited by TBagT; 07-29-2017 at 14:57. Reason: Bugsy fix with float
TBagT is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-29-2017 , 12:33   Re: set_task problem
Reply With Quote #4

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
__________________

Last edited by Bugsy; 07-29-2017 at 12:34.
Bugsy is offline
gcz
Junior Member
Join Date: Feb 2016
Old 07-29-2017 , 21:08   Re: set_task problem
Reply With Quote #5

thank you for tutorial
gcz 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 23:00.


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