This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

for(new i = 1; i < MaxClients; i++) skip ID if missing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 07-16-2014 , 05:56   for(new i = 1; i < MaxClients; i++) skip ID if missing
Reply With Quote #1

Hi guys.. I have issue with this loop..

When someone leave game this loop stop at the missing one ID..

PHP Code:
for(new 1MaxClientsi++)
{
    if(
IsValidClient(i))
    {
        
PrintToChatAll("Hrac: %s, ID: %i"namei);
    }
}
stock bool:IsValidClient(clientbool:alive false)
{
    if(
client >= && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (alive == false || IsPlayerAlive(client)))
    {
        return 
true;
    }
   
    return 
false;

It Stop at ID: 2 cuz ID: 3 is missing



Last edited by ESK0; 07-16-2014 at 06:00.
ESK0 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode