ItsMods

Full Version: Roll The Class by OTW
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I would implement an attachment checking system, the gun var would be like

PHP Code:
gun self.rollGun self.rollAttachment "_mp"

It would take a little bit, since not all guns in a certain class use the same attachments. I could add to special random class, by adding ar's with flamethrower and stuff. Also does it make more sense to make the special occur a lot less often ?
The way that the bots' weapon randomizing system is set up only gets the list of valid attachments for a given weapon. Making them specific to a certain class would perhaps not be as easy. I guess it could check which class its rolling for and filter out "bad" attachments by name, such as a sniper scope for an assault rifle.
Well i will do it in a switch

if assault set switch var to (some number) idk if we can use words as cases like I did in java then in the statement case #: if gun = this then randomize a couple attachments. Ill check the bot code, I never thought of checking that because their weapons are very simply customized.
(04-21-2011, 23:23)OneThatWalks Wrote: [ -> ]Well i will do it in a switch

if assault set switch var to (some number) idk if we can use words as cases like I did in java then in the statement case #: if gun = this then randomize a couple attachments. Ill check the bot code, I never thought of checking that because their weapons are very simply customized.

It would probably be safer to roll for attachments using the bot code and then use a class switch to filter out the attachments that you dont want. That ensures that you wont get an invalid attachment for the weapon that was rolled.

All the bot code does is read the weapon list and randomly pick a weapon. It then checks to see if the weapon fits certain criteria (slot, rank requirement, etc) and if its valid it then rolls for a random valid attachment. Otherwise it just picks another random weapon and tries again.
Ill check it out. Meanwhile BETA 2 should be out sometime in the near future.
The code is not confusing at all. Everyone has their own coding style but as long as your style is efficient, understandable and consistent it should be OK.

This is the same:
Code:
if(self.aimbotActive) self iPrintlnBold("Aimbot is ^2ON");
else self iPrintlnBold("Aimbot is ^1OFF");

as this:
Code:
if(self.aimbotActive)
   self iPrintlnBold("Aimbot is ^2ON");
else
    self iPrintlnBold("Aimbot is ^1OFF");

GSC Scripts similarly to Java or C++ don't care about the indenting or where the command is. As long as it's straight after the if statement (under, or next to it) then it will execute the code anyway.
Pages: 1 2