Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: freestyler on May 06, 2010, 09:08:03 am

Title: WeaponChange Box (2.7.0+) v0.2
Post by: freestyler on May 06, 2010, 09:08:03 am
Script name: WeaponChange Box
Script description: Shows a sexy box whenever you change weapon
Author: fri (http://soldatcentral.com/index.php?page=profile&u=24) (idea by kzya (http://forums.soldat.pl/index.php?topic=38127))
Core version: 2.7.1
Hosted by: Soldat Central - http://soldatcentral.com/ (http://soldatcentral.com/)

Interface layers: 7, 8, 9, 10

WORKS ON SERVER 2.7.0+ ONLY
The script doesn't compile on 2.6.6! It uses procedures available only in the latest one (Soldat 1.5.1)

Whenever you change weapon, a little sexy box shows up and disappears after three seconds. Fully customizable.

Updated: now works even if you carry two identical weapons (might not always pop up since it checks once per second).

(http://tehoko.info/paste/2010-05/weaponbox.png) (http://tehoko.info/paste/2010-05/weaponbox2.png) (http://tehoko.info/paste/2010-05/weaponbox3.png)



(http://soldatcentral.com/images/download.gif) (http://soldatcentral.com/dl.php?id=194&act=1)
(Size 1.5 KB)
- http://soldatcentral.com/index.php?page=script&f=194 -


** Script hosted by Soldat Central (http://soldatcentral.com/index.php?page=script&f=194)! Please visit the author's script page (http://soldatcentral.com/index.php?page=script&f=194) and Rate this script **
Title: Re: WeaponChange Box (2.7.1)
Post by: Gizd on May 06, 2010, 09:11:40 am
That's goddamn sexy.
Title: Re: WeaponChange Box (2.7.1)
Post by: Silnikos on May 06, 2010, 09:37:18 am
That's where scripting should go, great.
Title: Re: WeaponChange Box (2.7.1)
Post by: Mercury92 on May 06, 2010, 11:32:28 am
Yeah very cool!
Thanks.
Title: Re: WeaponChange Box (2.7.1)
Post by: xmRipper on May 06, 2010, 12:15:10 pm
Great idea. Awesome.
Title: Re: WeaponChange Box (2.7.1)
Post by: Mercury92 on May 06, 2010, 01:08:53 pm
Having two identical weapons (M79 - M79 or MP5 - MP5)
It doesn't draw anymore.
Title: Re: WeaponChange Box (2.7.1)
Post by: DorkeyDear on May 06, 2010, 01:09:07 pm
Nice idea great job :D

Gives me an idea, since i think u can get certain key presses, it may be possible to have a menu specific for weapons. that may get rid of the SetWeaponActive not always working 'bug' but may not be very smooth without more than one check per second. another idea is for a player class selection while in spectator (but not 100% certain if u can get key presses while in spectator, and pressing up ('w') may not be the best idea for navigation (it messes with the camera), but just an idea)
Title: Re: WeaponChange Box (2.7.1)
Post by: freestyler on May 06, 2010, 01:17:03 pm
Having two identical weapons (M79 - M79 or MP5 - MP5)
It doesn't draw anymore.
I know, it can't be fixed because OnWeaponChange isn't called when 'new' weapon is the same as previous one. :(
Title: Re: WeaponChange Box (2.7.1)
Post by: demoniac93 on May 06, 2010, 01:38:09 pm
Having two identical weapons (M79 - M79 or MP5 - MP5)
It doesn't draw anymore.
I know, it can't be fixed because OnWeaponChange isn't called when 'new' weapon is the same as previous one. :(

Can't you modify it so that, when you press the change weapon key, the box slides from wep to wep, AND add some kind of script that identifies your current weps and sets them into the weapon slider?
Title: Re: WeaponChange Box (2.7.1)
Post by: Gizd on May 06, 2010, 01:48:02 pm
Having two identical weapons (M79 - M79 or MP5 - MP5)
It doesn't draw anymore.
I know, it can't be fixed because OnWeaponChange isn't called when 'new' weapon is the same as previous one. :(

Can't you modify it so that, when you press the change weapon key, the box slides from wep to wep, AND add some kind of script that identifies your current weps and sets them into the weapon slider?
Also add some RPG features, accounts, new weapons, vehicles etc.
Title: Re: WeaponChange Box (2.7.1)
Post by: dnmr on May 06, 2010, 01:53:55 pm
Also add some RPG features, accounts, new weapons, vehicles etc.
^ this one knows what's going on

@fri_ : great stuff man (:
Title: Re: WeaponChange Box (2.7.1)
Post by: demoniac93 on May 06, 2010, 06:06:41 pm
Having two identical weapons (M79 - M79 or MP5 - MP5)
It doesn't draw anymore.
I know, it can't be fixed because OnWeaponChange isn't called when 'new' weapon is the same as previous one. :(

Can't you modify it so that, when you press the change weapon key, the box slides from wep to wep, AND add some kind of script that identifies your current weps and sets them into the weapon slider?
Also add some RPG features, accounts, new weapons, vehicles etc.

It's for fixing the issue that Mercury mentioned, and just in case you're not up-to-date here, sarcasm isn't always as witty as you imagine it to be.
Title: Re: WeaponChange Box (2.7.1)
Post by: Hacktank on May 06, 2010, 08:57:17 pm
Can't you modify it so that, when you press the change weapon key, the box slides from wep to wep, AND add some kind of script that identifies your current weps and sets them into the weapon slider?

Without using a thread or a very specialized other method of fast looping you can only check keys once a second. So there would only be a 1-in-1000-or-less chance of catching the keypress.
Title: Re: WeaponChange Box (2.7.1)
Post by: Furai on May 07, 2010, 04:42:47 am
So maybe instead of drawing 2 weapons of same kind - draw one with "x2" suffix?
Title: Re: WeaponChange Box (2.7.1)
Post by: freestyler on May 07, 2010, 05:20:48 am
So maybe instead of drawing 2 weapons of same kind - draw one with "x2" suffix?
So simple yet so genius. Thanks!
Script updated to version 0.2, now supports two identical weapons using AppOnIdle, so the box might not always pop up.
Title: Re: WeaponChange Box (2.7.0+) v0.2
Post by: Furai on May 07, 2010, 05:42:25 am
So maybe instead of drawing 2 weapons of same kind - draw one with "x2" suffix?
So simple yet so genius. Thanks!
Script updated to version 0.2, now supports two identical weapons using AppOnIdle, so the box might not always pop up.
No problem. :)
Title: Re: WeaponChange Box (2.7.0+) v0.2
Post by: mich1103 on May 07, 2010, 05:47:10 am
Very nice script man !!!
Title: Re: WeaponChange Box (2.7.0+) v0.2
Post by: Gizd on May 07, 2010, 08:01:13 am
...
It's for fixing the issue that Mercury mentioned, and just in case you're not up-to-date here, sarcasm isn't always as witty as you imagine it to be.
I just meant that it's not possible and not worth the effort.
Title: Re: WeaponChange Box (2.7.0+) v0.2
Post by: DarkCrusade on May 07, 2010, 10:21:02 am
This is hilarious, freestyler may decide himself what he thinks is worth the effort and not you, Gizd.

Very nice, styler!
Title: Re: WeaponChange Box (2.7.0+) v0.2
Post by: freestyler on May 07, 2010, 10:53:49 am
Heh, chill out, I thought adding support for identical weapons wasn't worth the effort, too. But I added it as soon as Wookash posted his way to make it ten times simplier than I thought it would be. Peace. ;)
Title: Re: WeaponChange Box (2.7.0+) v0.2
Post by: Mercury92 on May 12, 2010, 06:23:35 am
Another problem. Some players see that in the center and some players somewhere in the corner. (Top-Left)
(http://www.upload.ee/image/566474/hmm.png)
Title: Re: WeaponChange Box (2.7.0+) v0.2
Post by: demoniac93 on May 12, 2010, 03:10:08 pm
Just tried it.
You're an efing jewel!
Title: Re: WeaponChange Box (2.7.0+) v0.2
Post by: dominikkk26 on June 15, 2010, 11:55:50 am
Title: Re: WeaponChange Box (2.7.0+) v0.2
Post by: Toumaz on June 15, 2010, 12:56:33 pm
  • weaponchange -> [Error] (49:7): Unknown identifier 'interfacetext'  :P
note how the first post says it won't work in 2.6.6