|
AMX Mod X Plugin Approver
|
10-26-2016
, 11:07
Re: [ANY] City Bans
|
#22
|
You could have long city name with unicode characters, though it probably doesn't happen often.
The GeoIP module uses 256k as buffer length to be large enough but 64 or 128 should be fine too I guess.
Not like it does matter for this plugin anyway.
@OP:
- new Array:gA_BannedCities = view_as<Array>(null);
Global variables are already initialized to 0 by default, you don't need to do that. You have also a define for that, Invalid_Array (0 as value).
- Don't create variables in a loop
- Don't hardcode the buffer max length, use charsmax() (macro for sizeof(var) - 1, and yeah in AMXX, you need to do -1, it's important)
- Instead of using an Array, you could use a Trie, and just checking the key with TrieKeyExists (less code, more efficient, even though it's probably trivial here).
What do you mean by "do not kick properly"?
__________________
Last edited by Arkshine; 10-26-2016 at 11:09.
|
|
|
|