Raised This Month: $ Target: $400
 0% 

Two random players of each team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-07-2012 , 08:47   Two random players of each team
Reply With Quote #1

What's the most efficient method of finding two random players of each team?
Backstabnoob is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-07-2012 , 09:39   Re: Two random players of each team
Reply With Quote #2

Get all players of team 1.
Store random player id of team 1 into variable1.
Get all players of team 2.
Store random player id of team 2 into variable2.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 05-07-2012 , 10:47   Re: Two random players of each team
Reply With Quote #3

example

PHP Code:
#include <amxmodx>
#include <fun>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "[R]ak"

new id_ctid_tt
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""RoundStart""a""1=0""2=0")
}

public 
RoundStart() {
    new 
players[32], pnum
    
    get_players
(playerspnum"ae""CT")
    
    
id_ct players[random(pnum)]
    
    
get_players(playerspnum"ae""TERRORIST")
    
    
id_tt players[random(pnum)]
    
    if(
id_ct && id_tt) {
        
set_user_health(id_ct200)
        
SendMsj(id_ct)
        
        
set_user_health(id_tt200)
        
SendMsj(id_tt)
    }
}

public 
SendMsj(id)
    
client_print(idprint_chat"[AMX] You won 200 of life"
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 05-07-2012 at 10:49.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-07-2012 , 11:11   Re: Two random players of each team
Reply With Quote #4

Quote:
Originally Posted by Backstabnoob View Post
What's the most efficient method of finding two random players of each team?
Backstabnoob is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-07-2012 , 11:12   Re: Two random players of each team
Reply With Quote #5

Oh, two of each? Check out this thread.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-07-2012 , 13:30   Re: Two random players of each team
Reply With Quote #6

Very helpful thread, thanks for linking it.
Backstabnoob 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 00:27.


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