Liberty Unleashed
Scripting => Script Releases => Topic started by: ZX_Lost_Soul on November 06, 2013, 11:52:41 pm
-
That script displays a name of current district on the left bottom corner of the screen, under radar. Can be useful for RP servers.
(http://files.4ky.ru/games/lu_01.jpg)
That is client script.
/* District Name || Author: ZX_Lost_Soul || Free to use
That script displays a name of current district on the left bottom corner of the screen, under radar */
local plr=FindLocalPlayer();
local CurDistrict;
// Initializing
function onScriptLoad() {
DistrictName <- GUILabel(VectorScreen(20, ScreenHeight-45), ScreenSize(100,3), "Welcome");
DistrictName.FontName="Tahoma";
DistrictName.FontSize=18;
DistrictName.TextColour=Colour(255, 123, 0);
AddGUILayer(DistrictName);
NewTimer("district_name_upd", 2500, 0);
}
// District name update
function district_name_upd() {
local pos=plr.Pos;
local dis=GetDistrictName(pos.x, pos.y);
if(CurDistrict!=dis) {
DistrictName.Text=dis;
CurDistrict=dis;
}
}
-
There's command for turn it on without any scripts...
-
There's command for turn it on without any scripts...
What command?
p.s. Script is better anyway) You can make a translations of district names, for example, and show it on the player's language. You can doesn't show names of some districts. Or stylize color/font/position of this label )
-
this script should be in every server, simple but usefull
-
You can make a translations of district names,
Why on earth would you translate names :P
Script seems good enough. I don't like timers, but I guess it's fine in this case.
-
Why not have it on onClientRender ?
-
Why not have it on onClientRender ?
Because doing inPoly (Which I guess is what getdistrictname does) a lot of time isn't going to end well on a wooden computer.
-
Why on earth would you translate names :P
(http://files.4ky.ru/games/lu_02.png)
...not all words is the names. And it looks nicer at native language, if it has different alphabet)
Why not have it on onClientRender ?
1. Reason, described by Thijn.
2. If player walks on a district edge, you can see a label flickering - fast changing between two names. That's not good. 2,5 seconds update is optimal.
p.s. If using custom font...
(http://files.4ky.ru/games/lu_03.jpg)
-
Oh thanks friend. My first script xD :P