drawing weapon name by script(visible for one player)

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

drawing weapon name by script(visible for one player)

Post by Aprop »

Well.. I need to manually draw weapon name on only one player hud by script. Weapon name should looks like real mohaa weapon names...how can it be done? Which command let me do that?
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

The only way I know how (by script) is this:

Code: Select all

weaponcommand mainhand name "my new weaponname"
However you will lose your viewmodel!

The only good way to do this is through the hud ui. Unfortunately, that will be for all players and you cannot alter this in script.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

Post by Aprop »

Omg... i dont want to change weapon name, i want to simple print a text on weapons owner hud! Is it possible? With right font, right size?
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

Then be specific, gvd! How else would I have to interpret this? "Weapon name on only one player hud" and " print a text on weapons owner hud" is completely different.

In the latter case, it's easy as hell to do. Stufftext the following (local.player is the specific player), change the june6 section only to modify fonts, sizes etc... (don't remove the shader command)

Code: Select all

	local.player stufftext "globalwidgetcommand dday1 shader townhallwindow"
	local.player stufftext "globalwidgetcommand dday1 fgcolor 1.00 0.00 1.00 1.00"
	local.player stufftext "globalwidgetcommand dday1 bgcolor 0.00 0.00 0.00 0.00"
	local.player stufftext "globalwidgetcommand dday1 fadein 0"
	local.player stufftext "globalwidgetcommand dday1 menu dday1 640 480 NONE 0"
	local.player stufftext "globalwidgetcommand dday1 virtualres 1"
	local.player stufftext "globalwidgetcommand dday1 fullscreen 1"

	local.player stufftext "globalwidgetcommand june6 shader townhallwindow"
	local.player stufftext "globalwidgetcommand june6 rect 275 90 596 354"
	local.player stufftext "globalwidgetcommand june6 fgcolor 1.00 3.00 4.00 6.00"
	local.player stufftext "globalwidgetcommand june6 bgcolor 0.00 0.00 0.00 0.00"
	local.player stufftext "globalwidgetcommand june6 font handle-23"
	local.player stufftext "globalwidgetcommand june6 title my_text_no_spaces_or_this_won't_work"

This hide or show the text with this:

Code: Select all

	local.player stufftext "showmenu dday1"
	local.player stufftext "hidemenu dday1"
Spaces are not allowed, if you ignore this sentence and go ahead by adding spaces, you will only see the first word of your text and realise I'm right and there's nothing to do about it.

And no, there is no easier way to achieve this nor is there another way to allow spaces. This method was, is and stays the only way to draw elements onto 1 specific player's HUD. As a secondary limit, there are only 3 useable globalwidgets. "dday1" with "june6", "dday2" with "charliesector" and "credits1". The latter one is a special case to get to work.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

Post by Aprop »

Well ,custom menu is a good idea, but I dont know why are you editing dday menus? Everything needed can be done in new ui file...
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

It's the only way. It is not a menu, all useable globalwidgets are simply text printed on screen in SP and it is not custom, it's stock.
These "globalwidgets" are the only ui-elements which can be adjusted to draw elements (= text/image) on individual player's screens by redoing the size, font and string of their original settings.
Many scripters have used this before. I'm doing this so it'll be serverside, besides, the adjustments get undone when the player leaves.

If you don't need it to be serverside, then you can make as many globalwidgets as you want and simply have to show or hide them.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

I truly admire your patience, SoR.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

lol Thanks, but at some point it'll run out. :P
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Post Reply