PDA

View Full Version : Live hud [HELP]



songo
19th January 2014, 13:36
Hi,

I making new script (Live Hud). Its action is replacing images.

In shop:

if(response == "F1")
{
shader = "upg_icon_rcxd";
thread maps\mp\gametypes\_hud_get::init(shader);
self.rcxd++;
}

if(response == "F3")
{
shader = "songo_eq";
thread maps\mp\gametypes\_hud_get::init(shader);
self.eq++;

}

In activate menu (key M)

if(menu == game["menu_keysm"])
{
switch(response)
{
case "KEY_M":
if(self.rcxd >= 1)
{
thread maps\mp\gametypes\_rcxd::car();
self.rcxd--;
self thread maps\mp\gametypes\_hud_get::deletehud();
}
else if(self.eq >= 1)
{
self thread maps\mp\gametypes\_earthquake::doArti(self);
self iprintlnbold("Used eq");
self.eq--;
self thread maps\mp\gametypes\_hud_get::deletehud();
}
break;
}
}

In hud_get.gsc :


init(shader)
{
thread shader(shader);
thread presshud(shader);
}

presshud(shader)
{
if(isDefined(self.presshud)) self.presshud destroy();
self.presshud = newClientHudElem(self);
self.presshud.x = 507;
self.presshud.y = 340; //401
self.presshud setshader(shader, 88,88);
}

deletehud()
{
if(self.rcxd == 0 && self.eq == 0)
{
if(isDefined(self.presshud))
self.presshud destroy();
}
}

Thanks a lot ;)

Ni3ls
19th January 2014, 17:15
What do you want?

songo
19th January 2014, 18:00
I want, that when I buy rc-xd and earth quake and when I use earthquake, shader changed to rc-xd etc...