Raised This Month: $ Target: $400
 0% 

vote for map extending


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rymek
Junior Member
Join Date: May 2004
Old 05-09-2004 , 13:12   vote for map extending
Reply With Quote #1

Hi. I was searching for a plugin which on the end of map will start vote for map extending. I found OLO's plugin on AMX mod official forum, but unfortunately it does not work with AMXX. Could someone look at this and correct it or something? It would be great. Here's the plugin code:

Code:
/* AMX Mod script. * * (c) Copyright 2002, OLO * This file is provided as is (no warranties). * */ #include <amxmod> /* cvars: *  max. time on which map can be extended (there will be always min. one vote) *  amx_extendmap_max  < value > * *  when voting is successful set how much time we want play *  amx_extendmap_step  < value > */ new gShowVote = 1 new gVotes new bool:cstrike_running new logfilename[256] public check_votes(){ new players[32], inum get_players(players,inum,"c") new Float:step_time = get_cvar_float("amx_extendmap_step") new Float:mp_time = get_cvar_float("mp_timelimit") new Float:vote_ratio = get_cvar_float("amx_extendmap_ratio") new Float:result_v = inum ? (float(gVotes) / float(inum)) : 0.0 if (result_v >= vote_ratio) { client_print(0,print_chat,"* Voting successful. Map will be extended to next %.0f minutes",step_time) log_to_file(logfilename,"Vote: Voting for the map extending successful (ratio ^"%.2f^") (needed ^"%.2f^") (time ^"%.0f^")", result_v,vote_ratio,step_time) new Float:new_time = mp_time + step_time set_cvar_float("mp_timelimit",new_time) if (new_time < get_cvar_float("amx_extendmap_max") ) gShowVote = 1 else remove_task(7777) } else { remove_task(7777) client_print(0,print_chat,"* Voting failed. Map won't be extended") log_to_file(logfilename,"Vote: Voting for the map extending failed (ratio ^"%.2f^") (needed ^"%.2f^")", result_v, vote_ratio)   } return PLUGIN_HANDLED } public vote_count(id,key){ if (get_cvar_float("amx_vote_answers")) { new name[32] get_user_name(id,name,31) client_print(0,print_chat,"* %s voted %s extending",name,key ? "against" : "for") } if (!key) ++gVotes return PLUGIN_HANDLED } public vote_extend(){ new timeleft = get_timeleft() if (gShowVote&&(timeleft>0)&&(timeleft<120)){ gShowVote = 0 gVotes = 0 new mapname[64] get_mapname(mapname,63) new menu[256] if (cstrike_running) format(menu,255,"\yAMX Extend map %s?\w^n^n1.  Yes^n2.  No",mapname) else format(menu,255,"AMX Extend map %s?^n^n1.  Yes^n2.  No",mapname) show_menu(0,(1<<0)|(1<<1),menu,10) set_task(10.0,"check_votes") client_cmd(0,"spk Gman/Gman_Choose2") client_print(0,print_chat,"* Voting for the map extending started...") log_to_file(logfilename,"Vote: Voting for the map extending started (map ^"%s^")",mapname) } return PLUGIN_HANDLED } public plugin_init(){ register_plugin("Map Extend Vote","1.0","default") register_menucmd(register_menuid("AMX Extend map "),(1<<0)|(1<<1),"vote_count") register_cvar("amx_extendmap_ratio","0.4") register_cvar("amx_extendmap_max","90") register_cvar("amx_extendmap_step","15") register_cvar("amx_vote_answers","0") set_task(10.0,"
Rymek is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 05-09-2004 , 13:20  
Reply With Quote #2

i ported it to AMXX for you.

you have to disable the amxx mapchooser to use this plugin!

change that:
Code:
mapchooser.amx		; allows to vote for next map
to
Code:
;mapchooser.amx		; allows to vote for next map
in your plugins.ini and don't forget to add map_extend_vote.amx!
FeuerSturm is offline
Rymek
Junior Member
Join Date: May 2004
Old 05-09-2004 , 13:56  
Reply With Quote #3

Thx! it works!
Rymek is offline
Rymek
Junior Member
Join Date: May 2004
Old 05-10-2004 , 10:48  
Reply With Quote #4

well it's not working fine. There's 1 problem. I have mp_timelimit 20 set on my server. And when the vote extend is succesfull, the mp_timelimit is changed to 30. And it's kept through next map, and so on. I think i'ts a bug. I think it's because HLDS doesn't execute server.cfg after change of a map. I dont know how to fix it So again... help
Rymek is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 05-10-2004 , 12:14  
Reply With Quote #5

Quote:
Originally Posted by Rymek
well it's not working fine. There's 1 problem. I have mp_timelimit 20 set on my server. And when the vote extend is succesfull, the mp_timelimit is changed to 30. And it's kept through next map, and so on. I think i'ts a bug. I think it's because HLDS doesn't execute server.cfg after change of a map. I dont know how to fix it So again... help
add
Code:
mp_timelimit 20
to amxx.cfg, that's executed on every mapchange.
FeuerSturm is offline
StopSpazzing
Member
Join Date: Jun 2005
Location: California
Old 10-16-2005 , 14:32  
Reply With Quote #6

Hey fire...can you please post a link to dl the sma or point me to a place to dl it? I need this plugin.
StopSpazzing is offline
Send a message via AIM to StopSpazzing Send a message via Yahoo to StopSpazzing
Reply


Thread Tools
Display Modes

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 21:18.


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