 |
|
Veteran Member
Join Date: Jul 2006
Location: France (95)
|

03-25-2011
, 17:09
Re: Copy strings id
|
#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
__________________
Last edited by ConnorMcLeod; 03-25-2011 at 17:14.
|
|
|
|