Author Topic: Changeable crosshair ain't working  (Read 1442 times)

Trader gave me the scripts that would change the crosshair after changing to the Sniper Rifle weapon, but it doesn't work unless i turn on then off the film mode, but then i gotta do that again after switching off of the sniper rifle :/

I did edit it some to make it work better

Sniper_Crosshair_Client.cs (Add-Ons/Client)
Code: [Select]
function clientCmdToggleSniperCrosshair(%onOroff)
{
if(%onOroff == 1)
{
CrossHair.bitmap = "add-ons/crosshairs/Sniper";//This is where you type the path to your image.
}
else
{
CrossHair.bitmap = "base/client/ui/crossHair";
}
}

Sniper_Crosshair_Server.cs (Add-Ons)
Code: [Select]
package SniperCrosshair
{
function SniperRifleImage::onMount(%this,%obj,%slot)
{
serverCmdToggleSniperCrosshair(%obj.client,1);
Parent::onMount(%this,%obj,%slot);
}

function SniperRifleImage::onUnmount(%this,%obj,%slot)
{
serverCmdToggleSniperCrosshair(%obj.client,0);
Parent::onUnmount(%this,%obj,%slot);
}
};

activatePackage(SniperCrosshair);

function serverCmdToggleSniperCrosshair(%client,%onOroff)
{
commandtoclient(%client,'ToggleSniperCrosshair',%onOroff);
}


Yes the crosshair is in the right place, which is in the crosshairs folder (in Add-Ons folder)

Try Crosshair.setBitmap("add-ons/crosshairs/Sniper"); or something. Editing .bitmap, .scale, .position, etc of objects doesn't work.

Try Crosshair.setBitmap("add-ons/crosshairs/Sniper"); or something. Editing .bitmap, .scale, .position, etc of objects doesn't work.
Wow Space Guy, you just gave me a good idea!

Thanks :)