AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help (https://forums.alliedmods.net/showthread.php?t=12276)

DiscoBBQ 04-10-2005 17:31

Help
 
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]

slurpycof 04-10-2005 19:25

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()

DiscoBBQ 04-10-2005 19:52

Thanks alot dude.


All times are GMT -4. The time now is 09:59.

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