Script---- Help


(_NeT_WalBanger) #1

Ok been working on a few scripts and i cant seem to get this 1 working can you tell me where im going wrong :s

This goes in the autoexec.cfg

// Hide or Show you Main Weapon Script
//
bind “k” “weaponbank 1; cg_drawgun 1”
bind “k” “weaponbank 3; cg_drawgun 1”
bind “k” “weaponbank 6; cg_drawgun 1”
bind “k” “weaponbank 5; cg_drawgun 1”
bind “k” “weaponbank 7; cg_drawgun 1”
bind “k” “weaponbank 4; cg_drawgun 1”
bind “k” “weaponbank 2; cg_drawgun 1”
//
bind “k” “vstr waffenanzeige”
set ohnetwaffe “exec hauptwaffe_aus.cfg ; set waffenanzeige vstr mitwaffe;
echo ^oHIDE ^0Mainweapon”
set mitwaffe “exec hauptwaffe_an.cfg; set waffenanzeige vstr ohnewaffe;
echo ^oSHOW ^0Mainweapon”
set waffenanzeige “vstr ohnewaffe”
//

and the there are 2 files called “hauptwaffe_an.cfg” and “hauptwaffe_aus.cfg” placed in the etmain folder
1st 1 has this code in it (hauptwaffe_an.cfg)
//
// Hauptwaffe sichtbar
//
bind “k” “weaponbank 3; cg_drawgun 1”
//

2nd has this code (hauptwaffe_aus.cfg)
//
// Hauptwaffe unsichtbar
//
bind “k” “weaponbank 3; cg_drawgun 0”
//

Also i got a feeling that there is and EASIER way of doing this…

And for an Extra i got a script that zooms the compass map in and out:-
//Zoom mini map
bind = “mapzoomin” //zooms compass map in
bind - “mapzoomout” //zooms compass map out
//

That works but i want to know how to make the map stay zoomed out instead of having to do it every time a new map starts…


(Sauron|EFG) #2

There’s so many errors in there (e.g. trying to bind everything to “k”) that I can’t even tell what you’re trying to do… Maybe you could tell us?

Also, take a look at RTCW 4 Newbies (former RTCW 4 Dummies :blah: ), Iffy have some good sample scripts there.

http://www.rtcwonline.com/dummies/


(Kendle) #3

Syntax error in this bit:-

bind “k” “vstr waffenanzeige”
set ohnetwaffe “exec hauptwaffe_aus.cfg ; set waffenanzeige vstr mitwaffe; echo ^oHIDE ^0Mainweapon”
set mitwaffe "exec hauptwaffe_an.cfg; set waffenanzeige vstr ohne
twaffe; echo ^oSHOW ^0Mainweapon"
set waffenanzeige "vstr ohne
twaffe"

Unless there isn’t meant to be a “t” in “ohnetwaffe”, in which case change the 2nd line instead.

Also, I assume you’re using “k” in this example to represent a key, and that you’re not actually binding stuff to the key “k”. If so, which keys are you actually using (copy and paste the actual scripts). If you are binding “vstr waffenanzeige” to “k” and then binding it to something else in the other 2 script files, then of course it’s not going to work.

As for making it easier, I’m not sure what you’re trying to achieve. Wouldn’t simply adding the appropriate cg_drawgun to each weapon bind be easier?

bind k “weaponbank 1; cg_drawgun 1”
bind k “weaponbank 3; cg_drawgun 0”
bind k “weaponbank 6; cg_drawgun 1”
bind k “weaponbank 5; cg_drawgun 1”
bind k “weaponbank 7; cg_drawgun 1”
bind k “weaponbank 4; cg_drawgun 1”
bind k “weaponbank 2; cg_drawgun 1”

Or just have a key to toggle cg_drawgun on and off, like this:-

bind k “toggle cg_drawgun”


(_NeT_WalBanger) #4

OK guys thanks alot
Well what i was trying to do is get the MG gun removed off my screen cause when i lie on a hill im fed up of the gun getting in the way of the cross hairs so i was shooting “blind”

When i looked at this script it did look over complicated but i think it was so that you could have other gun skins on like pistol grenade etc while switching another OFF like MG
Cause thats all i want off, the MG


(_NeT_WalBanger) #5

Hmmm i had a little fiddle and it is the t missing from the Script.
AND i had to change 1 of the “hauptwaffe” files Bind Keys, so i got 1 key as “k” and other as “J”

Now it works BUT not what i was looking for :’(… This now when i press J or K it CHANGES to weapon 3 automatically and turn ALL the skins on or off

What im looking for:-
Now I want a script that can turn off the skin for My MG or Weapon bank 3 if you cant just do the 1 gun… WITH OUT Swopping weapons
and for it to echo that its ON or OFF

Can you help me with that??? or is this the Best it can do???


(_NeT_WalBanger) #6

Ok Had another fiddle and added an Echo on it. as i like Echos :wink:

// Hide or Show you Main Weapon Script
//
set Guntog1 “cg_drawgun 0; set Guntog vstr Guntog2; echo ^0Gun Skin ^oOFF”
set Guntog2 “cg_drawgun 1; set Guntog vstr Guntog1; echo ^0Gun Skin ^oON”
set Guntog “vstr Guntog2”
bind k “vstr Guntog”


(Kendle) #7

Always more satisfying when you work it out for yourself… :clap:


(_NeT_WalBanger) #8

Ya but emmm… its not what i want…

What im looking for:-
Now I want a script that can turn off the skin for My MG or Weapon bank 3 if you cant just do the 1 gun… WITH OUT Swopping weapons
and for it to echo that its ON or OFF

Can you help me with that??? or is this the Best it can do???


(Ifurita) #9

This the the config that gets exec’d everytime I change class to soldier:

//ET class-specific config by Michael “Ifurita” Kan, 7/17

//Weapons
bind b “weaponbank 3; wait 10; +prone; wait 10; -prone; wait 25; weapalt” //prone + deploy bipod for mg42
bind w “vstr nextw-bank23s”
bind r “weaponbank 4; cg_drawgun 1; vstr resets”
bind q “weaponbank 1; cg_drawgun 1; vstr resets”
bind t “toggle cg_drawgun” //use to turn off mg-42

//Multiple-Weaponbind Script Weaponbank 2 and 3
set w-bank2s “weaponbank 2; cg_drawgun 1; set nextw-bank23s vstr w-bank3s”
set w-bank3s “weaponbank 2; weaponbank 3; cg_drawgun 1; set nextw-bank23s vstr w-bank2s”
set nextw-bank23s “vstr w-bank3s”

//Resets to Heavy Weapon
set resets “set nextw-bank23s vstr w-bank3s”

You’ll notice that my gun is always drawn as a soldier (SMG not drawn for other classes), but the toggle to turn gun on and off is very accessible at the ‘T-key’


(_NeT_WalBanger) #10

Hmm what does this do?

I like the prone thing but whats the rest for?

I would like that prone to get rid of the Weapon Skin to, and then draw it again whenstand up :smiley:

Could you do that???


(_NeT_WalBanger) #11

Ok Seeing as you are to slow :wink: i Fiddled with it and made my own :d

//Weapons
bind b “weaponbank 3; wait 10; +prone; wait 10; toggle cg_drawgun; wait 10; -prone ;wait 25; weapalt” //This Lies you down with the MG, puts the stand out and the removes the Skin //then when you press b again it stands you and puts the skin back.