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

Solved how to empty multidimensional array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-05-2023 , 00:53   how to empty multidimensional array
Reply With Quote #1

Code:
enum TableData{     player_id,     record,     timestamp } new Table[15][TableData] for (new i = 0; i < sizeof(Table); i++)     arrayset(Table[i], {0, 0, 0}, sizeof(Table[]))
Throws error,
warning 229: index tag mismatch (symbol "Table")
error 035: argument type mismatch (argument 2)
__________________

Last edited by bigdaddy424; 03-05-2023 at 12:08.
bigdaddy424 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-05-2023 , 08:29   Re: how to empty multidimensional array
Reply With Quote #2


PHP Code:
for (new 0sizeof(Table); i++)
    
arrayset(Table[i], 0sizeof(Table[])) 
You were doing correct except arrayset is a loop in itself.


another way you can simply do is...


PHP Code:
new const NULL_TABLE[TableData] = { 00};

for (new 
0sizeof(Table); i++)
{
   
Table[i] = NULL_TABLE;

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-05-2023 at 08:32.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 04:52.


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