Raised This Month: $ Target: $400
 0% 

Force mapvote from another plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jeppelykke
Member
Join Date: May 2005
Location: Hjørring, Denmark
Old 11-23-2006 , 16:05   Force mapvote from another plugin
Reply With Quote #1

Hey Hey

How can i force a mapvote (like the vote when there are 2 mins left on a gameserver.)

The command i need to force on my plugin is: voteNextmap from mapchooser.

More Info:
When a player won on my server, (a mod i working on), then i need to force it to preform a mapvote, where it actives: voteNextmap from the mapchooser.amxx

Can anyone be so kind and help.
__________________
Best Regards
Jeppe Lykke, Denmark

Last edited by jeppelykke; 11-23-2006 at 16:05. Reason: Spelling errors
jeppelykke is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 11-24-2006 , 02:58   Re: Force mapvote from another plugin
Reply With Quote #2

Use callfunc's natives from the core.
VEN is offline
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 11-24-2006 , 05:23   Re: Force mapvote from another plugin
Reply With Quote #3

won't this work aswell

#include <mapchooser.amxx>

and then calling up the function ?
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
watch
Senior Member
Join Date: Sep 2005
Old 11-24-2006 , 08:12   Re: Force mapvote from another plugin
Reply With Quote #4

No, do what VEN said

Code:
callfunc_begin("voteNextmap","mapchooser") callfunc_end()
__________________
Code:
#include <amusing_small_signiture>

Last edited by watch; 11-24-2006 at 08:18.
watch is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 11-24-2006 , 08:15   Re: Force mapvote from another plugin
Reply With Quote #5

Quote:
won't this work aswell

#include <mapchooser.amxx>

and then calling up the function ?
mapchooser.amxx is a binary, you can't include it.
VEN is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-24-2006 , 12:04   Re: Force mapvote from another plugin
Reply With Quote #6

The function voteNextmap is called every few seconds by mapchooser.amxx, not only when it is time to vote. Whenever it is called, it checks if it should do a map vote, and if not just keeps looping every few seconds. So, this is how I trigger it in GunGame AMXX:

Code:
// force maxrounds -1 so that mapchooser thinks that the game is almost over new oldValue = get_cvar_num("mp_maxrounds"); set_cvar_num("mp_maxrounds",-1); // call the vote if(callfunc_begin("voteNextmap","mapchooser.amxx") == 1)     callfunc_end(); // set maxrounds back set_cvar_num("mp_maxrounds",oldValue);

I also make sure to check the callfunc_begin for success before using callfunc_end, because it could raise a runtime error otherwise.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
jeppelykke
Member
Join Date: May 2005
Location: Hjørring, Denmark
Old 11-25-2006 , 03:35   Re: Force mapvote from another plugin
Reply With Quote #7

Thank you so much XxAvalanchexX

Have a very good weekend
__________________
Best Regards
Jeppe Lykke, Denmark
jeppelykke 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 06:57.


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