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

Solved [Help] sizeof Array (iOrigins)


Post New Thread Reply   
 
Thread Tools Display Modes
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 10-06-2018 , 10:45   Re: [Help] sizeof Array (iOrigins)
Reply With Quote #21

I think it makes sense that it will work on just one point
Quote:
{ 160 , 208 , -1392 },
But I want them all!
Code:
    for(new i=0;i<sizeof(iOrigin);i++)     {         write_coord(iOrigin[i][x]);         write_coord(iOrigin[i][y]);         write_coord(iOrigin[i][z]);     }
Same results (
__________________

Last edited by abdobiskra; 10-06-2018 at 10:45.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-06-2018 , 10:48   Re: [Help] sizeof Array (iOrigins)
Reply With Quote #22

Quote:
Originally Posted by abdobiskra View Post
I think it makes sense that it will work on just one point

But I want them all!
Code:
    for(new i=0;i<sizeof(iOrigin);i++)     {         write_coord(iOrigin[i][x]);         write_coord(iOrigin[i][y]);         write_coord(iOrigin[i][z]);     }
Same results (
Well, you cannot dictate how the system should work. You can only send messages in a way that the system expects them. If you want to send messages with multiple coordinates, send multiple messages instead?
__________________
Bugsy is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 10-06-2018 , 10:52   Re: [Help] sizeof Array (iOrigins)
Reply With Quote #23

Quote:
Originally Posted by Bugsy View Post
If you want to send messages with multiple coordinates, send multiple messages instead?
This is what bothers me because it is so many
It seems that it can not be, that I wanted to make sure, you all helped me to thank you so much
__________________

Last edited by abdobiskra; 10-06-2018 at 10:53.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-06-2018 , 11:21   Re: [Help] sizeof Array (iOrigins)
Reply With Quote #24

Do this?
PHP Code:

#include <amxmodx>

enum
{
    
x,
    
y,
    
z
}

new const 
iOrigins[][] =  

    {  
160 208 , -1392  }, 
    { -
544 208 ,  -1392 }, 
    { -
465 1120 , -1392 }, 
    { 
81 1120 , -1392 }, 
    { 
, -1584 , -1560 }, 
    { -
, -240 , -1744 }, 
    { 
, -356 , -1540 


public 
SomeFunction() 
{
    for ( new 
sizeofiOrigins ) ; i++ )
    {
        
create_lightiOrigins] );
    }
}

public 
create_lightiDLightOrigin] )
{
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
    
    
write_byte(TE_DLIGHT);

    
write_coordiDLightOrigin] );
    
write_coordiDLightOrigin] );
    
write_coordiDLightOrigin] );

    
write_byte(30);  //radiis
    
write_byte(255);//r
    
write_byte(0);  //g
    
write_byte(0);  //b
    
write_byte(15); // life 
    
write_byte(20); // decay rate
    
    
message_end();
    
    
set_task(5.0"create_light")

__________________

Last edited by Bugsy; 10-06-2018 at 11:21.
Bugsy is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 10-06-2018 , 11:42   Re: [Help] sizeof Array (iOrigins)
Reply With Quote #25

line :
PHP Code:
create_lightiOrigins] ); 
Quote:
error 047: array sizes do not match, or destination array is too small
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-06-2018 , 11:46   Re: [Help] sizeof Array (iOrigins)
Reply With Quote #26

Compiles fine for me, did you use the array in my code? Post your code
__________________
Bugsy is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 10-06-2018 , 12:04   Re: [Help] sizeof Array (iOrigins)
Reply With Quote #27

Quote:
Originally Posted by Bugsy View Post
Compiles fine for me, did you use the array in my code? Post your code
It's weird?
PHP Code:
#include <amxmodx>

enum
{
    
x,
    
y,
    
z
}

new const 
iOrigins[][] =  
{
     
     {  
160 208 , -1392  }, 
     { -
544 208 ,  -1392 }, 
     { -
465 1120 , -1392 }, 
     { 
81 1120 , -1392 }, 
     { 
, -1584 , -1560 }, 
     { -
, -240 , -1744 }, 
     { 
, -356 , -1540 


public 
plugin_init()
{
    for ( new 
sizeofiOrigins ) ; i++ )
    {
        
create_lightiOrigins] );
    }
}

public 
create_lightiDLightOrigin] )
{
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
    
    
write_byte(TE_DLIGHT);
    
    
write_coordiDLightOrigin] );
    
write_coordiDLightOrigin] );
    
write_coordiDLightOrigin] );
    
    
write_byte(30);  //radiis
    
write_byte(255);//r
    
write_byte(0);  //g
    
write_byte(0);  //b
    
write_byte(15); // life 
    
write_byte(20); // decay rate
    
    
message_end();
    
    
set_task(5.0"create_light")

It's the same code?
http://aghl.ru/webcompiler/
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-06-2018 , 13:28   Re: [Help] sizeof Array (iOrigins)
Reply With Quote #28

Quote:
Originally Posted by abdobiskra View Post
It's weird?
Yup
Code:
AMX Mod X Compiler 1.8.3-dev+4748
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Header size:            272 bytes
Code size:              748 bytes
Data size:              204 bytes
Stack/heap size:      16384 bytes
Total requirements:   17608 bytes
Done.
__________________
Bugsy is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 10-06-2018 , 13:40   Re: [Help] sizeof Array (iOrigins)
Reply With Quote #29

Using the same site?
Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

test.sma(26) : error 047: array sizes do not match, or destination array is too small

1 Error.
Could not locate output file test.amx (compile failed).
__________________

Last edited by abdobiskra; 10-06-2018 at 13:41.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-06-2018 , 13:56   Re: [Help] sizeof Array (iOrigins)
Reply With Quote #30

No, compiling locally
__________________
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 14:11.


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