04.09.2009, 15:53
Just a few things I want to point out dude, only so you can fix them (I'm being constructive).
Calling the GetMaxPlayers() function on each itteration is pointless as it will always give the same return so you are wasting every single call after the first one. You can store the result of the function first outside the loop and then use this value in the loop if you wish to use it instead of the MAX_PLAYERS define.
The string comparison in the disconnect function is wrong, you have used your variable name as a string "...". I think this is what Tr1viUm was pointing out to you unless I missed something else.
The DisconnectAllNPC() function will only kick the first found NPC as you kill the loop on the first itteration which finds a valid NPC.
Calling the GetMaxPlayers() function on each itteration is pointless as it will always give the same return so you are wasting every single call after the first one. You can store the result of the function first outside the loop and then use this value in the loop if you wish to use it instead of the MAX_PLAYERS define.
The string comparison in the disconnect function is wrong, you have used your variable name as a string "...". I think this is what Tr1viUm was pointing out to you unless I missed something else.
The DisconnectAllNPC() function will only kick the first found NPC as you kill the loop on the first itteration which finds a valid NPC.