Post: Simple method to adding scripts to patch...
01-25-2012, 11:26 PM #1
Default Avatar
Newelly
Guest
(adsbygoogle = window.adsbygoogle || []).push({});
* This idea was based from 'Karoolus' when i stumbled into his stats script...
* Simple, easy and useful and also makes your coding tidier and more neater... (personal preference of course).
* Efficient instead of having scripts everywhere...
[/color]


How to add to menu base:
[/color]
    self addOpt( m, "Prestige +1", ::setItem, "prestige" );



How it works:
[/color]
    
m, = Menu
"Prestige +1", = Name
::setItemm = Function
"prestige" = This is attatched to the function making it the 'if( value== "prestige" ) content readable like you would for a script.



The code itself:
[/color]
    
setItem(value)
{
if( value=="prestige" )
{
setDvar( "scr_forcerankedmatch", 1 ); setDvar( "xblive_privatematch", 0 ); setDvar( "onlinegame", 1 );
self maps\mp\gametypes\_persistence::statset( "plevel", value );
self.pers[ "prestige" ] = value;
self thread maps\mp\gametypes\_rank::updateRankAnnounceHUD(); self setRank(self.pers["rank"],self.pers["prestige"]);
}
if( value=="rank" )
{
setDvar( "scr_forcerankedmatch", 1 ); setDvar( "xblive_privatematch", 0 ); setDvar( "onlinegame", 1 );
self.pers[ "rankxp" ] = 90000;
self setStat( 252, self.pers[ "rank" ] );
self maps\mp\gametypes\_persistence::statSet( "rank", self.pers["rank"] );
self maps\mp\gametypes\_persistence::statSet( "rankxp", self.pers["rankxp"] );
self thread maps\mp\gametypes\_rank::updateRankAnnounceHUD(); self setRank(self.pers["rank"],self.pers["prestige"]);
}
if( value=="stats" )
{
kills = 0; //Change to anything
wins = 0;
score = 0;
kill_streak = 0;
win_streak = 0;
headshots = -0;
deaths = 0;
assist = 0;
accuracy = 0;
losses = 0;
misses = 0;
time_played_total = 0;
plevel = 0;
}

self maps\mp\gametypes\_persistence::statSet( "kills", value );
self maps\mp\gametypes\_persistence::statSet( "wins", value );
self maps\mp\gametypes\_persistence::statSet( "score", value );
self maps\mp\gametypes\_persistence::statSet( "kill_streak", value );
self maps\mp\gametypes\_persistence::statSet( "win_streak", value );
self maps\mp\gametypes\_persistence::statSet( "headshots", value );
self maps\mp\gametypes\_persistence::statSet( "deaths", value );
self maps\mp\gametypes\_persistence::statSet( "assist", value );
self maps\mp\gametypes\_persistence::statSet( "accuracy", value );
self maps\mp\gametypes\_persistence::statSet( "losses", value );
self maps\mp\gametypes\_persistence::statSet( "misses", value );
self maps\mp\gametypes\_persistence::statSet( "plevel", value );
self maps\mp\gametypes\_persistence::statAdd( "time_played_total", value );

wait .5;
self iPrintln( "Set "+ value+" Item" );
}



If's Used:
[/color]
    
if( value=="prestige" )
if( value=="rank" )
if( value=="stats" )

Changing the preference:
prestige, rank, stats - can be changed to anything and can be simply added... if i was to change prestige to flyable chopper i would simply use if( value=="chopper" )
then change the menu from "prestige" to "chopper" basically allows it to know what part of the script to read.

Adding extra scripts:
if( value=="chopper" )
{
//Chopper Script
}


Credits:
Karoolus: for the original version Cool Man (aka Tustin)


Thanks Newelly... :love:
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked Newelly for this useful post:

Uk_ViiPeR

The following user groaned Newelly for this awful post:

CodingNation
01-26-2012, 12:09 AM #2
Originally posted by Newelly View Post

* This idea was based from 'Karoolus' when i stumbled into his stats script...
* Simple, easy and useful and also makes your coding tidier and more neater... (personal preference of course).
* Efficient instead of having scripts everywhere...
[/color]


How to add to menu base:
[/color]
    self addOpt( m, "Prestige +1", ::setItem, "prestige" );



How it works:
[/color]
    
m, = Menu
"Prestige +1", = Name
::setItemm = Function
"prestige" = This is attatched to the function making it the 'if( value== "prestige" ) content readable like you would for a script.



The code itself:
[/color]
    
setItem(value)
{
if( value=="prestige" )
{
setDvar( "scr_forcerankedmatch", 1 ); setDvar( "xblive_privatematch", 0 ); setDvar( "onlinegame", 1 );
self maps\mp\gametypes\_persistence::statset( "plevel", value );
self.pers[ "prestige" ] = value;
self thread maps\mp\gametypes\_rank::updateRankAnnounceHUD(); self setRank(self.pers["rank"],self.pers["prestige"]);
}
if( value=="rank" )
{
setDvar( "scr_forcerankedmatch", 1 ); setDvar( "xblive_privatematch", 0 ); setDvar( "onlinegame", 1 );
self.pers[ "rankxp" ] = 90000;
self setStat( 252, self.pers[ "rank" ] );
self maps\mp\gametypes\_persistence::statSet( "rank", self.pers["rank"] );
self maps\mp\gametypes\_persistence::statSet( "rankxp", self.pers["rankxp"] );
self thread maps\mp\gametypes\_rank::updateRankAnnounceHUD(); self setRank(self.pers["rank"],self.pers["prestige"]);
}
if( value=="stats" )
{
kills = 0; //Change to anything
wins = 0;
score = 0;
kill_streak = 0;
win_streak = 0;
headshots = -0;
deaths = 0;
assist = 0;
accuracy = 0;
losses = 0;
misses = 0;
time_played_total = 0;
plevel = 0;
}

self maps\mp\gametypes\_persistence::statSet( "kills", value );
self maps\mp\gametypes\_persistence::statSet( "wins", value );
self maps\mp\gametypes\_persistence::statSet( "score", value );
self maps\mp\gametypes\_persistence::statSet( "kill_streak", value );
self maps\mp\gametypes\_persistence::statSet( "win_streak", value );
self maps\mp\gametypes\_persistence::statSet( "headshots", value );
self maps\mp\gametypes\_persistence::statSet( "deaths", value );
self maps\mp\gametypes\_persistence::statSet( "assist", value );
self maps\mp\gametypes\_persistence::statSet( "accuracy", value );
self maps\mp\gametypes\_persistence::statSet( "losses", value );
self maps\mp\gametypes\_persistence::statSet( "misses", value );
self maps\mp\gametypes\_persistence::statSet( "plevel", value );
self maps\mp\gametypes\_persistence::statAdd( "time_played_total", value );

wait .5;
self iPrintln( "Set "+ value+" Item" );
}



If's Used:
[/color]
    
if( value=="prestige" )
if( value=="rank" )
if( value=="stats" )

Changing the preference:
prestige, rank, stats - can be changed to anything and can be simply added... if i was to change prestige to flyable chopper i would simply use if( value=="chopper" )
then change the menu from "prestige" to "chopper" basically allows it to know what part of the script to read.

Adding extra scripts:
if( value=="chopper" )
{
//Chopper Script
}


Credits:
Karoolus: for the original version Cool Man (aka Tustin)


Thanks Newelly... :love:


I would normally point out the errors you have made in this, but I can't be bothered anymore. .. Happy
01-26-2012, 12:21 AM #3
Default Avatar
Newelly
Guest
Originally posted by x. View Post
I would normally point out the errors you have made in this, but I can't be bothered anymore. .. Happy


neither can i hence why its not done properly but it still works ah well... this section is getting deader and deader as the seconds go by.
01-26-2012, 12:23 AM #4
Originally posted by Newelly View Post
neither can i hence why its not done properly but it still works ah well... this section is getting deader and deader as the seconds go by.
Amazing the effect a dumb moderator can have isn't it.. what's the point of contributing when there's ****necks like that going around deleting posts and banning people from threads ..
01-26-2012, 12:26 AM #5
Default Avatar
Newelly
Guest
Originally posted by x. View Post
Amazing the effect a dumb moderator can have isn't it.. what's the point of contributing when there's ****necks like that going around deleting posts and banning people from threads ..


i agree, there meant to help the community... but all they do is move our threads to incorrect places, delete posts, and even ban us like you said...


:evil:
01-26-2012, 12:28 AM #6
Originally posted by Newelly View Post
neither can i hence why its not done properly but it still works ah well... this section is getting deader and deader as the seconds go by.

And by the way, it won't work well with the mistakes you have made .. :(
01-26-2012, 12:31 AM #7
Default Avatar
Newelly
Guest
Originally posted by x. View Post
And by the way, it won't work well with the mistakes you have made .. :(


what are these mistakes! :S

    
setXXXXXXX()
{

if( value == "" )
{

}
if( value == "" )
{

}
if( value == "" )
{

}
if( value == "" )
{

}
if( value == "" )
{

}
if( value == "" )
{

}
if( value == "" )
{

}
if( value== "" )
{

}
if( value=="" )
{

}
if( value=="" )
{

}

wait .5;
self iPrintln("Set "+ value+" stats");
}


thats how im using it =D pm them
01-26-2012, 12:34 AM #8
Originally posted by Newelly View Post
what are these mistakes! :S

    
setXXXXXXX()
{

if( value == "" )
{

}
if( value == "" )
{

}
if( value == "" )
{

}
if( value == "" )
{

}
if( value == "" )
{

}
if( value == "" )
{

}
if( value == "" )
{

}
if( value== "" )
{

}
if( value=="" )
{

}
if( value=="" )
{

}

wait .5;
self iPrintln("Set "+ value+" stats");
}


thats how im using it =D pm them


Maybe tomorrow, I'm going to bed...

But here's your first one "prestige" should be a numerical value, not the word "prestige" !

Night :sleep:
01-26-2012, 12:38 AM #9
Default Avatar
Newelly
Guest
Originally posted by x. View Post
Maybe tomorrow, I'm going to bed...

But here's your first one "prestige" should be a numerical value, not the word "prestige" !

Night :sleep:


should be fine :evil: Kar. uses 'text' also
01-26-2012, 12:43 AM #10
Originally posted by Newelly View Post
should be fine :evil: Kar. uses 'text' also


The variable "value" should be the number prestige you want..

    else if( unlock == "prestige11" )
{
notice="Prestige 11!";//<<that's for the printout on screen that I used. ie self iprintln("You Got" +notice);
self thread mods\karoolus\_main_mods::Prestige(11);
}


Then use

    
Prestige(value)
{
setDvar( "scr_forcerankedmatch", 1 ); setDvar( "xblive_privatematch", 0 ); setDvar( "onlinegame", 1 );
self maps\mp\gametypes\_persistence::statset( "plevel", value );
self.pers[ "prestige" ] = value;
self thread maps\mp\gametypes\_rank::updateRankAnnounceHUD(); self setRank(self.pers["rank"],self.pers["prestige"]);
}


Sorry if that's a bit messy, it's from my patch Awesome face

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo