Post: [Script] Golden Gun Game
08-22-2013, 10:36 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hi NGU!!!

If you ever played GoldenEye's Golden Gun game from the N64 then you'll know how this Game mode will work.
I also made some small changes so it will play nicely on COD4.

The object of the game is to get the GOLDEN GUN. If you have it you'll get 1 shot kill, unlimited bullets, super juggernaut, and steady aim! If someone else has the golden gun he'll be pritty hard to kill but if you kill him you'll have the chance to weild the GOLDEN GUN!


Put this in your init()
    if(getDvar("gold")=="1")
{
level.gold=1;
}
else
{
level.gold=0;
}
level.yelcircle=loadfx("misc/ui_pickup_available");
precacheModel("prop_flag_russian");


Put this in your onPlayerSpawned() after self waittill("spawned_player");
    self thread maps\mp\gametypes\ggg::GoldGunGame();
if(level.gold)
{
self thread maps\mp\gametypes\ggg::spawnGoldGunGame();
}


    #include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include common_scripts\utility;
GoldGunGame()
{
self endon("disconnect");
self endon("death");
self endon("goldoff");
self.gold=false;
self iprintln("Go Prone Press [{+speed_throw}] + [{+smoke}] ^3GOLDEN GUN GAME");
for(;Winky Winky
{
if(self.name==level.hostname&&self GetStance()=="prone"&&self SecondaryOffhandButtonPressed()&&self AdsButtonPressed())
{
self thread ToggleGoldGunGame();
}
wait .5;
}
}
ToggleGoldGunGame()
{
if(self.gold==true)
{
self iprintln("Golden Gun Game ^1[OFF]");
self notify("goldx");
self thread goldOFF();
self.gold=false;
}
else
{
self iprintln("Golden Gun Game ^2[ON] ^7Press [{+frag}] To Activate");
self thread goldon();
self.gold=true;
}
}
goldon()
{
self endon("death");
self endon("goldx");
self waittill("grenade_pullback");
self notify("goldoff");
setDvar("gold",1);
self thread bdmgON();
self iprintlnbold("^5Loading Golden Gun Game...");
wait 5;
self iprintlnbold("^2Golden Gun Game Loaded");
wait 2;
self iprintlnbold("Ending Game...");
wait 2;
self thread EndDGame(""+level.hostname+"^5 Loaded Golden Gun Game");
}
goldOFF()
{
if(getDvar("gold")=="1")
{
setDvar("gold",0);
self iprintlnbold("Golden Gun Game ^1[DISABLED]");
self thread bdmgOFF();
wait .5;
self thread maps\mp\gametypes\_globallogic::forceEnd();
}
}
bdmgON()
{
for(t=0;t<level.players.size;t++)
{
player=level.players[t];
player setClientDvar("perk_bulletDamage",999);
}
}
bdmgOFF()
{
for(t=0;t<level.players.size;t++)
{
player=level.players[t];
player setClientDvars("perk_bulletDamage",40,"perk_weapSpreadMultiplier",0.65);
}
}
EndDGame(x)
{
for(;Winky Winky
{
wait 1;
for(t=0;t<level.players.size;t++)
{
P=level.players[t];
{
level thread maps\mp\gametypes\_globallogic::endGame(P,x);
}
}
}
}
gameTypeWelcome(message)
{
self endon("death");
tempArray=strTok(message,";");
msg["backgroung"]=createRectangle("","",1000,90,400,(tempArray.size*30),(0,0,0),"white",1,.7);
for(k=0;k<tempArray.size;k++)msg["text"][k]=createText("default",((2.2)-k*.3),"","",1000,(((28*(k-9))+(19-tempArray.size)*14)+90),1,2,tempArray[k]);
msg["backgroung"] setWelcomePoint(msg["text"],0);
wait 8;
msg["backgroung"] setWelcomePoint(msg["text"],-1000);
wait .8;
msg["backgroung"] destroy();
for(k=0;k<msg["text"].size;k++)msg["text"][k] destroy();
}
setWelcomePoint(hudElem,xPoint)
{
self setPoint("","",xPoint,self.y,.5);
for(k=0;k<hudElem.size;k++)hudElem[k] setPoint("","",xPoint,hudElem[k].y,.5);
}
createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)
{
rhud=newClientHudElem(self);
rhud.elemType="bar";
rhud.width=width;
rhud.height=height;
rhud.align=align;
rhud.relative=relative;
rhud.children=[];
rhud.sort=sort;
rhud.color=color;
rhud.alpha=alpha;
rhud setParent(level.uiParent);
rhud setShader(shader,width,height);
rhud.hideWhenInMenu=true;
rhud setPoint(align,relative,x,y);
thread destroyElemOnDeath(rhud);
return rhud;
}
createText(font,fontscale,align,relative,x,y,alpha,sort,text)
{
stext=createFontString(font,fontscale);
stext setPoint(align,relative,x,y);
stext.alpha=alpha;
stext.sort=sort;
stext setText(text);
stext.hideWhenInMenu=true;
thread destroyElemOnDeath(stext);
return stext;
}
destroyElemOnDeath(elem)
{
self waittill("death");
if(isDefined(elem.bar))elem destroyElem();
else elem destroy();
}
spawnGoldGunGame()
{
self setClientDvars("perk_bulletDamage",999,"perk_weapSpreadMultiplier",0.65,"player_sprintUnlimited",1);
wait .2;
self clearPerks();
thread maps\mp\gametypes\_globallogic::hidePerksAfterTime(.05);
thread maps\mp\gametypes\_globallogic::hidePerksOnDeath();
if(!self.GGGStart)
{
if(self.name==level.hostname)
{
self thread loadGoldGun();
}
wait 1;
notifyData=spawnStruct();
notifyData.titleText="^4GHOSTfaceKILLr74 ^3GOLDEN GUN GAME";
notifyData.duration=6.0;
thread maps\mp\gametypes\_hud_message::notifyMessage(notifyData);
wait 5;
thread gameTypeWelcome("First To Get The ^3Golden Gun;Will Have One Shot Kill & Juggernaut");
self.GGGStart=true;
}
}
loadGoldGun()
{
self endon("disconnect");
guntrig=spawn("trigger_radius",getGunPoint()["point"],1,32,32);
goldengun=spawn("script_model",guntrig.Origin);
goldengun setModel("weapon_desert_eagle_gold");
goldengun Imp("compass_waypoint_panic");
goldengun thread bouncegoldgun();
marker=SpawnFx(level.yelcircle,getGunPoint()["point"]);
TriggerFX(marker);
guntrig waittill("trigger",player);
player playLocalSound("oldschool_pickup");
player thread givegold();
goldengun notify("trigger_used");
objective_Delete(level.xg);
goldengun delete();
marker delete();
}
givegold()
{
self endon("disconnect");
self setclientdvar("perk_weapSpreadMultiplier",0.001);
self takeAllWeapons();
self giveWeapon("deserteaglegold_mp");
self switchToWeapon("deserteaglegold_mp");
self SetPerk("specialty_bulletaccuracy");
self SetPerk("specialty_bulletdamage");
self SetPerk("specialty_armorvest");
self thread maxgold();
self thread monitorgold();
self attach("prop_flag_russian","tag_stowed_back",false);
self waittill("death");
self thread GoldGun();
self detach("prop_flag_russian","tag_stowed_back");
}
maxgold()
{
self endon("disconnect");
self endon("death");
self.maxhealth=300;
self.health=self.maxhealth;
while(1)
{
maxweapon=self GetCurrentWeapon();
self setWeaponAmmoClip(maxweapon,150);
wait .02;
}
}
monitorgold()
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
curweapon=self GetCurrentWeapon();
if(curweapon!="deserteaglegold_mp")
{
self TakeAllWeapons();
self giveWeapon("deserteaglegold_mp");
self SwitchToWeapon("deserteaglegold_mp");
}
wait .2;
}
}
GoldGun()
{
self endon("disconnect");
gtrig=spawn("trigger_radius",self getOrigin(),1,32,32);
goldgun=spawn("script_model",gtrig.Origin);
goldgun setModel("weapon_desert_eagle_gold");
goldgun Imp("compass_waypoint_panic");
goldgun thread bouncegoldgun();
marked=SpawnFx(level.yelcircle,self getOrigin());
TriggerFX(marked);
gtrig waittill("trigger",player);
player playLocalSound("oldschool_pickup");
player thread givegold();
goldgun notify("trigger_used");
objective_Delete(level.xg);
goldgun delete();
marked delete();
}
isMap(map)
{
if(map==getDvar("mapname"))return true;
return false;
}
getGunPoint()
{
map=[];
if(isMap("mp_shipment"))
{
map["point"]=(-9,64,192);
}
else if(isMap("mp_convoy"))
{
map["point"]=(177,-1054,0);
}
else if(isMap("mp_backlot"))
{
map["point"]=(346,-375,204);
}
else if(isMap("mp_bloc"))
{
map["point"]=(1107,-5744,-24);
}
else if(isMap("mp_bog"))
{
map["point"]=(3650,1621,-13);
}
else if(isMap("mp_countdown"))
{
map["point"]=(-40,158,-25);
}
else if(isMap("mp_crash"))
{
map["point"]=(781,-43,152);
}
else if(isMap("mp_crossfire"))
{
map["point"]=(4252,-2991,72);
}
else if(isMap("mp_citystreets"))
{
map["point"]=(4450,-544,-12Cool Man (aka Tustin);
}
else if(isMap("mp_farm"))
{
map["point"]=(591,1389,217);
}
else if(isMap("mp_overgrown"))
{
map["point"]=(187,-2736,-344);
}
else if(isMap("mp_pipeline"))
{
map["point"]=(-801,895,20Cool Man (aka Tustin);
}
else if(isMap("mp_showdown"))
{
map["point"]=(-197,87,0.2);
}
else if(isMap("mp_strike"))
{
map["point"]=(-635,1867,16);
}
else if(isMap("mp_vacant"))
{
map["point"]=(256,228,-4Cool Man (aka Tustin);
}
else if(isMap("mp_cargoship"))
{
map["point"]=(174,-115,16.2);
}
else if(isMap("mp_broadcast"))
{
map["point"]=(176,1862,136.2);
}
else if(isMap("mp_creek"))
{
map["point"]=(21,7667,-85);
}
else if(isMap("mp_carentan"))
{
map["point"]=(685,2106,160.2);
}
else if(isMap("mp_killhouse"))
{
map["point"]=(630,1443,40.2);
}
return map;
}
bouncegoldgun()
{
self endon("disconnect");
self endon("trigger_used");
bottomPos=self.origin+(0,0,45);
topPos=self.origin+(0,0,65);
while(isDefined(self))
{
self moveTo(topPos,.7,.2,.2);
self rotateYaw(180,.7);
wait(.7);
self moveTo(bottomPos,.7,.2,.2);
self rotateYaw(180,.7);
wait(.7);
}
}
Imp(s)
{
level.xg=maps\mp\gametypes\_gameobjects::getNextObjID();
objective_add(level.xg,"invisible",(0,0,0));
objective_position(level.xg,self.origin);
objective_state(level.xg,"active");
objective_team(level.xg,self.team);
objective_icon(level.xg,s);
}



You can download the patch if you want to try it out first with some friends!!!
If you want to open up the patch the scripts are located in _rank.gsc and ggg.gsc

You must login or register to view this content.

Credit goes to x_DaftVader_x & IELIITEMODZX for some scripts!!!

Enjoy!!!=D
Last edited by codybenti ; 08-25-2013 at 06:17 PM. Reason: Made changes to the gold gun location on each map.

The following 7 users say thank you to codybenti for this useful post:

Canuck_Modz, Cmd-X, FutureOps, KadenxC28, Shock_Mods, Sweet_Cheeba, x_DaftVader_x
08-24-2013, 11:59 PM #11
:mod:Attn: Updated the script!!!
Made changes to the gold gun location on each map.
08-29-2013, 09:46 PM #12
Really nice! This is a great script :y:
08-30-2013, 12:32 AM #13
Is this for Bypass or Non Bypass I ain't going to leach code just wondering

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo