Post: PreCacheShader not working!
03-17-2016, 11:56 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); So, All it does is turns black like it was at first?? Any suggestions??

I'm precaching using "precacheShader("em_bg_ani_dmh");"
I place the code in:
    
init()
{
precacheShader("em_bg_ani_dmh");
level thread onplayerconnect();
}


That doesn't seem to work because I'm trying to use this as a backgound for my mod menu! Also I'm using Sharks menu base < I put overflow fix in and that still didn't fix this problem.
Heres the stuff I put in shader:
    
StoreShaders()
{
self.menu.background = self drawShader("em_bg_ani_dmh", 320, -50, 300, 500, (255, 255, 255), 0, 0);
self.menu.scroller = self drawShader("white", 320, -500, 300, 17, (0, 0, 0), 255, 1);
self.menu.line = self drawShader("white", 170, -550, 2, 500, (0, 0, 0), 255, 2);
}
Last edited by Elitexboxer ; 03-18-2016 at 12:22 AM. Reason: Explaining what it is doing incorrectly which I'm not sure what I'm doing wrong?
03-19-2016, 03:46 AM #29
Originally posted by DrHackHD View Post
StoreShaders()
{
self.menu.background = self createRectangle("CENTER", "CENTER", 320, -50, 1, 1, 0, (10, 0, 0), "compass_emp", 1, 0);
self.menu.scroller = self createRectangle("CENTER", "TOP", 320, -50, 1, 1, 1, (255, 255, 255), "em_bg_ani_afterlife", 1, 0);
self.menu.line = self createRectangle("CENTER", "CENTER", 320, -50, 1, 1, 2, (255, 0, 0), 0, "white");
}


Again froze...
03-19-2016, 03:51 AM #30
DrHackHD
Bounty hunter
i think u need to change base
03-19-2016, 09:03 AM #31
your drawshader/createrectangle function right, if its from sharks base.
guessing its format is

    drawShader(shader, x, y, width, height, color, alpha, sort, allclients)


if you set the color to *(1, 1, 1) which is white, it should show the image, then if its still black that means that it cant load the image, which the reasoning for that could be that it is a dlc playercard in which case you need to be using and have that playercard applied before starting the game. alternativly you can set the playercard as the minimap image and it will work without the need of having ur own playercard being the same.
Last edited by OfficialCoolJay ; 03-20-2016 at 01:14 AM.
03-19-2016, 02:42 PM #32
IrishDowngrades
Do a barrel roll!
em_bg_ani_octane
03-19-2016, 02:47 PM #33
IrishDowngrades
Do a barrel roll!
Originally posted by Elitexboxer View Post
So, All it does is turns black like it was at first?? Any suggestions??

I'm precaching using "precacheShader("em_bg_ani_dmh");"
I place the code in:
    
init()
{
precacheShader("em_bg_ani_dmh");
level thread onplayerconnect();
}


That doesn't seem to work because I'm trying to use this as a backgound for my mod menu! Also I'm using Sharks menu base < I put overflow fix in and that still didn't fix this problem.
Heres the stuff I put in shader:
    
StoreShaders()
{
self.menu.background = self drawShader("em_bg_ani_dmh", 320, -50, 300, 500, (255, 255, 255), 0, 0);
self.menu.scroller = self drawShader("white", 320, -500, 300, 17, (0, 0, 0), 255, 1);
self.menu.line = self drawShader("white", 170, -550, 2, 500, (0, 0, 0), 255, 2);
}


put this in init()

if(!(getDvar("customgametype") == "zombieland"))
{
precacheShader("line_horizontal");
precacheShader("em_bg_flag_ireland");
precachelocationselector("hud_medals_default");
}

now your done u just got to change ur shader / scrollbar , you see where it says in your background either black or white? change that to ur precacheShader ill show u an example

like this



self.Menu.Material["Background"] = self MaterialSettings("LEFT", "TOP", 50, 170, 250, 620, (255,255,255), "em_bg_flag_ireland", 1, 0);
03-19-2016, 03:29 PM #34
Originally posted by Elitexboxer View Post

CMK did it some how?

yeah its easy bruh but why u tryna copy me?? wooooow
03-19-2016, 03:41 PM #35
Originally posted by silver View Post
yeah its easy bruh but why u tryna copy me?? wooooow


Honestly I'm not....
03-19-2016, 03:44 PM #36
Originally posted by OfficialCoolJay View Post
your drawshader/createrectangle function right, if its from sharks base.
guessing its format is

    drawShader(shader, x, y, width, height, color, alpha, sort, allclients)


if you set the color to (0, 0, 0) which is white, it should show the image, then if its still black that means that it cant load the image, which the reasoning for that could be that it is a dlc playercard in which case you need to be using and have that playercard applied before starting the game. alternativly you can set the playercard as the minimap image and it will work without the need of having ur own playercard being the same.


Actually (0,0,0) is black and (1,1,1) is white or (255,255,255) is white. All I need is a transparent color.
03-19-2016, 03:45 PM #37
Originally posted by OfficialCoolJay View Post
your drawshader/createrectangle function right, if its from sharks base.
guessing its format is

    drawShader(shader, x, y, width, height, color, alpha, sort, allclients)


if you set the color to (0, 0, 0) which is white, it should show the image, then if its still black that means that it cant load the image, which the reasoning for that could be that it is a dlc playercard in which case you need to be using and have that playercard applied before starting the game. alternativly you can set the playercard as the minimap image and it will work without the need of having ur own playercard being the same.


As of you just said I need the calling card set on my player I understand now! I'm currently testing offline so thank you for the explanation!

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo