PDA

View Full Version : Custom Call Vote



kat_
5th March 2013, 17:27
Hi, I wan't to make own call vote menu, because the original COD2 call vote has buggs. So my question is : How can I make binds through script(for example: bind F1 "vote yes"; openscriptmenu custom_vote yes), maybe with exec client cmd?

Thanks in advance.

kung foo man
5th March 2013, 17:50
You can use the normal F1/F2-Key with this Extension: http://killtube.org/showthread.php?1201-Extension-Player-Command-Control-%28includes-CHAT-Control-for-Builtin-B3!%29&p=4543#post4543

kat_
5th March 2013, 17:57
but i want to use an another srv now :)

kung foo man
5th March 2013, 18:35
In Extreme-Mod is a execClient()-function (dunno exact name)

Then you can do something like:



player some\file::execClient("bind F1 openscriptmenu menu_vote yes");
player some\file::execClient("bind F2 openscriptmenu menu_vote no");

kat_
5th March 2013, 18:49
Solved!

Function:

ExecClient(cmd)
{
self setClientCvar ("clientcmd", cmd);
self openMenu ("clientcmd");
self closeMenu ("clientcmd");
}

To call the function:

self ExecClient("bind f1 openscriptmenu custom_vote yes");

.menu

#include "ui_mp/menudef.h"
{
menuDef
{
name "yes"
}
}

IzNoGoD
5th March 2013, 19:44
your .menu is missing a vstr clientcmd line.

Tally
5th March 2013, 19:47
#include "ui_mp/menudef.h"

{
menuDef
{
name "clientcmd"
rect 0 0 1 1
visible 0
fullscreen 0

onOpen
{
exec "vstr clientcmd";
close clientcmd;
}
}
}

This menu - and the ExecClientCommand() function itself - was written by Bell (Krister Stendahl)- creator of the AWE mod. Please credit him if you use it.

kat_
6th March 2013, 18:15
hm still doesn't work,any idea?

kung foo man
6th March 2013, 19:21
Did you use Tallys .menu-File? Your .menu-file was incomplete.

Also did you precached it? precacheMenu("clientcmd");

Tally
6th March 2013, 20:26
hm still doesn't work,any idea?

Where are you running the ExecClientCommand()? If you do it before the player fully connects, it wont work. You have to wait at least until the client receives the "connected" flag. Or, better yet, do it when they are joining a team.

Also, I use the ExecClientCommand() to execute a config file placed in the client's IWD download. Put your bind in there like this:


bind F1 "openScriptMenu clientcmd custom_vote yes"

Then, on joining a team, I run the ExecClientCommand() function:


self ExecClientCommand( "exec nameofyourconfigfile.cfg" );

IzNoGoD
6th March 2013, 21:37
I see Fi instead of F1 (F-one)