This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Solved Something about dynamic arrays


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 16:37.


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