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

Multi-dimensional Arrays help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Devolon
New Member
Join Date: Jan 2021
Old 01-26-2021 , 18:04   Multi-dimensional Arrays help!
Reply With Quote #1

I created array
int g_pData[MAXPLAYERS+1][3][3];

After I insert data to each array cell for example
g_pData[client][0][0] = 1;
g_pData[client][1][3] = 1;

I want to save that on a cookie and retrieve that when the client connects to the server.

Any idea?
Devolon is offline
FAQU
Member
Join Date: Sep 2020
Location: Romania
Old 01-26-2021 , 23:51   Re: Multi-dimensional Arrays help!
Reply With Quote #2

Look at the example on this page:

https://wiki.alliedmods.net/Client_P...PI_(SourceMod)
__________________

Last edited by FAQU; 01-26-2021 at 23:51.
FAQU is offline
Devolon
New Member
Join Date: Jan 2021
Old 01-27-2021 , 07:33   Re: Multi-dimensional Arrays help!
Reply With Quote #3

Quote:
Originally Posted by FAQU View Post
I saw this example, but how I save array as cookie?

Maybe there is effective way instead save the info in a cookie?
Devolon is offline
FAQU
Member
Join Date: Sep 2020
Location: Romania
Old 01-27-2021 , 08:27   Re: Multi-dimensional Arrays help!
Reply With Quote #4

Quote:
Originally Posted by Devolon View Post
I saw this example, but how I save array as cookie?

Maybe there is effective way instead save the info in a cookie?
My bad. Thought you were asking how to save the value that the array holds to a cookie.
You can't save an entire array to a cookie. Depending on what you're trying to achieve, you could either use multiple cookies, or use a database.
__________________
FAQU 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 04:46.


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