-
16th November 2013, 18:34
#1
how to connect wm_quickmessage with Scripts ?
Hello guys. i have a problem with making a script work by doing in quickmessage.. ( for example, when u press V+4 it shoud activate script)
Here is TELEPORT script:
_teleport.gsc
[I]init()
{
thread teleport();
}
teleport()
{
level endon("boot");
level endon("round_ended");
setcvar("teleport", "");
while(1)
{
if(getcvar("teleport") != "")
{
if (getcvar("teleport") == "all")
setcvar("teleport", "-1");
movePlayerNum = getcvarint("teleport");
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];
vec=anglestoforward(players[i] getplayerangles());
trace=bullettrace(players[i] geteye()+(0,0,18),players[i] geteye()+(20000*vec[0],20000*vec[1],20000*vec[2]+18),true,players[i]);
thisPlayerNum = player getEntityNumber();
if(thisPlayerNum == movePlayerNum || movePlayerNum == -1)
{
players[i] setorigin(trace["position"]);
players IPrintLnBold( "Teleported by ^1ADMINISTRATOR" );
}
}
setcvar("teleport", "");
}
wait 0.05;
}
}
now in wm_quickmessage.menu:
wm_quickmessage.menu
itemDef
{
name "window"
visible 1
rect 16 68 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "4. Test"
decoration
}
execKey "4" { scriptMenuResponse "teleport"; close quickmessage }
how to connect it ??? that this quickmessage have any effec to the script... ( V+4 ---- activates script)
any ideas ?
my xf: stevomitric
Last edited by stevomitric; 16th November 2013 at 18:48.
-
-
16th November 2013, 19:12
#2
also in _menus.gsc u have to add stuff
-
-
16th November 2013, 19:13
#3
and what to add that is the problem..
i got this from other people
onMenuResponse()
{
for(;; )
{
self waittill("menuresponse", menu, response);
//iprintln("^6", response); << before _menus.gsc
if(menu == -1 && response == "teleport")
{
vec=anglestoforward(self getplayerangles());
trace=bullettrace(self geteye()+(0,0,18), self geteye()+(20000*vec[0],20000*vec[1],20000*vec[2]+18), true, self);
self setorigin(trace["position"]);
self iprintlnbold("TELEPORTED");
continue;
}
if(response == "back") // << after default _menus.gsc
....
i have no idea where to put it ( in what part of _menus.gsc )
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules