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

[REQUEST] vote for airaccelerate


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lil_joko
Junior Member
Join Date: Nov 2008
Old 09-02-2010 , 16:05   [REQUEST] vote for airaccelerate
Reply With Quote #1

I know there is another topic which r14170 made, but I want a plugin that vote on every round for 10 or 100 airaccelerate but in every round the votest to be resseted,becouse in the old topic they doesn't reset, I mean if in the first round everyone select 100aa and in the second one everyone select 10aa the vote is even.. so I want 2 plugins actually, first a plugin that vote for 10 or 100 airaccelerate every round and the votes at every round reset, and the second one, only in the first round of the map asks for 10 or 100 airaccelerate! Thank you very much. Sorry for my bad english and my long topic I hope that you will help me and thanks again!
lil_joko is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 09-02-2010 , 17:37   Re: [REQUEST] vote for airaccelerate
Reply With Quote #2

PHP Code:
#include <amxmodx>


new gVoteMenu;
new 
gVotes[2];
new 
gVoting;
new 
cvar_votereset,rounds,cvar_onlyfisrtround,aa_vote_reset
public plugin_init()
{
    
register_logevent("round_start"2"1=Round_Start")
    
cvar_votereset register_cvar("aa_vote_reset","0")
    
cvar_onlyfisrtround register_cvar("aa_only_firstround","0")
    
aa_vote_reset register_cvar("aa_reset_value","10")
    
register_event("TextMsg""round_restart""a""2&#Game_C""2&#Game_w")
    
}
public 
round_restart(id)
{
    
rounds 0
}
public 
round_start(id)
{
    
rounds++
    if(
get_pcvar_num(cvar_votereset) == 1server_cmd("sv_airaccelerate %i",get_pcvar_num(aa_vote_reset))
    if(
get_pcvar_num(cvar_onlyfisrtround) == 1
    { 
        if(
rounds == 1)
        {
            
            
gVoteMenu menu_create("\rWhich airaccelerate?:""menu_handler");
            
            
//Add some vote options
            
menu_additem(gVoteMenu"sv_airaccelerate 10""0"0);
            
menu_additem(gVoteMenu"sv_airaccelerate 100""1"0);
            
            
            new 
players[32], pnumtempid;
            
            
get_players(playerspnum);
            
            for( new 
ii<pnumi++ )
            {
                
tempid players[i];
                
                
                
menu_display(tempidgVoteMenu0);
                
                
                
gVoting++;
            }
            
            
set_task(20.0"EndVote");
        }
    }
    return 
PLUGIN_HANDLED;
}
public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
voteid str_to_num(data);
    
    
gVotes[voteid]++;
    
    return 
PLUGIN_HANDLED;
}
public 
EndVote()
{
    if( 
gVotes[0] > gVotes[1] )
    {
        
client_print(0print_chat"sv_airaccelerate has been set to 10");
        
server_cmd("sv_airaccelerate 10")
    }
    else if( 
gVotes[0] < gVotes[1] )
    {
        
client_print(0print_chat"sv_airaccelerate has been set to 100");
        
server_cmd("sv_airaccelerate 100")
    }
    else
        
client_print(0print_chat"The vote tied at %d votes each."gVotes[0] );
    
    
menu_destroy(gVoteMenu);
    
    
gVoting 0;

If you sv_restart and the aa_only_firstround cvar is on the vote will appear again only the first round after the restart.
Code:
Cvars:
//Controls the first round only vote.
aa_only_firstround 0/1 (default 0)
//Controls the reset of the airaccelerate command on start of the round.
aa_vote_reset 0/1 (default 0)
//Controls the value of the airaccelerate which if the 
//"first round only" cvar is on will reset to.
aa_reset_value (default 10)

Last edited by SpeeDeeR; 10-01-2010 at 15:57.
SpeeDeeR is offline
lil_joko
Junior Member
Join Date: Nov 2008
Old 09-03-2010 , 01:43   Re: [REQUEST] vote for airaccelerate
Reply With Quote #3

I told you that this doesnt work right so if you can't make it, then make a new plugin that votes only in the first round of the map for 10/100aa and stays the voted airaccelerate for the rest of the map!PLEASE HELP - http://forums.alliedmods.net/showthr...ccelerate+vote

Last edited by lil_joko; 09-03-2010 at 01:46.
lil_joko is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-03-2010 , 02:11   Re: [REQUEST] vote for airaccelerate
Reply With Quote #4

Did you set as_only_firstround to 1 in his code???
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
lil_joko
Junior Member
Join Date: Nov 2008
Old 09-03-2010 , 02:32   Re: [REQUEST] vote for airaccelerate
Reply With Quote #5

ooh thanks dude, how stupid of me ;( I didn't see that sorry all!


EDIT: Can you compile that and add it here,becouse I have problems with the complying PLEASE :S

Last edited by lil_joko; 09-03-2010 at 02:36.
lil_joko is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 09-03-2010 , 06:45   Re: [REQUEST] vote for airaccelerate
Reply With Quote #6

I must submit atleast 2 characters to post this, so yeah ....
Attached Files
File Type: sma Get Plugin or Get Source (aavote.sma - 552 views - 2.2 KB)
SpeeDeeR is offline
lil_joko
Junior Member
Join Date: Nov 2008
Old 09-03-2010 , 07:21   Re: [REQUEST] vote for airaccelerate
Reply With Quote #7

Thank you so much! and sorry for the spam
lil_joko is offline
r14170
Veteran Member
Join Date: Dec 2009
Old 09-03-2010 , 08:43   Re: [REQUEST] vote for airaccelerate
Reply With Quote #8

jokoVICH, you are happy now
r14170 is offline
lil_joko
Junior Member
Join Date: Nov 2008
Old 09-03-2010 , 10:07   Re: [REQUEST] vote for airaccelerate
Reply With Quote #9

yaayyy

EDIT: BTW jokovich just won a tennis match 3 - 0 setts

Last edited by lil_joko; 09-03-2010 at 10:58.
lil_joko is offline
r14170
Veteran Member
Join Date: Dec 2009
Old 09-05-2010 , 06:10   Re: [REQUEST] vote for airaccelerate
Reply With Quote #10

<--- lol!

Last edited by r14170; 09-05-2010 at 06:12.
r14170 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 07:37.


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