Post: Code: Gun Game
04-21-2011, 09:03 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Before i start i want to say thank you to XKevin356.

Call this from your menu: doGungame

Heres the code
    doGungame()
{
self iPrintlnBold("^5No Cheating!");
for ( t=0; t < level.players.size; t++ )
{
players = level.players[t];
players notify ("gungame_start");
players thread hintMessage("^5Gun Game Is Starting...");
players thread initGuns();
players thread doGun();
setDvar( "cg_objectiveText", "Get a kill to change weapon and get 20 kills and become victorius");
setDvar("player_sustainAmmo", 0);
setDvar("g_gametype", "dm");
setDvar("scr_player_maxhealth", 30);
setDvar( "scr_game_perks", "0" );
setDvar("player_meleerange", 0);
setDvar("jump_height", 69);
setDvar("g_gravity", 400);
setDvar("g_speed", 220);
setDvar("scr_dm_scorelimit", ((self.gunList.size - 1) * self.upgscore) + (self.finalkills * 5));
setDvar("scr_dm_timelimit", 0);
setDvar("scr_game_hardpoints", 0);
setDvar("lobby_status", 1);
players clearPerks();
players suicide();
}
}
initGuns()
{
self.inverse = false;
self.upgscore = 5;
self.finalkills = 1;
self.gunList = [];
self.gunList[0] = createGun("colt_mp", true);
self.gunList[1] = createGun("nambu_mp", true);
self.gunList[2] = createGun("walther_mp", true);
self.gunList[3] = createGun("gewehr43_mp", false);
self.gunList[4] = createGun("m1carbine_mp", false);
self.gunList[5] = createGun("stg44_mp", false);
self.gunList[6] = createGun("shotgun_mp", true);
self.gunList[7] = createGun("doublebarreledshotgun_mp", true);
self.gunList[8] = createGun("springfield_mp", false);
self.gunList[9] = createGun("kar98k_mp", false);
self.gunList[10] = createGun("ptrs41_mp", false);
self.gunList[11] = createGun("mp40_mp", false);
self.gunList[12] = createGun("ppsh_mp", false);
self.gunList[13] = createGun("type100smg_mp", false);
self.gunList[14] = createGun("thompson_mp", false);
self.gunList[15] = createGun("bazooka_mp", false);
self.gunList[16] = createGun("dp28_mp", false);
self.gunList[17] = createGun("bar_mp", false);
self.gunList[18] = createGun("mg42_mp", false);
self.gunList[19] = createGun("fg42_mp", false);
self.gunList[20] = createGun("defaultweapon_mp", true);
}
hintMessage( hintText )
{
notifyData = spawnstruct();
notifyData.notifyText = hintText;
notifyData.glowColor = (1, 1, 0);
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
}
createGun(gunName, laserSight)
{
gun = spawnstruct();
gun.name = gunName;
gun.laser = laserSight;
return gun;
}

doGun()
{
self endon("disconnect");
if(self.inverse) self.curgun = self.gunList.size - 1;
else self.curgun = 0;
curscore = 0;
done = false;
while(true){
if(self.inverse && self.curgun <= 0) done = true;
if(!self.inverse && self.curgun >= (self.gunList.size - 1)) done = true;
if(!done){
if(self.inverse && (self.score - curscore >= self.upgscore)){
self.curgun--;
self thread hintMessage("^1Weapon Downgraded!");
curscore = self.score;
}else if((self.score - curscore >= self.upgscore)){
self.curgun++;
self thread hintMessage("^5Weapon Upgraded - Level "+self.curgun);
curscore = self.score;
}
}
while(self getCurrentWeapon() != self.gunList[self.curgun].name){
if(self.gunList[self.curgun].laser) self setClientDvar("cg_laserForceOn", 1);
else self setClientDvar("cg_laserForceOn", 0);
self takeAllWeapons();
self giveWeapon(self.gunList[self.curgun].name);
self switchToWeapon(self.gunList[self.curgun].name);
wait .2;
}
self giveMaxAmmo(self.gunList[self.curgun].name);
wait .2;
}
}


This takes effect on everyone in the lobby!
Once more: Thanks Kevin!:fa:
Rep kevin -----> You must login or register to view this content.
(adsbygoogle = window.adsbygoogle || []).push({});

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

.Kane., XKevin356
04-23-2011, 06:05 AM #11
.Kane.
Banned
Originally posted by studman31 View Post
Thanks but you should put them in spoilers so they dont fill the thread up :p:fyea:


aren't those zombie game modes.
04-23-2011, 02:04 PM #12
Originally posted by Kane212
aren't those zombie game modes.


yes but i can convert them.
04-23-2011, 10:17 PM #13
.Kane.
Banned
Originally posted by studman31 View Post
yes but i can convert them.


if you release them ill add to my edits unless your not or dont want me to.
04-23-2011, 10:25 PM #14
Originally posted by Kane212
if you release them ill add to my edits unless your not or dont want me to.


Nah bro im not releasing shit anymore. Everyone hates on me.
i got a beast new menu but **** it.
04-23-2011, 10:36 PM #15
.Kane.
Banned
Originally posted by studman31 View Post
Nah bro im not releasing shit anymore. Everyone hates on me.
i got a beast new menu but **** it.


why everyone hate you bro.
04-23-2011, 11:20 PM #16
Originally posted by Kane212
why everyone hate you bro.


My flashing text i released. everyone said it was blackstorms when it wasnt. it was mine.
04-23-2011, 11:22 PM #17
.Kane.
Banned
Originally posted by studman31 View Post
My flashing text i released. everyone said it was blackstorms when it wasnt. it was mine.


people said it was blackstorms and you just converted to W@W
04-23-2011, 11:47 PM #18
Originally posted by Kane212
people said it was blackstorms and you just converted to W@W


Yeahhh, no. i got it from a old cod4 patch that never worked. my friend sent it to me but hes not on ngs sooooo. no credit.Gaspink:
04-23-2011, 11:50 PM #19
XKevin356
Are you high?
Originally posted by Kane212
people said it was blackstorms and you just converted to W@W


lol even blackstorm said it himself and so did alfa and playstation3lb

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo