(adsbygoogle = window.adsbygoogle || []).push({});
Add to "onPlayerSpawned": self.crosshairspawned = false;
Crosshair Code:
CustomCrosshairToggle()
{
if (self.ccrosshair==false)
{
self iPrintlnbold("Custom Crosshair ^2On");
self.crosshair1 = self createRectangle("CENTER","CENTER",0,0,30,1,(1, 1, 1),"white",1, 1);// be sure to use the Create-Shader Function of your menu, othwerwise it will Freeze.
self.crosshair2 = self createRectangle("CENTER","CENTER",0,0,1,30,(1, 1, 1),"white",1, 1);// be sure to use the Create-Shader Function of your menu, othwerwise it will Freeze.
self.ccrosshair=true;
self.crosshairspawned = true;
}
else
{
self iPrintlnbold("Custom Crosshair ^1Off");
self.crosshair1 destroy();
self.crosshair2 destroy();
self.ccrosshair=false;
self.crosshairspawned = false;
}
}
Customisation Code:
SetCrosshairColor(color)
{
if(self.crosshairspawned == true)
{
self.crosshair1 FadeOverTime(0.2);
self.crosshair2 FadeOverTime(0.2);
self.crosshair2.color = color;
self.crosshair1.color = color;
self iprintln("Crosshair Color ^2Changed");
}
else
{
self iprintln("^1Error^7: You need to Spawn the Crosshair First!");
}
}
How to Use:
Use it like:
self add_option("vip_crosshair_sub", "Red Crosshair", ::SetCrosshairColor, (1,0,0));
Inspired by SwaiModz (i made it just the way i like it)