.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   The RealBot 'Source' (http://forums.bots-united.com/forumdisplay.php?f=52)
-   -   Is this correct? or is it a bug? (http://forums.bots-united.com/showthread.php?t=2617)

[BBB]sluggo 08-09-2004 22:08

Is this correct? or is it a bug?
 
Hi, like I said before... I can not code but when looking at the code I found something that I cant understand... let's see if I can paste it correctly :P

Code:

if (team == 2) // Counter-Terrorist *sluggo* if CT then do the first switch?
{
// 30/07/04 by Josh
// Use a switch instead of multiple if
// *sluggo*Is this correct? Shouldn't the switch:es change places?
// *sluggo*If the bot is CT then it goes to the first switch and thats the Terrorist weapons? or am I missing something?
switch (weapon)
{
case CS_WEAPON_SG552: return false; break;
case CS_WEAPON_AK47: return false; break;
case CS_WEAPON_ELITE: return false; break;
case CS_WEAPON_MAC10: return false; break;
case CS_WEAPON_GALIL: return false; break;
// 30.8.04 added by frashman
case CS_WEAPON_G3SG1: return false; break;
}
}
else
{
switch (weapon)
{
case CS_WEAPON_AUG: return false; break;
case CS_WEAPON_FIVESEVEN: return false; break;
case CS_WEAPON_M4A1: return false; break;
case CS_WEAPON_TMP: return false; break;
case CS_WEAPON_FAMAS: return false; break;
case CS_WEAPON_SHIELD: return false; break;
//30.8.04 added by Frashman
case CS_WEAPON_SG550: return false; break;
case CS_DEFUSEKIT: return false; break;
}
}

Nope, can't get the code tag to work.. :( sry..



dstruct2k: That's because it isn't an HTML tag. Use [] instead of <> ;)

Josh_Borke 08-09-2004 23:23

Re: Is this correct? or is it a bug?
 
if they are on the CT team, then those weapons will return false, meaning they are not good weapons for them to buy, therefore they will not buy them.

rather than return true for each weapon, we return false for exclusive weapons
less code :)

HTH

[BBB]sluggo 09-09-2004 00:32

Re: Is this correct? or is it a bug?
 
I must learn to code so I don't have to take up half the forum space with stupid questions! :o :o

Thanks for the info Josh!

frashman 09-09-2004 12:12

Re: Is this correct? or is it a bug?
 
to learn coding, you should first code some simple programs. try to begin with some c++ tutorials.
Later you can look at Realbot Source. Ok do what you want. ;)

Whistler 09-09-2004 14:10

Re: Is this correct? or is it a bug?
 
to post code you can use [ code] and [ /code] tags (without spaces)

[BBB]sluggo 09-09-2004 17:08

Re: Is this correct? or is it a bug?
 
Quote:

Originally Posted by frashman
to learn coding, you should first code some simple programs. try to begin with some c++ tutorials.
Later you can look at Realbot Source. Ok do what you want. ;)

Thanks, I'll do that. Going to search the internet for tutorials... there should be some out there =)

Quote:

Originally Posted by Whistler
to post code you can use [ code] and [ /code] tags (without spaces)

Uhm, thanks :o I tried it with <code> </code> ... didn't work 9_9

When I have learned some coding I will be back with some intelligent questions for a change :D :D
Until then, keep up the good work guys! (and girls if any?)

Ry Spy 13-09-2004 03:27

Re: Is this correct? or is it a bug?
 
It's not a stupid question for me. It's perfectly natural for begginers, but when you get used to it, it is as easy as pie. 8)


All times are GMT +2. The time now is 16:15.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.