Player index question
When getting user auth id/name/etc, I need a index of [33] or higher?
PHP Code:
|
Re: Player index question
To index an array for a player, you must use the [33], for every else you can use the number you want.
There you're trying to get the name/user id for a player, you must create an array in which you will keep the name, the number you put on that array is the length of the player name, in this case use 32 or less, because the engine has a limit of the name length. (It's not necessary to put a biggest number if you won't use all the array slots) PHP Code:
|
Re: Player index question
Also is good to avoid hardcoding and use charsmax() or sizeof() - 1, isntead of just puttign 31 in the native. Not a big deal, but if you change some array size somewhere, the hardcoding may f*ck up everything.
PHP Code:
PHP Code:
|
Re: Player index question
more clear information about array and string size are available here.
https://forums.alliedmods.net/showth...t=94381#arrays |
| All times are GMT -4. The time now is 09:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.