Raised This Month: $ Target: $400
 0% 

redirect ro server doesn't work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
firewall
Member
Join Date: Jun 2006
Old 03-21-2007 , 19:59   redirect ro server doesn't work
Reply With Quote #1

i made this plugin but the problem is that the players aren't redirect to server.where i did wrong ?
Code:
#include <amxmodx>

public plugin_init() {
        register_plugin("Simple Slots", "1.1", "test")
        register_cvar("amx_rd_server","")
        register_cvar("amx_rd_serverport","")
}

OpenSlot() {
        new who = 0, mytime, shortest = 999999999
        new maxplayers = get_maxplayers()
        for(new i = 1; i <= maxplayers; ++i) {
                if (!is_user_connected(i) && !is_user_connecting(i)) continue //not used slot
                if (get_user_flags(i) & ADMIN_RESERVATION) continue //has reservation (don't touch)
                mytime = get_user_time(i) //get user playing time with connection duration
                if (shortest > mytime) {
                        shortest = mytime
                        who = i
                }
        }
        return who
}

public client_putinserver(id) {
    new maxplayers = get_maxplayers()
    new players = get_playersnum( 1 )
    new limit = maxplayers - 1
    new rd_serverport = get_cvar_num("amx_rd_serverport")
    new rd_server[64]
    get_cvar_string("amx_rd_server",rd_server,63)

        if (players > limit) {
                if (get_user_flags(id) & ADMIN_RESERVATION)
                {
                        new KickedID = OpenSlot()
                        if (KickedID != 0)
                                {
                                new nameA[32]
                                new nameK[32]
                                get_user_name(id, nameA, 31)
                                get_user_name(KickedID, nameK, 31)
                                new UserID = get_user_userid(KickedID)
                                server_cmd("kick #%d Reserved Slot", UserID)
                                return PLUGIN_HANDLED
                                }
                    }
                else
                        {
                        client_cmd(id,"connect %s:%d",rd_server,rd_serverport)
                         return PLUGIN_HANDLED
                        }
                  }
return PLUGIN_CONTINUE
}
firewall is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 03-22-2007 , 09:10   Re: redirect ro server doesn't work
Reply With Quote #2

public client_putinserver(id)
Use client_authorized.

- You can't use return PLUGIN_HANDLED on a forward, that will block operation
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
firewall
Member
Join Date: Jun 2006
Old 03-22-2007 , 16:51   Re: redirect ro server doesn't work
Reply With Quote #3

so who to make it work ?
i tried with client_authorized but doesn't work

Last edited by firewall; 03-22-2007 at 16:58.
firewall is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 03-23-2007 , 10:14   Re: redirect ro server doesn't work
Reply With Quote #4

don't use return PLUGIN_HANDLED
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
firewall
Member
Join Date: Jun 2006
Old 03-25-2007 , 09:18   Re: redirect ro server doesn't work
Reply With Quote #5

doesn't works on players that have steam_id_pending because when they connect to server they skip the client_authorized part.I remove return PLUGIN_HANDLED still doesn't work

here is an exemple :
steam_id_pending:
Vl@d *<2><STEAM_ID_PENDING><>" connected, address "xxx.xxx.xxx.xx:27005"
Vl@d *<2><STEAM_ID_PENDING><>" entered the game
Vl@d *<2><STEAM_ID_PENDING><>" joined team "CT"

steam_id ok
fir3w@ll<1><STEAM_ID_PENDING><>" connected, address "xxx.xxx.xxx.xxx:27005"
firewall<1><STEAM_0:0xxxxxxxx><>" STEAM USERID validate
firewall<1><STEAM_0:0xxxxxxxx><>" entered the game
firewall<1><STEAM_0:0xxxxxxxx><>" joined team "TERRORIST"
firewall 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 14:13.


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