Raised This Month: $ Target: $400
 0% 

Get a random player from CT&T team


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-18-2013 , 09:12   Re: Get a random player from CT&T team
Reply With Quote #7

Should work.
PHP Code:
GetRandomInTeamPlayer()
{
    new 
ts[32], cts[32];
    new 
tCountctCount;
    
get_players(tstCount"e""TERRORIST");
    
get_players(ctsctCount"e""CT");
    
    if (!
tCount && !ctCount)
        return 
0;
    
    new 
index random(tCount ctCount);
    
    if (
index >= tCount)
        return 
cts[index tCount];
    
    return 
ts[index];

__________________

Last edited by hleV; 02-19-2013 at 06:31.
hleV is offline
 



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


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