Tell me how to make a script?
#1
Hi guys...i'm confused,how to make a script for throwing grenades and it saids "Fire In The Hole!" on chat?
Thanks given by:
#2
(28 Dec 12, 07:02AM)ONYX Wrote: Hi guys...i'm confused,how to make a script for throwing grenades and it saids "Fire In The Hole!" on chat?

Spamming :)
if curweapon = grenade [ attack + say " fire ..."]
if curweapon !=grenade [swith grenade ]
Thanks given by:
#3
(28 Dec 12, 01:11PM)888 Wrote:
(28 Dec 12, 07:02AM)ONYX Wrote: Hi guys...i'm confused,how to make a script for throwing grenades and it saids "Fire In The Hole!" on chat?

Spamming :)
if curweapon = grenade [ attack + say " fire ..."]
if curweapon !=grenade [swith grenade ]

Is that for autoexec script or server script?
Thanks given by:
#4
alias altaction_8 [ attack; say "Fire In The Hole!" ]
In autoexec.cfg
Thanks given by:
#5
when i tried on autoexec it didn't work...
Thanks given by:
#6
(28 Dec 12, 07:28PM)ONYX Wrote: when i tried on autoexec it didn't work...

just throw nades with right click :p
Thanks given by:
#7
how about left click?

I always want left click when i throw grenades...

(28 Dec 12, 07:25PM)macm Wrote:
alias altaction_8 [ attack; say "Fire In The Hole!" ]
In autoexec.cfg

when it saids "Fire In The Hole!" when we throw it not holding it...
Thanks given by:
#8
Current version:

[cubescript]
bind mouse1 [ if (checkalias onAttack) onAttack; attack ]
onAttack = [ if (= (curweapon) 8) [ say "Fire in the hole!" ] ]
[/cubescript]

Next version:

[cubescript]checkinit onAttack [ if (= (curweapon) $GRENADES) [ say "Fire in the hole!" ] ][/cubescript]

If you want the message to appear as you let go of the grenade, no matter how long you have "cooked" it, you will need to tweak it a bit:

Current version:

[cubescript]
bind mouse1 [ if (checkalias onAttack) onAttack; WEAPON_USED = (curweapon); attack; onrelease [ if (checkalias offAttack) offAttack ] ]
offAttack = [ if (&& (alive) (= $WEAPON_USED 8)) [ say "Fire in the hole!" ] ]
[/cubescript]

Next version:

[cubescript]
bind mouse1 [ WEAPON_USED = (curweapon); attack; onrelease [ if (checkalias offAttack) offAttack ] ]
offAttack = [ if (&& (alive) (= $WEAPON_USED $GRENADES)) [ say "Fire in the hole!" ] ]
[/cubescript]

As pointed out previously, these kind of scripts are considered spam by many players. I tend to use /ignore on people who use such scripts.
Thanks given by:
#9
(30 Dec 12, 06:37PM)Bukz Wrote: As pointed out previously, these kind of scripts are considered spam by many players. I tend to use /ignore on people who use such scripts.

so it will not vote kicked when spamming?

Can u tell me more How to put four word random when throwing grenades?
Thanks given by:
#10
To randomize what is said when you throw a grenade, just change this portion of the script:

[cubescript]say "Fire in the hole!"[/cubescript]

to:

[cubescript]randomNadeMsg[/cubescript]

Then add this to the bottom of the script:

[cubescript]list_of_nade_msgs = [
"Random message #1"
"Random message #2"
"Random message #3"
"Random message #4"
]

randomNadeMsg = [
say (at $list_of_nade_msgs (rnd (listlen $list_of_nade_msgs)))
][/cubescript]

I doubt you will be able to throw grenades often enough to get autokicked by the server for spamming, but you may annoy enough people that if someone were to attempt to votekick you that it would pass.
Thanks given by:
#11
lss gogogo
Thanks given by:
#12
And After that,How to put sounds in it?
Thanks given by:
#13
You can use the command voicecom or sound .
Thanks given by:
#14
put in where?
Thanks given by: