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

dynamic array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kowalsky
Senior Member
Join Date: Mar 2015
Location: Poland
Old 01-13-2018 , 17:13   dynamic array
Reply With Quote #1

hey.

How can I push three strings under one ID in an array in pawn, in php it would look like this:

$something = array(
array( "NICK", "Password", "Information" ),
array( "NICK1", "Password1", "Information1" ),
array( "NICK2", "Password2", "Information2" )
);

How can I do that in pawn? And also I would like to know how to retrieve the information later on, say, I need to get the name of 0 element:

$something[ 0 ][ 0 ] should display "NICK"?
__________________
I ONLY LOVE STEAM, NON-STEAM IS VERY BAD FOR YOUR HEALTH!

Last edited by Kowalsky; 01-13-2018 at 17:14.
Kowalsky is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-13-2018 , 17:39   Re: dynamic array
Reply With Quote #2

Code:
enum PlayerData {     Nick[32],     Password[32],     Information[32] } new g_ePlayerData[33][PlayerData] //To store the nick and info: get_user_name(id, g_ePlayerData[id][Nick], charsmax(g_ePlayerData[][Nick])) formatex(g_ePlayerData[id][Information], charsmax(g_ePlayerData[][Information]), "some info") //To print it: client_print(id, print_chat, "Your nick is: %s", g_ePlayerData[id][Nick])
__________________

Last edited by OciXCrom; 01-13-2018 at 17:41.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 07:17.


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