Raised This Month: $ Target: $400
 0% 

Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 04-10-2005 , 17:31   Help
Reply With Quote #1

I have some code. It's sapose to get all the players in server. Like, say theres 4 people in server. I want it to equal 4. But it always get's the highest userid. Like, say theres 4 people in a server....
userid 1 "player1"
userid 2 "player2"
userid 3 "playe3"
userid 4 "player4"

then the 2nd player leaves and rejoins. It is now...
userid 1 "player1"
userid 3 "playe3"
userid 4 "player4"
userid 5 "player2"

and my varable ='s 5. Not 4. Because 5 is the highest userid.

Here's the code...

Code:
    new players[32], num get_players(players,num); for(new i=0;i<num;i++) { predators = players[i]
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ is offline
slurpycof
Senior Member
Join Date: Nov 2004
Old 04-10-2005 , 19:25  
Reply With Quote #2

get_playersnum - Returns the number of players put in server.
Syntax:
get_playersnum ( [ flag ] )
Type:
Native
Notes:
If flag is specified as 1, players connecting are also returned.

sooo

Code:
new predators predators = get_playersnum()
slurpycof is offline
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 04-10-2005 , 19:52  
Reply With Quote #3

Thanks alot dude.
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ is offline
Old 05-01-2010, 05:39
abdul-rehman
This message has been deleted by abdul-rehman.
Old 05-01-2010, 08:19
abdul-rehman
This message has been deleted by abdul-rehman.
Old 05-01-2010, 08:20
abdul-rehman
This message has been deleted by abdul-rehman.
Old 05-01-2010, 08:21
abdul-rehman
This message has been deleted by abdul-rehman.
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 09:59.


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