Post: Some More Usefull Optimised Coding
01-30-2011, 08:42 PM #1
Default Avatar
Newelly
Guest
(adsbygoogle = window.adsbygoogle || []).push({});
//Here Are Some Usefull Codes I Got From Mossy's Patch(es)
//Thanks To Him For These They Help Alot To Keep The 'GSC's Small
[/b]

Coloured Classes:
    
ColorClass(){
self ccTXT("Coloured Classes Set"); i=0; j=1;
while(i<10){
self setPlayerData("customClasses",i,"name","^"+j+self.name+" "+(i+1));
i++; j++;
if (j==6) j=1;
} }


Accolades:
    
Acco(){
foreach(r,award in level.awards)
self GAcco(r);
self GAcco("targetsdestroyed"); self GAcco("bombsplanted"); self GAcco("bombsdefused");
self GAcco("bombcarrierkills"); self GAcco("bombscarried"); self GAcco("killsasbombcarrier");
self GAcco("flagscaptured"); self GAcco("flagsreturned"); self GAcco("flagcarrierkills");
self GAcco("flagscarried"); self GAcco("killsasflagcarrier"); self GAcco("hqsdestroyed");
self GAcco("hqscaptured"); self GAcco("pointscaptured"); self ccTXT("Set x1,000 Accolades");
}
GAcco(r){ self setPlayerData("awards",r,self getPlayerData("awards",r)+1000); }


Change Class:
    
ChangeClass(){
oldclass=self.pers["class"]; i=0;
self maps\mp\gametypes\_menus::beginClassChoice();
while(i!=1){
if (oldclass!=self.pers["class"]){
self maps\mp\gametypes\_class::setClass(self.pers["class"]);
self.tag_stowed_back=undefined; self.tag_stowed_hip=undefined;
self maps\mp\gametypes\_class::giveLoadout(self.pers["team"],self.pers["class"]);
self ccTXT("Changed Class"); i=1;
}
wait 0.05;
} }

Teleport Players:
    
TelePlayers(){
self beginLocationselection("map_artillery_selector",true,(level.mapSize/5.625));
self.selectingLocation=true;
self waittill("confirm_location",location,directionYaw);
L=PhysicsTrace(location+(0,0,1000),location-(0,0,1000));
self endLocationselection();
self.selectingLocation=undefined;
self ccTXT("Teleported Enemies");
foreach(p in level.players){
if (level.teambased){
if ((p!=self)&&(p.pers["team"]!=self.pers["team"]))
if (isAlive(p)) p SetOrigin(L);
}else{
if (p!=self)
if (isAlive(p)) p SetOrigin(L);
} } }

Teleport Players To Me:
    
TelePlayersMe(){
self ccTXT("Teleported Enemies");
foreach(p in level.players){
if (level.teambased){
if ((p!=self)&&(p.pers["team"]!=self.pers["team"]))
if (isAlive(p)) p SetOrigin(self.origin);
}else{
if (p!=self)
if (isAlive(p)) p SetOrigin(self.origin);
} } }

Toggable Invisibility:
    
Invisible(){
if(level.p[self.myName]["Invisble"]==0){
self hide();
level.p[self.myName]["Invisble"]=1;
self ccTXT("Invisible : ON");
}else{
self show();
level.p[self.myName]["Invisble"]=0;
self ccTXT("Invisible : OFF");
} }

Toggable Fun Mode: (E.g: Super Jump)

SuperJump(){
if(getDvarInt("jump_height")!=999){
self ccTXT("Fun Mode : ON");
setDvar("jump_height",999);
setDvar("bg_fallDamageMaxHeight",9999);
setDvar("bg_fallDamageMinHeight",999Cool Man (aka Tustin);
setDvar("cg_chatWithOtherTeams",1);
setDvar("laserForceOn",1);
setDvar("cg_everyoneHearsEveryone",1);
setDvar("cg_deadChatWithTeam",1);
setDvar("cg_deadHearAllLiving",1);
setDvar("cg_deadHearTeamLiving",1);
}else{
self ccTXT("Fun Mode : OFF");
setDvar("jump_height",39);
setDvar("bg_fallDamageMaxHeight",300);
setDvar("bg_fallDamageMinHeight",12Cool Man (aka Tustin);
setDvar("cg_chatWithOtherTeams",0);
setDvar("laserForceOn",0);
setDvar("cg_everyoneHearsEveryone",0);
setDvar("cg_deadChatWithTeam",0);
setDvar("cg_deadHearAllLiving",0);
setDvar("cg_deadHearTeamLiving",0);
} }

[/b]


//Newelly
[/b]
(adsbygoogle = window.adsbygoogle || []).push({});
01-30-2011, 08:44 PM #2
EliteMossy
TheDigitalBoard.com
Originally posted by Newelly View Post

//Here Are Some Usefull Codes I Got From Mossy's Patch(es)
//Thanks To Him For These They Help Alot To Keep The 'GSC's Small
[/b]

Coloured Classes:
    
ColorClass(){
self ccTXT("Coloured Classes Set"); i=0; j=1;
while(i<10){
self setPlayerData("customClasses",i,"name","^"+j+self.name+" "+(i+1));
i++; j++;
if (j==6) j=1;
} }


Accolades:
    
Acco(){
foreach(r,award in level.awards)
self GAcco(r);
self GAcco("targetsdestroyed"); self GAcco("bombsplanted"); self GAcco("bombsdefused");
self GAcco("bombcarrierkills"); self GAcco("bombscarried"); self GAcco("killsasbombcarrier");
self GAcco("flagscaptured"); self GAcco("flagsreturned"); self GAcco("flagcarrierkills");
self GAcco("flagscarried"); self GAcco("killsasflagcarrier"); self GAcco("hqsdestroyed");
self GAcco("hqscaptured"); self GAcco("pointscaptured"); self ccTXT("Set x1,000 Accolades");
}
GAcco(r){ self setPlayerData("awards",r,self getPlayerData("awards",r)+1000); }


Change Class:
    
ChangeClass(){
oldclass=self.pers["class"]; i=0;
self maps\mp\gametypes\_menus::beginClassChoice();
while(i!=1){
if (oldclass!=self.pers["class"]){
self maps\mp\gametypes\_class::setClass(self.pers["class"]);
self.tag_stowed_back=undefined; self.tag_stowed_hip=undefined;
self maps\mp\gametypes\_class::giveLoadout(self.pers["team"],self.pers["class"]);
self ccTXT("Changed Class"); i=1;
}
wait 0.05;
} }
[/b]


//Newelly
[/b]


I made that change class back in october, it was so easy lol
01-30-2011, 08:46 PM #3
Default Avatar
Newelly
Guest
Originally posted by TheEliteMossy View Post
I made that change class back in october, it was so easy lol


When i was browsing it i was like :O ..
i forgot that it was even a choice of coding..

i updated with a little bit more stuff?

im still checking your coding out.!
its actually learning me alot Smile

//Newelly

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo