Raised This Month: $51 Target: $400
 12% 

[REQ] Non-Admin player can change maps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 08-16-2009 , 11:49   [REQ] Non-Admin player can change maps
Reply With Quote #1

I want a plugin that will allow players to change maps in the absence of an admin

If only 1 player is on the server than he can use the command "amx_map"

If there are more players on the server, the player who connected to the server first will have acces to the command "amx_votemap"

HUD messages will be displayed to the player who gain acces to the commands: You are now able to use command "amx_map (or amx_votemap if more players)" to change the current map !
Costin83 is offline
Send a message via Yahoo to Costin83
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 09-29-2009 , 17:08   Re: [REQ] Non-Admin player can change maps
Reply With Quote #2

BUMP !
Costin83 is offline
Send a message via Yahoo to Costin83
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 09-29-2009 , 18:06   Re: [REQ] Non-Admin player can change maps
Reply With Quote #3

Just get: http://forums.alliedmods.net/showthread.php?p=518792
If player is alone he can nominate map and use rtv.
__________________
Impossible is Nothing
Sylwester is offline
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 09-30-2009 , 12:42   Re: [REQ] Non-Admin player can change maps
Reply With Quote #4

Quote:
Originally Posted by Sylwester View Post
Just get: http://forums.alliedmods.net/showthread.php?p=518792
If player is alone he can nominate map and use rtv.
101.2 KB plugin ! ! !
Thanks but I don't want to use it...
Maybe something more simple....
Costin83 is offline
Send a message via Yahoo to Costin83
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 09-30-2009 , 13:27   Re: [REQ] Non-Admin player can change maps
Reply With Quote #5

Do you realise what damage this could cause? A random player might just change the map all the time, which would cause players to leave. Use Galileo or Deagles Map Management instead.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-30-2009 , 13:46   Re: [REQ] Non-Admin player can change maps
Reply With Quote #6

cmdaccess.ini
__________________
xPaw is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 10-01-2009 , 15:19   Re: [REQ] Non-Admin player can change maps
Reply With Quote #7

Quote:
Originally Posted by xPaw View Post
cmdaccess.ini
lol that will let every1 use it.
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
Trafalete
Senior Member
Join Date: Sep 2008
Location: Bucuresti ( Printre nori
Old 10-02-2009 , 09:03   Re: [REQ] Non-Admin player can change maps
Reply With Quote #8

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "amx_map for everyone"
#define VERSION "1.0"
#define AUTHOR "Trafalete"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_concmd("amx_map","changeMap",ADMIN_ALL," <mapname>")
    
register_concmd("amx_votemap","voteMap",ADMIN_ALL," <mapname>")
    
// Add your code here...
}


public 
changeMap(id,level,cid)
{
    
    new 
map[32];
    
read_argv(1,map,32)
    if(!
is_map_valid(map))
    {
        
client_print(id,print_console,"%s is not a valid map.",map);
        return 
PLUGIN_HANDLED
    
}
    else
    {
        new 
name[32];
        
get_user_name(id,name,32);
        if(
get_user_flags(id) & ADMIN_MAP)
        {
            
client_print(0,print_chat,"Admin %s changed map to %s",name,map);
            
server_cmd("changelevel %s",map)
            return 
PLUGIN_HANDLED
        
}
        else
        {
            new 
playernumget_playersnum();
            if( 
playernum != )
            {
                
client_print(id,print_console,"You cannot use this command because there are other players online.")
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
client_print(0,print_chat,"Admin %s changed map to %s",name,map);
                
server_cmd("changelevel %s",map)
                return 
PLUGIN_HANDLED;
            }
        }
    }
}

public 
voteMap(id,level,cid)
{
    new 
map[32]
    
read_argv(1,map,32);
    if(!
is_map_valid(map))
    {
        
client_print(id,print_console,"%s is not a valid map.",map);
        return 
PLUGIN_HANDLED
    
}
    else
    {    
        new 
name[32]
        
get_user_name(id,name,32)
        if(
get_user_flags(id) & ADMIN_VOTE)
        {
            
// here goes vote code
        
}
        else
        {
            new 
playernumget_playersnum()
            if( 
playernum == )
            {
                
client_print(id,print_console,"You are alone, use amx_map instead.");
                return 
PLUGIN_HANDLED
            
}
            else
            {
                new 
time_on=get_user_time(id)
                for(new 
i=0;i<playernum;i++)
                {
                    if ( 
== id )
                        continue
                    if(
is_user_admin(i))
                    {
                        
client_print(id,print_console,"There is admin on the server, ask him to change.");
                        return 
PLUGIN_HANDLED
                    
}
                    new 
time_on2 get_user_time(i);
                    if( 
time_on time_on2 )
                    {
                        
client_print(id,print_console,"You weren't first on the server.");
                        return 
PLUGIN_HANDLED
                    
}
                }
                
                
// here goes vote code
            
}            
        }
    }

i am not sure if this is ok, but i tried, don't know how to make a vote, but i guess you could paste that from the standard plugin
__________________



Last edited by Trafalete; 10-02-2009 at 09:24.
Trafalete 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 17:28.


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