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, 05:42 PM #11
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by Correy View Post
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 ----------



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


Umm so it's still a slider/scroller what ever you want to call it? Happy.
03-06-2012, 05:52 PM #12
Correy
I'm the Original
Originally posted by IVI40A3Fusionz View Post
Umm so it's still a slider/scroller what ever you want to call it? Happy.


yes but it can also be a stat editor, dvar editor.. ect.
03-06-2012, 05:54 PM #13
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by Correy View Post
yes but it can also be a stat editor, dvar editor.. ect.


You can turn almost any editor into something else O.o just by editing the coding a little.
03-06-2012, 06:01 PM #14
DlBSY993
There's 0nly 1..
Originally posted by IELIITEMODZX View Post
ennything is possible Winky Winky


/facepalm .......................

---------- Post added at 01:01 PM ---------- Previous post was at 12:59 PM ----------

Originally posted by Correy View Post
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








You haven't seen some off things in my patch xD

The following 2 users groaned at DlBSY993 for this awful post:

COD5-MAN-, IELIITEMODZX
03-06-2012, 06:04 PM #15
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by DlBSY993 View Post
/facepalm .......................

---------- Post added at 01:01 PM ---------- Previous post was at 12:59 PM ----------






You haven't seen some off things in my patch xD


By the sounds of it because you made them they are gonna be a bunch of shit Winky Winky.

EDIT: Does ^ make any sense to you :confused:?

The following user thanked IVI40A3Fusionz for this useful post:

COD5-MAN-
03-06-2012, 06:06 PM #16
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?
lol who cares about perstige and rank on cod4 anyomre.
03-06-2012, 06:13 PM #17
DlBSY993
There's 0nly 1..
Originally posted by IVI40A3Fusionz View Post
By the sounds of it because you made them they are gonna be a bunch of shit Winky Winky.

EDIT: Does ^ make any sense to you :confused:?


People online love it.. so i take it they're good?
03-06-2012, 06:20 PM #18
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by DlBSY993 View Post
People on live love it.. so i take it they're good?


Touché. BTW my post was a joke if you didn't notice :/.
03-06-2012, 06:21 PM #19
DlBSY993
There's 0nly 1..
Originally posted by IVI40A3Fusionz View Post
Touché. BTW my post was a joke if you didn't notice :/.


i am aware .... Happy

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo