"Client X is not connected" directly after IsClientConnected
Quote:
Code:
new i;Nothing that I can improve here to prevent it? |
Re: "Client X is not connected" directly after IsClientConnected
You aren't checking for IsClientConnected, you're checking !IsClientConnected or if client is not connected. Same thing with your "IsFakeClient". And then you're having it continue to a function that is trying to perform something on a client that is either not there or is a fake client.
You should change it to something like this: PHP Code:
|
Re: "Client X is not connected" directly after IsClientConnected
Old syntax because your plugin is written in old syntax. There's no point playing sounds to clients that can't hear them anyway, that's why you check IsClientInGame.
Code:
for (new i = 1; i <= MaxClients; i++) |
Re: "Client X is not connected" directly after IsClientConnected
Quote:
|
Re: "Client X is not connected" directly after IsClientConnected
StealthGus,
1) as far as I know from C++, 'continue' command in 'for' cycles mean skipping all lines until last scope of "for" command and starting new iteration, so EmitSoundToClient will be skipped if IsClientConnected is not connected or if fake client. So, your code example should be a functionally analogue. Would you like to say that "continue" behaviour is somehow different in SourcePawn? 2) How Code:
(1) && (2) |
Re: "Client X is not connected" directly after IsClientConnected
Quote:
|
Re: "Client X is not connected" directly after IsClientConnected
The error maybe misleading, the player is probably needed to be in game (fully connected) to emit to.
|
Re: "Client X is not connected" directly after IsClientConnected
Good point, thanks.
Ahh, missed Visual77 answer. Quote:
BTW. Not my code/code style, so I'll leave that syntax as is for now. |
Re: "Client X is not connected" directly after IsClientConnected
Quote:
|
Re: "Client X is not connected" directly after IsClientConnected
Quote:
|
| All times are GMT -4. The time now is 01:12. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.