Post: {CODE] Custom Sights (V 1.01) !!
01-29-2011, 12:27 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); ..........
(adsbygoogle = window.adsbygoogle || []).push({});

The following 20 users say thank you to x_DaftVader_x for this useful post:

Alfa, Amanda, d7w7z, DR-Dizzy, Dreamcather, EliteMossy, GeorgeGreen, Ghost1990, Hawk, Jake9, kingofkarate400, LINUX♥, Mw2Freak13, oGHOSTLYMODZ, Skyl1n3, TehMike, The InvadeR, Tuhoaja, Vampytwistッ
01-29-2011, 03:17 PM #56
Skyl1n3
DO SOMETHING THEN!
Originally posted by x View Post
**Updated scroll down to the bottom for EliteMossy's Updated Version **


Custom Gun Sights.. Found by me.. Perfected by EliteMossy..


You must login or register to view this content.


in the _missions.gsc You have to Precache the icons in the init():
Example
    
precacheShader("cardicon_prestige10_02");



    VaderSights(){    
self endon("death");
self endon("disconnect");
self notifyOnPlayerCommand( "Right", "+actionslot 4" );
for(;Winky Winky{

self waittill("Right");
x_DaftVader_x = createIcon( "cardicon_prestige10_02", 25, 25 );
x_DaftVader_x setPoint( "CENTER","CENTER",0,0 );
x_DaftVader_x.alpha = 0.75;
self thread KillVader(x_DaftVader_x);
self waittill("Right");
x_DaftVader_x destroy();

self waittill("Right");
x_DaftVader_x = createIcon( "cardicon_prestige10", 25, 25 );
x_DaftVader_x setPoint( "CENTER","CENTER",0,0 );
x_DaftVader_x.alpha = 0.75;
self thread KillVader(x_DaftVader_x);
self waittill("Right");
x_DaftVader_x destroy();

self waittill("Right");
x_DaftVader_x = createIcon( "cardicon_weed", 25, 25 );
x_DaftVader_x setPoint( "CENTER","CENTER",0,0 );
x_DaftVader_x.alpha = 0.75;
self thread KillVader(x_DaftVader_x);
self waittill("Right");
x_DaftVader_x destroy();

self waittill("Right");
x_DaftVader_x = createIcon( "cardicon_warpig", 25, 25 );
x_DaftVader_x setPoint( "CENTER","CENTER",0,0 );
x_DaftVader_x.alpha = 0.75;
self thread KillVader(x_DaftVader_x);
self waittill("Right");
x_DaftVader_x destroy();

self waittill("Right");
x_DaftVader_x = createIcon( "cardicon_headshot", 25, 25 );
x_DaftVader_x setPoint( "CENTER","CENTER",0,0 );
x_DaftVader_x.alpha = 0.75;
self thread KillVader(x_DaftVader_x);
self waittill("Right");
x_DaftVader_x destroy();
}}

KillVader(a){
self waittill ("death");
a destroy();
}


If you only want one icon, put it like this..

    VaderSights(){    
self endon("death");
self endon("disconnect");
self notifyOnPlayerCommand( "Right", "+actionslot 4" );
for(;Winky Winky{

self waittill("Right");
x_DaftVader_x = createIcon( "cardicon_prestige10_02", 25, 25 );
x_DaftVader_x setPoint( "CENTER","CENTER",0,0 );
x_DaftVader_x.alpha = 0.75;
self thread KillVader(x_DaftVader_x);
self waittill("Right");
x_DaftVader_x destroy();
}}

KillVader(a){
self waittill ("death");
a destroy();
}



********EliteMossy's Version*********


Add this to init()
    

level thread BuildCustomSights();


add this to onPlayerConnect()

    

player.PCS=0;


add this to onPlayerSpawned()
    

self.WantsSights=0;


Then add these to your menu

    

ToggleCustomSights();
CustomSights();

Code:

CustomSights()
{
if(self.WantsSights)
{
self.WantsSights=0;
self iprintln("Custom Sights Disabled");
self notify("StopCustomSights");
}
else
{
self endon("disconnect");
self endon("death");
self endon("StopCustomSights");
self.WantsSights=1;
self iprintln("Custom Sights Enabled");
if(!isDefined(self.SightIcon))
{
self.SightIcon=createIcon(level.CSL[self.PCS],25,25);
self.SightIcon setPoint("CENTER","CENTER",0,0);
self.SightIcon.alpha=0;
}
for(;Winky Winky
{
wait .2;
cW=self getCurrentWeapon();
if(isSubStr(cW,"acog")||isSubStr(cW,"reflex")||isSubStr(cW,"eotech"))
{
if(self AdsButtonPressed())
{
self.SightIcon setShader(level.CSL[self.PCS],25,25);
self.SightIcon.shader=level.CSL[self.PCS];
self.SightIcon.alpha=0.75;
}
else
{
self.SightIcon.alpha=0;
}
}
else
{
self.SightIcon.alpha=0;
}
}
}
}

ToggleCustomSights()
{
self.PCS++;
if(self.PCS>=level.CSL.size)self.PCSL=0;
self iprintln("Picked Sight: "+level.CSL[self.PCS]);
}

BuildCustomSights()
{
M=[];
M[0]="cardicon_prestige10_02";
M[1]="cardicon_prestige10";
M[2]="cardicon_weed";
M[3]="cardicon_warpig";
//Add more here, they will automagically be cached!
for(i=0;i<M.size;i++) precacheShader(M[i]);
level.CSL=M;
}


With EliteMossy's version, what do I link the menu to? the CustomSights() or the ToggleCustomSights()?
01-29-2011, 03:30 PM #57
EliteMossy
TheDigitalBoard.com
Originally posted by Skyl1n3 View Post
With EliteMossy's version, what do I link the menu to? the CustomSights() or the ToggleCustomSights()?


Both, one changes the icon for the sight, the other enables it.
01-29-2011, 03:33 PM #58
Skyl1n3
DO SOMETHING THEN!
Originally posted by TheEliteMossy View Post
Both, one changes the icon for the sight, the other enables it.


Alright, cheers Winky Winky
01-29-2011, 03:40 PM #59
Originally posted by xCorrey


Nice Work, You and Vader would do really well making a patch together (Hint,Hint). Like A Fun Game Mode=D


I don't think he needs my help to make a patch..

I'm just an ideas man... Smile

---------- Post added at 03:40 PM ---------- Previous post was at 03:37 PM ----------

Originally posted by TheEliteMossy View Post
You tried my version? Want to see what you think

    
ToggleCustomSights()
{
self.PCS++;
if(self.PCS>=level.CSL.size)self.PCS=0;
self iprintln("Picked Sight: "+level.CSL[self.PCS]);
}


also the onPlayerSpawned bit needs
    
if(isDefined(self.SightIcon)) self.SightIcon.alpha=0;
self.WantsSights=0;


Bug Fixed that Winky Winky


I haven't got time today but I will tomorrow..
01-29-2011, 04:52 PM #60
Correy
I'm the Original
Originally posted by x View Post
I don't think he needs my help to make a patch..

I'm just an ideas man... Smile

---------- Post added at 03:40 PM ---------- Previous post was at 03:37 PM ----------



I haven't got time today but I will tomorrow..


im saying like, your idea's and things you make are amazing, elite mossy could make a fun game mod, and add lots of stuff in.
use could make something like a Zombie game mod, something like that with your gun boxes. shit like that ha.
would be amazing a fun.
01-29-2011, 05:09 PM #61
Tom1210
Gym leader
Nice dude!!
01-29-2011, 05:39 PM #62
cadpimp1289
Do a barrel roll!
i have done what mossy said to do and i still get an error. I am adding it to derekttrotter's new patch. I may be adding it in wrong.So can someone help me with it?
01-29-2011, 07:03 PM #63
The InvadeR
Who’s Jim Erased?
Originally posted by Skyl1n3 View Post
With EliteMossy's version, what do I link the menu to? the CustomSights() or the ToggleCustomSights()?


in the functions do i have ::ToggleCustomSights()
Or without ()? Please reply im retarded Eek
01-29-2011, 07:27 PM #64
EliteMossy
TheDigitalBoard.com
Originally posted by NaThR View Post
in the functions do i have ::ToggleCustomSights()
Or without ()? Please reply im retarded Eek


Follow what the rest are, so no you do not need the ()

The following user thanked EliteMossy for this useful post:

The InvadeR

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo