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

Help with multiple params set_task


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-11-2020 , 23:13   Re: Help with multiple params set_task
Reply With Quote #11

Just add it to the array you pass via set_task()
PHP Code:
public FT_Shoot_Mine_2(ent)
{
    static 
Float:StartOrigin[3][3]
    new 
EntityData]
    
    for(new 
011i++)
    {        
        if(
i<0) continue
        
get_position(enti*70.0+100.035.0, -35.0StartOrigin[0])
        
get_position(enti*70.0+100.0, (i*-15.0)+35.0, -35.0StartOrigin[1])
        
get_position(enti*70.0+100.0, (i*15.0)+35.0, -35.0StartOrigin[2])
        
        for(new 
j=0;i<2;j++)
        {
            
EntityData[0] = ent;
            
EntityData[1] = floatround(StartOrigin[j][0]) //Error here
            
EntityData[2] = floatround(StartOrigin[j][1])
            
EntityData[3] = floatround(StartOrigin[j][2])
            
set_task(0.2*i"Shoot_Mine_2"12345EntityDatasizeof(EntityData))
        }
    }    
}

public 
Shoot_Mine_2(EntityData[])
{    
    new 
StartOrigin[3]
    new 
iEntityID;
    
    
iEntityID EntityData[0]
    
StartOrigin[0] = EntityData[1]
    
StartOrigin[1] = EntityData[2]
    
StartOrigin[2] = EntityData[3]
    ...

__________________
Bugsy is offline
headshot910
Member
Join Date: Apr 2012
Old 04-11-2020 , 23:17   Re: Help with multiple params set_task
Reply With Quote #12

Quote:
Originally Posted by Bugsy View Post
Just add it to the array you pass via set_task()
PHP Code:
public FT_Shoot_Mine_2(ent)
{
    static 
Float:StartOrigin[3][3]
    new 
EntityData]
    
    for(new 
011i++)
    {        
        if(
i<0) continue
        
get_position(enti*70.0+100.035.0, -35.0StartOrigin[0])
        
get_position(enti*70.0+100.0, (i*-15.0)+35.0, -35.0StartOrigin[1])
        
get_position(enti*70.0+100.0, (i*15.0)+35.0, -35.0StartOrigin[2])
        
        for(new 
j=0;i<2;j++)
        {
            
EntityData[0] = ent;
            
EntityData[1] = floatround(StartOrigin[j][0]) //Error here
            
EntityData[2] = floatround(StartOrigin[j][1])
            
EntityData[3] = floatround(StartOrigin[j][2])
            
set_task(0.2*i"Shoot_Mine_2"12345EntityDatasizeof(EntityData))
        }
    }    
}

public 
Shoot_Mine_2(EntityData[])
{    
    new 
StartOrigin[3]
    new 
iEntityID;
    
    
iEntityID EntityData[0]
    
StartOrigin[0] = EntityData[1]
    
StartOrigin[1] = EntityData[2]
    
StartOrigin[2] = EntityData[3]
    ...

Yes, yes. I was doing that too. But i think the origin should stay Float. If so, the ent would be "type mistach" so i removes it
__________________
Hi!
I'm here!

Last edited by headshot910; 04-11-2020 at 23:19.
headshot910 is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 04-11-2020 , 23:22   Re: Help with multiple params set_task
Reply With Quote #13

If I do this.
https://forums.alliedmods.net/showthread.php?t=202434
PHP Code:
set_task(0.2*i"Shoot_Mine_2"ent 12345EntityDatasizeof(EntityData))

public 
Shoot_Mine_2(EntityData[], iEnt)
{   
    
iEnt -= 12345;
   ....

__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-11-2020 , 23:28   Re: Help with multiple params set_task
Reply With Quote #14

Try this
PHP Code:
enum EntityData
{
    
EntID,
    
Float:EntityOrigin]
}

public 
FT_Shoot_Mine_2(ent)
{
    static 
Float:StartOrigin[3][3]
    new 
edDataEntityData ];
    
    for(new 
011i++)
    {        
        if(
i<0) continue
        
get_position(enti*70.0+100.035.0, -35.0StartOrigin[0])
        
get_position(enti*70.0+100.0, (i*-15.0)+35.0, -35.0StartOrigin[1])
        
get_position(enti*70.0+100.0, (i*15.0)+35.0, -35.0StartOrigin[2])
        
        for(new 
j=0;i<2;j++)
        {
            
edDataEntID ] = ent;
            
edDataEntityOrigin ][ ] = StartOrigin[j][0//Error here
            
edDataEntityOrigin ][ ] = StartOrigin[j][1]
            
edDataEntityOrigin ][ ] = StartOrigin[j][2]
            
set_task0.2 "Shoot_Mine_2"12345edData[EntID], sizeof(edData))
        }
    }    
}

public 
Shoot_Mine_2(  EntData[  EntityData ])
{    
    new 
Float:fStartOrigin[3]
    new 
iEntityID;
    
    
iEntityID EntDataEntID ]
    
fStartOrigin] = EntDataEntityOrigin ][ ];
    
fStartOrigin] = EntDataEntityOrigin ][ ];
    
fStartOrigin] = EntDataEntityOrigin ][ ];


__________________
Bugsy is offline
headshot910
Member
Join Date: Apr 2012
Old 04-11-2020 , 23:53   Re: Help with multiple params set_task
Reply With Quote #15

Wow, BEAUTIFUL! Thank you Bugsy, again!



But why 'tag mismatch' at:
PHP Code:
edData[EntityOrigin][0] = StartOrigin[j][0]
edData[EntityOrigin][1] = StartOrigin[j][1]
edData[EntityOrigin][2] = StartOrigin[j][2
__________________
Hi!
I'm here!
headshot910 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-11-2020 , 23:57   Re: Help with multiple params set_task
Reply With Quote #16

I don't get a warning. You do have StartOrigin[] tagged with Float, right? I am using AMX-X 1.9 also.
__________________
Bugsy is offline
headshot910
Member
Join Date: Apr 2012
Old 04-12-2020 , 00:07   Re: Help with multiple params set_task
Reply With Quote #17

Quote:
Originally Posted by Bugsy View Post
I don't get a warning. You do have StartOrigin[] tagged with Float, right? I am using AMX-X 1.9 also.
Weird! I do have Float: tag. But i put StartOrigin[j][0] in floatround() the warning gone. So maybe the problem is in edData[EntityOrigin]?
__________________
Hi!
I'm here!
headshot910 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-12-2020 , 00:27   Re: Help with multiple params set_task
Reply With Quote #18

EntityOrigin is tagged as Float though in the enumerator, so it should want a Float. Which version of AMX-X do you run?
__________________
Bugsy is offline
headshot910
Member
Join Date: Apr 2012
Old 04-12-2020 , 01:04   Re: Help with multiple params set_task
Reply With Quote #19

Idk what version i am. But i downloaded the Amx1.8.2 full installer with amxx studio in it. Am i outdated?
__________________
Hi!
I'm here!
headshot910 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-12-2020 , 01:24   Re: Help with multiple params set_task
Reply With Quote #20

Yes, upgrade to 1.9 https://www.amxmodx.org/downloads-new.php
__________________
Bugsy 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:46.


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