Page 1 of 1
drawing weapon name by script(visible for one player)
Posted: Sun Mar 01, 2009 7:20 am
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?
Posted: Sun Mar 01, 2009 11:10 am
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.
Posted: Sun Mar 01, 2009 12:27 pm
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?
Posted: Sun Mar 01, 2009 12:56 pm
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.
Posted: Sun Mar 01, 2009 1:38 pm
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...
Posted: Sun Mar 01, 2009 1:52 pm
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.
Posted: Sun Mar 01, 2009 9:35 pm
by Rookie One.pl
I truly admire your patience, SoR.
Posted: Wed Mar 04, 2009 6:12 pm
by $oldier Of Ra
lol Thanks, but at some point it'll run out.
