Raised This Month: $ Target: $400
 0% 

Get random player?


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Old 05-20-2010, 13:11
#8 SickneSS
This message has been deleted by #8 SickneSS. Reason: I have other idea,but Hx7r works (for me)
eNz0
Member
Join Date: Feb 2010
Location: Lithuania
Old 05-20-2010 , 13:18   Re: Get random player?
#2

Compiles well, testing now...
eNz0 is offline
Hx7r
Member
Join Date: Mar 2009
Old 05-20-2010 , 13:45   Re: Get random player?
#3

http://forums.alliedmods.net/showthread.php?t=74666
Hx7r is offline
eNz0
Member
Join Date: Feb 2010
Location: Lithuania
Old 05-20-2010 , 14:44   Re: Get random player?
#4

Cant get it work (with tutorial it gets not only 1 player for me) Can someone show the code example with bool: g_isVIP
eNz0 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-20-2010 , 15:08   Re: Get random player?
#5

Code:
new iPlayers[ 32 ], iNum; get_palyers( iPlayers, iNum, "ac" ); g_isVIP[ iPlayers[ random( iNum ) ] ];
__________________
xPaw is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 05-20-2010 , 15:46   Re: Get random player?
#6

PHP Code:
// Get Random Alive -returns index of alive player number n -
fnGetRandomAlive(random_num(1get_maxplayers()))
{
 static 
iAliveid
 iAlive 
0
 
 
for (id 1id <= g_maxplayersid++)
 {
  if (
is_user_alive(id))
   
iAlive++
  
  if (
iAlive == n)
   return 
id;
 }
 
 return -
1;

__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-20-2010 , 19:38   Re: Get random player?
#7

There are plenty of topics for getting a random player in Scripting Help.

Search.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Closed Thread



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 03:39.


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