[SOLVED] string to indexed variable?
Code:
is this correct? im trying to assign a string to this variable later on. as the function reads a line from a file at random and then wanting to assign that line string to that players variable? |
Re: string to indexed variable?
Like this example using strings.
new g_szNames[33][32]; get_user_name(id,g_szNames[id],charsmax(g_szNames[])); Explanation: id is a id used for any player, when connect to server. the g_szName[id] is used by array to assign the name for a player. if I get the id 8, its means like g_szNames[8]; (But using ID instead of number 8 LOL); for the charsmax, its get a maximum size of string -1 (After the my ID array); For usage in any function, you should use client_print(0,print_chat,"[AMXX] %s connected to server!",g_szNames[id]); // Always using ID never its 0 or g_szNames only !! :) Ps. PHP Code:
|
Re: string to indexed variable?
thanks for explaining it. i understood that and now its working :P
|
| All times are GMT -4. The time now is 06:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.