Ns Dev Team Looking For A New Coder
Caboose
title = name(self, handle) Join Date: 2003-02-15 Member: 13597Members, Constellation
in Off-Topic
<div class="IPBDescription">Post your code to help!!!</div> Ok, this is how the comm figures out he needs shirtguns...
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->#include <iostream.h>
#include <cornmander.h> //will cause errors
#include <nub.h> //more errors
int main() //main, WOW!
{
int shirtgun; //defines number of shirtguns
int lork; //defines number of lorks
shirtgun=random(15) //random number of shirtguns up to 15
lork=random(16) //random number of lorks up to 16
cout<<shirtgun/n //display number of shirtguns
cout<<lork/n //display number of lorks
if(shirtgun<lork) //if more lorks than shirtguns, OMG panic!!!
{
cout<<"There's a lork on the clorf!!! Give me a shirtgun!!!";
}
else //or else look for terrorists
{
cout<"OMG!!! terrorists!!! Fetch the AWP's!!!";
}
return 0;
}
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Post some code of your own to help out the NS dev team!!!
[notice]JOKE[/notice]
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->#include <iostream.h>
#include <cornmander.h> //will cause errors
#include <nub.h> //more errors
int main() //main, WOW!
{
int shirtgun; //defines number of shirtguns
int lork; //defines number of lorks
shirtgun=random(15) //random number of shirtguns up to 15
lork=random(16) //random number of lorks up to 16
cout<<shirtgun/n //display number of shirtguns
cout<<lork/n //display number of lorks
if(shirtgun<lork) //if more lorks than shirtguns, OMG panic!!!
{
cout<<"There's a lork on the clorf!!! Give me a shirtgun!!!";
}
else //or else look for terrorists
{
cout<"OMG!!! terrorists!!! Fetch the AWP's!!!";
}
return 0;
}
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Post some code of your own to help out the NS dev team!!!
[notice]JOKE[/notice]
Comments
//assorted code, including variable 'm' of type Mood
protected void moderator(Thread tBeingRead)
{
if (tBeingRead.isSpam()) m.worsen();
this.lock(tBeingRead);
}
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
See if you can spot the logic error <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
#include <onos.h>
#include <marine.h>
#include <class_player.h>
int main()
{
int iTime; // Round time in seconds
int iOnos; // Onos count
PLAYER marien;
PLAYER commando;
if (iTime <= 300 && iOnos >= 1)
{
cout << "OHNOES ONOS!! F4! F4!\n\n";
marien.f4();
}
else if (iTime > 300 && iOnos >= 1)
{
cout << "OMGZ COMMANDO DROP HGM'S!!1\n\n";
commando.dropweps(HMG, 2);
}
else
{
cout << "NUB COMMANDO!!11\n\n";
marien.voteeject();
}
return 0;
}<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Perfect!
if(shirtgun<lork) //if more lorks than shirtguns, OMG panic!!!<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Haha, nice.
#include <iostream.h>
#include <class_player.h>
#include <team1.h>
#include <team2.h>
void main()
{
int game_over = 0;
int time = 0;
while (game_over != 1) // loop until game over
{
if (team2.onos >= (.49 * team2.player.num))
{
team1.panic(f4); // onos, panic
game_over = 1; // end game
}
else if (team2.fade > 1)
{
team1.drop(shirtgun, (2 * team2.fade.num)); //shotguns
}
else if (team2.lork > 1)
{
team1.getupgrade(1); // get weapons
}
if (time > 100)
{
team1.getupgrade(0); // get armor
}
time++;
}
}
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
You and me both mate <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
You and me both mate <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo--><!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
c reads like english .. sorta
cout means "print"
cin means "input"
== checks for equality
!= checks for inequality
>, <, <=, >= check for relative values
= assigns a value
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->team1.drop(shirtgun, (2 * team2.fade.num));<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
for team one, drop something
drop shotguns
drop twice as many shotguns as team2's fades
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->include #<something.h><!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
ignore these
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->int/void main();<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
program starts here
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->int time = 0;<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
new variable time (integer), assign it a 0 to start
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->time++;<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
add one to time
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
while (game_over != 1) // loop until game over
{
[stuff]
}<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
keep going over the stuff inside the braces until the statement is false
(that means, loop until game_over is not not equal to 1, or when game_over is 1. ie: when the game ends)
edit: sonic, the ][ in your name messes up the [quote] tags ^^
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
void NSPLayer::Think(*p)
{
for(;;;)
{
if(rand() > .5)
p->message = pPlayer->AskForGL();
else
p->message = pPlayer->AskForHA();
}
}
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
0|\/|F6 I35 |\/|4|} 1337 |-|4xZ0R
void main() {
clients.set( PING , ( clients.get( PING ) * 2 ) ); // remove fade-blink-bug
for (;;; ) {
if ( client.action == FIRE_SHOTGUN ) {
kill ( clients.getClients( NOT_ON_TEAM , client.get( TEAM ) ) ); // remove shotgun-bug
}
}
}
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Just sticked with some bugfixing :-)
{
pev->classname = MAKE_STRING("player");
pev->health = 100;
pev->armorvalue = 0;
...
if( FBitSet(pev->flags, FL_NUB))
pev->netname = MAKE_STRING("NSPlayer");
...
if( pev->iuser3 == 6) // Fade
pev->flags |= FL_GODMODE;
}<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
I figured out the iuser3 thing by messing around with metamod last year.
<!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
#include <iostream.h>
#include <nub.h>
struct resho
{
char name;
int class;
float res;
};
int main()
{
resho nub;
nub.name="NSPlayer";
nub.class=1; //Class is skulk
nub.res=75;
int resTowers;
if(resTowers<=1 AND nub.name="NSPlayer" AND nub.class=1)
{
cout<<"NUB!!!";
nub.class=1 //Changes from Onos to skulk. mwahahahaha
}
else
{
cout<<"Build a hive nub!!!";
}
return 0;
}
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
...but I'll add something to it
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
//csnub.cpp
#include "nsplayer.h"
#include "whine.h"
#include "random.h"
class CSNub:public NSPlayer
{
public:
?void Think(*p); //it is pev, isn't it?
private:
?void OMG(WHINE msg);
};
void CSNub::Think(*p)
{
?OMG(randInt(WALLHAX, WHEREBOMBSITE));
}
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
//whine.h
#ifndef WHINE_H
#define WHINE_H
enum WHINE
{
?WALLHAX,
?AIMBOT,
?NEEDGUNZ,
?NEEDAWP,
?WHEREBOMBSITE,
};
#endif //WHINE_H
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
?
...
<!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->cout<<shirtgun/n<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Nice. Trying to use a control character outside a string? <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
Just thought of something <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->.
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->class Meek:public Earth
{
//...
};<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
<!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
Meh, I'm a n00b... <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html//emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /><!--endemo-->
...
while (exists(babbler)){
fork();
}
...
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->