Jump to content

I can't get this script to work


l0rath

Recommended Posts

Hi!

 

I was sent here from the ET-Subreddit.

 

I've been trying to get this script to work, that automatically triggers a team-msg when I cook a grenade & a vsay once I throw it. But somehow I can't get it to display an alternative text for the vsay FireInTheHole.

bind 4 "vstr gt;weaponbank 4"

set gtON "+attack;vstr grenadethON"

set gtOFF "-attack;vstr grenadethOFF;vsay_team FireInTheHole ^7Throwing Grenade!;bind mouse1 +attack"

set grenadethDefault "say_team ^7Timing Grenade! ;set grenadethON vstr nic"

set grenadethON "vstr grenadethDefault"

set grenadethOFF "set grenadethON vstr grenadethDefault"

set gt "bind mouse1 +vstr gtON gtOFF;" 

As someone pointed out already this script is kinda unnecessary & I don't think I'm actually going to use it. But it still bugs me that it doesn't work... Can someone point out any mistakes, please?

 

Thanks!

Link to comment
Share on other sites

Nope, doesn't work :(

 

It still just plays the vsay & displays "Fire in the hole!".

 

I've tested the script in vanilla, nitmod, jaymod & etpub - same results everytime.

 

What I don't get is why this line works:

set grenadethDefault "say_team ^7Timing Grenade! ;set grenadethON vstr nic"

and this one doesn't:


set gtOFF "-attack;vstr grenadethOFF;vsay_team FireInTheHole ^7Throwing Grenade!;bind mouse1 +attack"

I've seen people rename the displaytext of a vsay, that can't be the problem.

Link to comment
Share on other sites

  • Leader

It does work, but you have to press 4 each time you want to use it.  I doesn't work for throwing a second grenade, unless you press 4 again.

 

The team vsay can't be heard if you have /cg_novoicechats 1.  I changed mine to 0 and I could hear the team vsay.

 

and what is this, in the fifth line:

 

set grenadethDefault "say_team ^7Timing Grenade! ;set grenadethON vstr nic"

 

 

IOrath, you posted before me and left, before i finish my post here!   :)  I was perusing tthe logic of the nic.

 

I see the say_team ^7Timing Grenade!, and hear and see the  vsay_team FireInTheHole ^7Throwing Grenade

Edited by RedBaird
Link to comment
Share on other sites

 

and what is this, in the fifth line:

 

set grenadethDefault "say_team ^7Timing Grenade! ;set grenadethON vstr nic"

 

Honestly, I have no idea... :lol:

 

I just recently started playing again & dug out my old cfg stuff. Well... maybe this is an impossible task after all :/

Link to comment
Share on other sites

  • Leader

 

The team vsay can't be heard if you have /cg_novoicechats 1.  I changed mine to 0 and I could hear the team vsay.

 

 

Link to comment
Share on other sites

I can hear the vsay, my problem is that it displays the standart 'Fire in the hole' instead of my alternative text.

 

 

/e

 

set gtOFF "-attack;vstr grenadethOFF;vsay_team FireInTheHole ^7Throwing Grenade!;bind mouse1 +attack"

Edited by l0rath
Link to comment
Share on other sites

  • Leader

Just discovered that if you do not "cook" the grenade, the second line does not show.

 

If you do "cook" it a few seconds, the vsay_team and the "Throwing Grenade" will sound off and show.

 

post-8926-0-35666500-1414675411_thumb.jpg

 

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...
  • Clan Friend

I tested it, and it sort of works... unnecessary, but it works (tested on jaymod... not all mods support vsay + text, though)

 

anyway there is a load of useless vstr in there...

 

for example, why did you write:

bind 4 "vstr gt;weaponbank 4"

[...]

set gt "bind mouse1 +vstr gtON gtOFF;" 

what's that gt for? you could just have done it like:

bind 4 "bind mouse1 +vstr gtON gtOFF; weaponbank 4"

and later, vstr nic ?? where is the set nic something? You forgot to paste it? I don't know what it's supposed to do...

 

as i said, there is a lot of useless chains of nested vstr commands in that script of yours...

It's a bit (actually, more than a bit) messy, and if you have more grenades, after you release fire it binds mouse1 back to +attack, so it works only with the 1st grenade...

 

you could have rebinded mouse1 to +attack in the weaponbank bind, or maybe bind a separate button for 'fire in the hole' and be happy with that :)

Edited by SunLight
  • Like 2
Link to comment
Share on other sites

  • Leader

I just recently started playing again & dug out my old cfg stuff

 

 

and later, vstr nic ?? where is the set nic something? You forgot to paste it? I don't know what it's supposed to do...

He may be trying to modify old code for a new task while having forgotten some of the procedures for ET scripting.

 

I know that feeling. :)

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.