View Single Post
Author Message
abdelwahab
Member
Join Date: Aug 2019
Old 04-12-2024 , 22:29   Something about dynamic arrays
Reply With Quote #1

Hello,
so here is the thing, i know what it does but i don't understand how it does it if someone can explain it would be much appreciated, Thanks!
PHP Code:
new Array:GlobalArray;
public 
plugin_init() {
    new 
string[][] =
    {
        
"String 1",
        
"String 2",
        
"String 3",
        
"String 4"
    
}
    new Array:
StringHolder ArrayCreate(321);
    for(new 
i=0sizeof(string); i++)
        
ArrayPushString(StringHolderstring[i]);
    
// we pass an array :/
    
ArrayPushCell(GlobalArrayStringHolder);

    
arraytest()
}
public 
plugin_precache() GlobalArray =  ArrayCreate(11);
arraytest(){
    new  Array:
AnotherArray;AnotherArray ArrayGetCell(GlobalArray0);
    if(
AnotherArray != Invalid_Array){
        new 
szString[32];
        for(new 
0ArraySize(AnotherArray); i++){
            
ArrayGetString(AnotherArrayiszStringcharsmax(szString));
            
server_print(szString);
        }
    }


Last edited by HamletEagle; 04-13-2024 at 06:55. Reason: Restore to previous version.
abdelwahab is offline