Raised This Month: $ Target: $400
 0% 

amx_redirected in amxx 0.16


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Malina
Junior Member
Join Date: Mar 2004
Location: Ukraine
Old 04-08-2005 , 10:39   amx_redirected in amxx 0.16
Reply With Quote #1

I use amxx 0.16 but I not find plugin redirected to this AMXX version..
I am from Ukraine, sorry, I have problems with english..

I have amx_redirected.amx by AMX 0.9.9 but in AMXX 0.16 he no compiling? have problems? help me

code:

Code:
/* AMX Mod script.
*
* Server Redirection
*  by Namralkeeg
*
* Support Multiple servers. If more than one server is registred, it randomly picks one
* to redirect. If only 1 is registred it just forwards the person to it.
*
* Usage: amx_redirect "ip:port"
*
*/

#include <amxmod>

#define MAX_SERVERS 4
#define MAX_SERVER_STRING 33

new numServers = 0
new serverList[MAX_SERVERS][MAX_SERVER_STRING]
new serverMax = MAX_SERVERS

public redirect()
{
    if (read_argc() != 2)
    {
        server_print("Usage: amx_redirect <ip:port>")
        return PLUGIN_HANDLED
    }
    else if ((numServers + 1) > serverMax)
    {
        server_print("[AMX] Max Number of Redirect Servers Reached.")
        return PLUGIN_HANDLED
    }
    else
    {
        new currServer[MAX_SERVER_STRING]
        read_argv(1,currServer,MAX_SERVER_STRING)
        /* Check for dups. */
        for(new i = 0; i < numServers; i++)
        {
            if(equal(currServer,serverList[i]))
            {
                server_print("[AMX] Redirect Server %s already exists!",currServer)
                return PLUGIN_HANDLED
            }
        }

        copy(serverList[numServers],MAX_SERVER_STRING,currServer)
        server_print("[AMX] Redirect Server added: %s",serverList[numServers])
        numServers++
        return PLUGIN_HANDLED
    }

    return PLUGIN_HANDLED
}

public redirect_reload()
{
    numServers = 0
    server_print("[AMX] Reloading Server Redirect List")
    server_cmd("exec addons/amx/redirect.cfg")
   
    return PLUGIN_HANDLED
}

redirect_client(id,randomServer)
{
   client_cmd(id,"echo ^"Server is currently full^"")
        client_cmd(id,"echo ^"Redirecting to %s^";wait;wait;connect %s",serverList[randomServer],serverList[randomServer])
}

public client_connect(id)
{
    new maxplayers
    new reserved
    new slotsfree
    new reserveType

    if(numServers > 0)
    {
        new randomServer
        if(numServers > 1)
            randomServer = random_num(0,numServers-1)
        else
            randomServer = 0

        if(cvar_exists("amx_reserved_slots"))
            reserved = get_cvar_num("amx_reserved_slots")
        else
            reserved = 0
           
        if(cvar_exists("amx_reservation"))
            reserveType = get_cvar_num("amx_reservation")
        else
            reserveType = 0
                   
        maxplayers = get_maxplayers()

        new players = get_playersnum() + 1 /* on connection we must add you */
        slotsfree = maxplayers - players
        //if ( ((slotsfree <= 0) || (slotsfree <= reserved)) && ((reserveType == 0) || (reserveType == 3)) )
        if ( (reserveType == 0) || (reserveType == 3) )
        {
                if(slotsfree <= 0)
                   redirect_client(id,randomServer)
                else if((slotsfree <= reserved) && (!(get_user_flags(id) & ADMIN_RESERVATION)))
                {
                   redirect_client(id,randomServer)
                   return PLUGIN_HANDLED
                }
        }
        else if( ((reserveType == 1) || (reserveType == 2)) )
        {
           if( !(get_user_flags(id) & ADMIN_RESERVATION) )
           {
              if( slotsfree <= 0 )
              {
                 redirect_client(id,randomServer)
		 return PLUGIN_HANDLED
	      }
	   }
        }
    }

    return PLUGIN_CONTINUE
}

public plugin_init()
{
    register_cvar("KEEG_Redirect", "0.3.2",FCVAR_SERVER)
    register_plugin("AMX Redirect","0.3.2","Namralkeeg")
    register_srvcmd("amx_redirect", "redirect")
    register_srvcmd("amx_redirect_reload","redirect_reload")
    server_cmd("exec addons/amx/redirect.cfg")

    return PLUGIN_CONTINUE
}
Malina is offline
Send a message via ICQ to Malina
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 04-08-2005 , 10:59  
Reply With Quote #2

upgrade to 1.01 why 0.16
__________________
- Bye bye!
nightscreem is offline
XxKpAznGuyxX
Senior Member
Join Date: Dec 2004
Location: EARTH!!
Old 04-08-2005 , 13:40  
Reply With Quote #3

Quote:
Originally Posted by nightscreem
upgrade to 1.01 why 0.16
WHO CARES WHAT VERSION HE USES!


Any ways here
Attached Files
File Type: sma Get Plugin or Get Source (redirect.sma - 1030 views - 3.6 KB)
__________________
24/7 Chicago Terror-8.9.2.120:27015
XxKpAznGuyxX is offline
Send a message via AIM to XxKpAznGuyxX Send a message via MSN to XxKpAznGuyxX
Malina
Junior Member
Join Date: Mar 2004
Location: Ukraine
Old 04-10-2005 , 02:19  
Reply With Quote #4

I have problems

When I compile in Linux, I see


Code:
Small compiler 2.1.0    Copyright (c) 1997-2002

redirect.sma(0) : fatal error 101: cannot write to file: "compiled/redirect.sma"

Compilation aborted 
1 error.
(
CHMOD 777
I dont know, why trouble?


I lost compilation instrument for WIN32 (( who can me give this compilation instrument AMX 0.16
Malina is offline
Send a message via ICQ to Malina
Malina
Junior Member
Join Date: Mar 2004
Location: Ukraine
Old 04-10-2005 , 02:24  
Reply With Quote #5

I need only v. AMXX 0.16 plz help me

1st server full, 2nd 0/32 (((
Malina is offline
Send a message via ICQ to Malina
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-10-2005 , 03:49  
Reply With Quote #6

Use the web-compiler.. http://amxmodx.org/compiler.php?go=sc

You'll get 2 loose-indentation warnings, ignore them.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Malina
Junior Member
Join Date: Mar 2004
Location: Ukraine
Old 04-10-2005 , 14:11  
Reply With Quote #7

Quote:
Originally Posted by v3x
Use the web-compiler.. http://amxmodx.org/compiler.php?go=sc

You'll get 2 loose-indentation warnings, ignore them.


You don't undersand me ( me need only v 0.16

this compiler use 1.01 version, and finish file name *.amxx

Why I have warnings?
Malina is offline
Send a message via ICQ to Malina
Malina
Junior Member
Join Date: Mar 2004
Location: Ukraine
Old 04-10-2005 , 14:13  
Reply With Quote #8

I compile and have problems


Code:
/home/groups/amxmodx/tmp/php49Eefh.sma(57) : warning 217: loose indentation
/home/groups/amxmodx/tmp/php49Eefh.sma(107) : warning 217: loose indentation

2 Warnings.
Done.
Who can me help?
Malina is offline
Send a message via ICQ to Malina
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 04-10-2005 , 15:26  
Reply With Quote #9

Quote:
Originally Posted by Malina
I compile and have problems


Code:
/home/groups/amxmodx/tmp/php49Eefh.sma(57) : warning 217: loose indentation
/home/groups/amxmodx/tmp/php49Eefh.sma(107) : warning 217: loose indentation

2 Warnings.
Done.
Who can me help?
You can ignore these warnings. The compiler should have produced a .amx file anyway.
__________________
hello, i am pm
PM is offline
Malina
Junior Member
Join Date: Mar 2004
Location: Ukraine
Old 04-11-2005 , 06:31  
Reply With Quote #10

use AMXX 0.16
[ 33] unknown unknown unknown redirect.amx bad load

use AMXX 1.01
[ 24] AMX Redirect 0.3.2 Namralkeeg redirect.amxx running

but he dont redirecting me... ( don't work ((


I need only AMXX 0.16 my systems have lags when use AMXX 1.01 ((
Malina is offline
Send a message via ICQ to Malina
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 09:49.


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