AlliedModders

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

LostSkill 05-24-2009 06:42

[Help] Connection
 
Well i try do redirect plugin but somethink wrong can somebody check it?

PHP Code:

#include <amxmodx>

public plugin_init() {
    
    
register_plugin("redirect","1.0","LostSkill")
    
    
register_cvar("amx_maxplayers","0")
    
}

public 
client_connect(id){
    
    new 
maxplayers get_cvar_num("amx_maxplayers")    
    
    if ( 
get_playersnum() >= maxplayers) {
        
        if(
get_user_flags(id) & ADMIN_RESERVATION)
        {
            return 
1;
        }
        
        else if ( 
get_playersnum() >= maxplayers)
        {
            
client_cmd(id,"connect 123.123.123.123:27015")
        }
    }
    return 
0;



xPaw 05-24-2009 06:47

Re: [Help] Connection
 
PHP Code:

#include <amxmodx>

new gPcvar_Maxplayers;

public 
plugin_init( )
    
gPcvar_Maxplayers register_cvar"amx_maxplayers""0" );

public 
client_connectid ) {
    if( 
get_playersnum() >= get_pcvar_numgPcvar_Maxplayers ) ) {
        if( !( 
get_user_flagsid ) & ADMIN_RESERVATION ) ) {
            
client_cmdid"connect 123.123.123.123:27015" );
        }
    }



LostSkill 05-24-2009 06:54

Re: [Help] Connection
 
Dunno but its dont work too

fysiks 05-24-2009 14:16

Re: [Help] Connection
 
http://forums.alliedmods.net/showthread.php?t=92785

LostSkill 05-25-2009 04:25

Re: [Help] Connection
 
Quote:

Originally Posted by fysiks (Post 833828)

If like this. so how i can do redirect then...

DarkGod 05-25-2009 06:37

Re: [Help] Connection
 
PHP Code:

#include <amxmodx>

new gPcvar_Maxplayers;

public 
plugin_init( )
    
gPcvar_Maxplayers register_cvar"amx_maxplayers""0" );

public 
client_connectid ) {
    if( 
get_playersnum() >= get_pcvar_numgPcvar_Maxplayers ) ) {
        if( !( 
get_user_flagsid ) & ADMIN_RESERVATION ) ) {
            
client_cmdid" connect 123.123.123.123:27015" );
        }
    }


The space bypasses the update.


All times are GMT -4. The time now is 01:28.

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