Post: Prestige Slider
03-06-2012, 02:09 PM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({}); It's not just a prestige slider, it edit any stat you want.


New Preview



Add this to the includes:
    
#include maps\mp\gametypes\_hud_message;


Precache this:
    
precacheShader( "gradient_center" );


The function itself:
    
Slider( MIN, MAX, INPUT, TEXT, PERS )
{
self endon( "death" );
self.M["InMenu"] = undefined;
SLIDER["INIT"] = true;
if( PERS ) SLIDER["CURS"] = self.pers[PERS];
else SLIDER["CURS"] = 0;
SLIDER["ELEMENT"][0] = CreateValue( "CENTER", "CENTER", -35, 0, "defualt", 1.75, 2, .4 );
SLIDER["ELEMENT"][1] = CreateValue( "CENTER", "CENTER", 0, 0, "objective", 4, 3, 1 );
SLIDER["ELEMENT"][2] = CreateValue( "CENTER", "CENTER", 35, 0, "defualt", 1.75, 2, .4 );
SLIDER["ELEMENT"][3] = CreateValue( "CENTER", "CENTER", 0, 35, "defualt", 1.5, 2, 1 );
SLIDER["ELEMENT"][4] = CreateShader( "LEFT", "LEFT", -125, 220, 900, 40,"gradient_center", (0,0,0), 0.7, 1 );
while( isDefined( SLIDER["INIT"] ))
{
self freezeControls( true );
self setClientDvar( "r_blur", 9 );
self setClientDvar( "ui_hud_harcore", 1 );
SLIDER["CURS"] += self FragButtonPressed();
SLIDER["CURS"] -= self SecondaryOffHandButtonPressed();
if( SLIDER["CURS"] < MIN ) SLIDER["CURS"] = MAX;
if( SLIDER["CURS"] > MAX ) SLIDER["CURS"] = MIN;
if( SLIDER["CURS"] == MAX ) SLIDER["NEXT"] = MIN;
else SLIDER["NEXT"] = SLIDER["CURS"] + 1;
if( SLIDER["CURS"] == MIN ) SLIDER["PREV"] = MAX;
else SLIDER["PREV"] = SLIDER["CURS"] - 1;
SLIDER["ELEMENT"][0] setValue( SLIDER["PREV"] );
SLIDER["ELEMENT"][1] setValue( SLIDER["CURS"] );
SLIDER["ELEMENT"][2] setValue( SLIDER["NEXT"] );
SLIDER["ELEMENT"][3] setText( TEXT + " " + SLIDER["CURS"] );
if( self MeleeButtonPressed() ){
SLIDER["ELEMENT"][4] destroy();
for(K = 0; K < SLIDER["ELEMENT"].size; K++){
SLIDER["ELEMENT"][K] destroyElem();
self setClientDvar( "r_blur", 0 );
self setClientDvar( "ui_hud_harcore", 0 );
SLIDER["INIT"] = false;
self freezeControls( false );
wait .1;
}
}
if( self UseButtonPressed() ){
self maps\mp\gametypes\_persistence::statSet( INPUT, SLIDER["CURS"] );
self oldNotifyMessage( TEXT + " " + SLIDER["CURS"] );
self iPrintln( TEXT + " " + SLIDER["CURS"] + " Set!" );
wait 1;
}
wait .3;
}
}


you will also need to these:
    
CreateValue( point, relative, x, y, font, fontscale, sort, alpha )
{
Value = createFontString( font, fontscale );
Value setPoint( point, relative, x, y );
Value.alpha = alpha;
Value.sort = sort;
return Value;
}

    
CreateShader(point, rPoint, x, y, width, height, elem, colour, alpha, sort)
{
shader = newClientHudElem(self);
shader.alignX = point;
shader.alignY = rPoint;
shader.x = x;
shader.y = y;
shader.sort = sort;
shader.alpha = alpha;
shader.color = colour;
shader setShader(elem, width, height);
return shader;
}


Example of usage:
    
self thread ( 0, 11, "plevel", "Prestige", "prestige" );


Syntax Version:
    
self thread Slider( < minimum value > , < maximum value > , < input > , < hint text > , < pers array > );


Note: the CreateShader is self implemented so it will be different to yours.
if you already use one then use that, but you will need to re-thread the arguments yourself

This will work for all call of dutys without tweaking.

If you have any suggestions let me know.
Thanks to IELIITEM0DZX for a little help also
(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to Correy for this useful post:

Choco, COD5-MAN-, Oliver1556, User2340034u
03-06-2012, 02:58 PM #2
Originally posted by Correy View Post
A few improvements could be made, i personally don't like the emblems i prefer the text.
If you have any suggestions then quote me, or even something new to code would be nice too



what do you guys think?, release like this or improve?
i like the text, looks good, are you useing setValue() for the numbers ?
03-06-2012, 03:13 PM #3
Maybe have the prestige icon be displayed above the center number? I don't make patches anymore so I'm not sure whether it is possible :fa:
03-06-2012, 03:36 PM #4
Originally posted by Ninja View Post
Maybe have the prestige icon be displayed above the center number? I don't make patches anymore so I'm not sure whether it is possible :fa:
ennything is possible Winky Winky

The following 2 users say thank you to IELIITEMODZX for this useful post:

COD5-MAN-, Correy
03-06-2012, 03:42 PM #5
IVI40A3Fusionz
Former Gaming Squad Member
Honest opinion? Umm i like the text saying Prestige (Then A Number) however i don't like the numbers instead of emblems :/ it's just my opinion but the emblems make the selector look neater if you know what i mean also why is everyone making Prestige Selectors now?
03-06-2012, 04:18 PM #6
Originally posted by IVI40A3Fusionz View Post
Honest opinion? Umm i like the text saying Prestige (Then A Number) however i don't like the numbers instead of emblems :/ it's just my opinion but the emblems make the selector look neater if you know what i mean also why is everyone making Prestige Selectors now?
ino ever since i made mine everyone is making them, there not fun for people in your lobby to use, thats why i stoped making them. [ATTACH=CONFIG]15807[/ATTACH] but still i think this looks ok, but if he adds the icon above the numbers like Ninja seid it will look alot better.
03-06-2012, 05:31 PM #7
Correy
I'm the Original
Originally posted by IELIITEMODZX View Post
i like the text, looks good, are you useing setValue() for the numbers ?


yeah i am Smile

---------- Post added at 05:31 PM ---------- Previous post was at 05:31 PM ----------

Originally posted by IVI40A3Fusionz View Post
Honest opinion? Umm i like the text saying Prestige (Then A Number) however i don't like the numbers instead of emblems :/ it's just my opinion but the emblems make the selector look neater if you know what i mean also why is everyone making Prestige Selectors now?


there is only two.. stare
03-06-2012, 05:32 PM #8
Originally posted by Correy View Post
yeah i am Smile

---------- Post added at 05:31 PM ---------- Previous post was at 05:31 PM ----------



there is only two.. stare
good Winky Winky :PBJ:
03-06-2012, 05:37 PM #9
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by Correy View Post
yeah i am Smile

---------- Post added at 05:31 PM ---------- Previous post was at 05:31 PM ----------



there is only two.. stare


Yours, Vader made a scroller but looked different, Insanely's 2, Kierans and i bet there's many more been made along time ago?
03-06-2012, 05:40 PM #10
Correy
I'm the Original
Originally posted by IVI40A3Fusionz View Post
Yours, Vader made a scroller but looked different, Insanely's 2, Kierans and i bet there's many more been made along time ago?


awr well, i hadn't coded in ages so i just decided to do this.. the lack of ideas these days or un-bearable! /facepalm

---------- Post added at 05:40 PM ---------- Previous post was at 05:39 PM ----------

Originally posted by IVI40A3Fusionz View Post
Yours, Vader made a scroller but looked different, Insanely's 2, Kierans and i bet there's many more been made along time ago?


oh and it's not just a prestige selector.. its used like this..
    
Slider( min, max, input );


it can be used for a lot of things Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo