Raised This Month: $ Target: $400
 0% 

I dont understand this easy code. Pls help me to understand =)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 06-19-2010 , 05:07   I dont understand this easy code. Pls help me to understand =)
Reply With Quote #1

Hello. Im new at scripting and i dont anderstand this code, witch is using to loop through all players:

PHP Code:
  new players[32], pnumtempid;
  
get_players(playerspnum); // That save every ID to the variavle players right? But what is pnum for??

    
for( new ii<pnumi++ )  // Same. What is pnum for?
    
{
     
        
tempid players[i];


    } 
I dont understand the lines with a comment
mottzi is offline
Send a message via MSN to mottzi
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-19-2010 , 05:09   Re: I dont understand this easy code. Pls help me to understand =)
Reply With Quote #2

pnum stands for playersnumber, so it's the number of players that have been collected in players var, so if pnum is 3, players[0] players[1] and players[2] contain ids of the 3 players, and after that variable is empty, that's why you do the loop from i = 0 to i < 3 (pnum)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 06-19-2010 , 07:03   Re: I dont understand this easy code. Pls help me to understand =)
Reply With Quote #3

hey thanks

this forum is awesome
mottzi is offline
Send a message via MSN to mottzi
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:44.


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