Raised This Month: $ Target: $400
 0% 

code explain


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 07-21-2009 , 20:43   code explain
Reply With Quote #1

hi there i need a little explain from this

get_players(players, num)

for(new i = 0; i < num; i++)

{
player = players[i]

}

playercap = random(player)

in player are all the players connected in the server?

and when i do random(player) will get a random playerID from the connected players?
liryck is offline
Send a message via MSN to liryck
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 07-21-2009 , 22:17   Re: code explain
Reply With Quote #2

No, in player will be the last player in the server since you keep overwriting it. In players[] will be all of the connected people in the server already.
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-21-2009 , 22:36   Re: code explain
Reply With Quote #3

PHP Code:
new my_random_player players[random(num)] 
This should give you a random player of those that are connected to the server.
__________________
fysiks 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 20:16.


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