Raised This Month: $ Target: $400
 0% 

Problem with for-loops


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 04-03-2011 , 14:34   Re: Problem with for-loops
Reply With Quote #4

i don't have time to verify all the code, but, if the FOR loop finds that a players doesn't exists, it will stop, for example

online are the id 1, 2 and 4

the for loop like this

for(new i=1;i<=MAX_PLAYERS;i++)
{
instruction
}

will stop at 3. you must do
for(new i=1;i<=MAX_PLAYERS;i++)
{
if(!is_user_connected(i)) continue
instruction
}
DjOptimuS is offline
 



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:30.


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