Raised This Month: $ Target: $400
 0% 

Copy strings id


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-25-2011 , 17:09   Re: Copy strings id
Reply With Quote #7

Wouldn't it be more readable to use 2 vars ?

new string1[33][32]
new string2[33][32]

?


Else i would do :

new string[33][2][32]
and not
new string[33][32][2]

Then :
get_user_name(id, string[id][0], charsmax(string[][])
get_user_authid(id, string[id][1], charsmax(string[][])


string[id][0][0] = 0
string[id][0][1] = 0



Else you can also considerate to create a structure, depending on what you are doing.

Not sure following code is fine, i usually correct such code when i try to compile :

enum _:m_Datas {
m_szName[32],
m_szAuthid[32]
}

new g_mPlayersDatas[33][m_Datas] // note that it is same result as new string[33][2][32] i do before

get_user_name(id, g_mPlayersDatas[id][m_szName], charsmax(g_mPlayersDatas[][m_szName]))
get_user_authid(id, g_mPlayersDatas[id][m_szAuthid], charsmax(g_mPlayersDatas[][m_szAuthid]))

g_mPlayersDatas[id][m_szName][0] = 0
g_mPlayersDatas[id][m_szAuthid][0] = 0
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 03-25-2011 at 17:14.
ConnorMcLeod 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 14:35.


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