Thread: [Solved] loop entitys
View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-17-2022 , 23:28   Re: loop entitys
Reply With Quote #62

Quote:
Originally Posted by MrPickles View Post
eh no, what the decompiler did is show you the size of the array{ }, but when it uses size of, it is to use it inside "myfunction" server_print, so every time you use "myfunction", it will get the size of the array to use it in the server_print

As I said, the compiler will show you the data from the array { }, nothing to do when you use server_print, because there you get the size with sizeof

for example, if you try to decompile this, it will return the same data, it is not the same for the decompiler to show you the data, than for the function to obtain the maximum size of the array to be used in the server_print

PHP Code:
#include <amxmodx>

public plugin_init( ) 
{
    
myFunction({1,3,5})
    
myFunction({1})
    
myFunction({2,34,334,30,340,34,0})
    
myFunction({2,34,334,30,340,34,0,334,30,340,34,0,334,30,340,34,0})
}

stock myFunction(myArray[])
{
     
client_print0print_chat"%d"myArray[0] );

** It is one thing for it to show you the size of the array, and another is for the function to obtain the size of the array depending on which array you put **
Not sure what you're going on about in this post. When I decompile your version of the plugin, I get this:

Code:
0x8                        PROC              ; public plugin_init()
0xC                       BREAK 
0x10                      BREAK 
0x14                     PUSH.C  0x14       
0x1C                     PUSH.C  0x4        
0x24                       CALL  0x88        ; stock myFunction(myArray[])
0x2C                      BREAK 
0x30                     PUSH.C  0x20       
0x38                     PUSH.C  0x4        
0x40                       CALL  0x88        ; stock myFunction(myArray[])
0x48                      BREAK 
0x4C                     PUSH.C  0x24       
0x54                     PUSH.C  0x4        
0x5C                       CALL  0x88        ; stock myFunction(myArray[])
0x64                      BREAK 
0x68                     PUSH.C  0x40       
0x70                     PUSH.C  0x4        
0x78                       CALL  0x88        ; stock myFunction(myArray[])
0x80                   ZERO.pri 
0x84                       RETN
This proves that it was showing the argument being passed. It proves that with my function, passing myFunction({1,2,3}) and myFunction({1,2,3}, 3) are the same (and I've proven this with decompiled output too) which is what I said in one of my original posts trying to explain how my suggestion works.

Like I said, you seem to be disputing something I never asserted.

Quote:
Originally Posted by MrPickles View Post
its make me laugh that you keep trying to prove something you can't
I've proven one of my earlier statements that you claimed was wrong. What do you think I'm trying to prove?
__________________
fysiks is offline