Raised This Month: $ Target: $400
 0% 

how to check players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 05-04-2010 , 08:34   how to check players
Reply With Quote #1

1.How can i check how many players are on server right now ?

can someone give me a code/snippet please.

2. How can i make that when there are like 22 players on server, 1 more guy joins server, then he will be redirected to another server in 5 seconds.

PHP Code:
client_print(i"you will be redirected to our new server in 5 seconds")
set_task(5.0,"redirect")

public 
redirect(i)
{
client_cmd(i"connect newserverip")

reinert is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 05-04-2010 , 10:18   Re: how to check players
Reply With Quote #2

PHP Code:
public client_connect(id){
    if(
get_playersnum(1) > 22)
        
set_task(5.0"redirect"id)

__________________
Impossible is Nothing
Sylwester is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 05-04-2010 , 10:35   Re: how to check players
Reply With Quote #3

Like this: ?

PHP Code:
#include <amxmodx>


public plugin_init() {
    
register_plugin("RD","1.0","addinol")
}


public 
client_connect(){
    
    if(
get_playersnum(1) > 22)
    {
        
set_task(5.0,"redirect")
    }
    
}

public 
redirect(){
    
client_cmd(  <<<<< what about this >>>>>  ,"Connect serverip")

reinert is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-04-2010 , 10:43   Re: how to check players
Reply With Quote #4

PHP Code:
#include <amxmodx>


public plugin_init() {
    
register_plugin("RD","1.0","addinol")
}


public 
client_connect(id){
    
    if(
get_playersnum(1) > 22)
    {
        
set_task(5.0,"redirect"id)
    }
    
}

public 
redirect(id){
    
client_cmd(id"Connect serverip")

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 03:36.


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