Forum

ASSIST, AMERICA'S ARMY COMMUNITY - RELIVE THE GLORY DAYS OF AMERICA'S ARMY 2.5

Author Topic: UltimateMod v1.0  (Read 3014 times)

0 Members and 1 Guest are viewing this topic.

Offline LEEFFM

UltimateMod v1.0
« on: Friday, December 05, 2014, 01:51:36 AM »
Code Located At http://pastebin.com/WDFYBxAL

when I pasted it some areas where tabbed even though they are not tabbed in the document just makes it look messier lol.

This is the Ultimate Mod ive been working on not done yet still have plans for it.

as of now the client commands are:
everyone is a medic there is no command it is forced.

mutate thirdperson - Sets Behindview On

mutate firstperson - Sets Behindview Off

mutate [class] - Forces You A Weapon While Alive
classes are: AR,RPK,R,AK,G,GP,M,SF,AK74SU,PSO,MOS,SVD,S24,S,SPR,V,RPG,AT4,M9
mutate shotty - Forces You A Shotgun While Alive

current admin commands consist of:
all client commands

mutate allowrifles 1|2 - 1 Rifles Are Allowed | 2 Rifles Are Not Allowed

mutate allowmgs 1|2 - 1 Machine Guns Are Allowed | 2 Machine Guns Are Not Allowed

mutate allowsnipers 1|2 - 1 Snipers Are Allowed | 2 Snipers Are Not Allowed

mutate nvg 1|2 - 1 Night Vision Goggles Are Allowed | 2 Night Vision Goggles Are Not Allowed
 
mutate allowrockets 1|2 - 1 Rockets Are Allowed | 2 Rockets Are Not Allowed

(Shotgun and M9 are always allowed!)

mutate riflesonly 1|2 - 1 Rifles Only On | 2 Rifles Only Off

mutate mgsonly 1|2 - 1 Machine Guns Only On | 2 Machine Guns Only Off

mutate snipersonly 1|2 - 1 Snipers Only On | 2 Snipers Only Off

mutate shottyonly 1|2 - 1 Shotty Only On | 2 Shotty Only Off

mutate m9only 1|2 - 1 M9 Only On | M9 Rifles Only Off

mutate kill [PlayerID] - kills player "PlayerName has Killed Himself" displays reason as "PlayerName has been killed by an Admin for Violation(s) of Server Rules!" people disobeying rules don't kick or ban unless you have to stop their rule breaking in its tracks.

mutate jail [PlayerID] - sends player to Leavenworth with reason "PlayerName was Court Marshaled for Violation(s) of Server Rules!" the same person(s) still disobeying rules and not listening to admins send them to jail.

mutate addadmin [PlayerID] - temporarily adds admin Note: this does not edit your ini files you must still add admins in manually but for temporary use this command

mutate restart - spams console command "admin say SERVER IS RESTARTING!!!" so people know when your manually restarting your server.

mutate rules - shows server rules.

mutate clist - shows a list of commands

The Compiled Mod Is Located at http://www.megafileupload.com/en/file/585196/UltimateMod-u.html
you must remove the [Megafileupload] from the name of the file to use it.

place the file in your servers system folder.
under [Engine.GameEngine]
add line: ServerActors=UltimateMod.ultimatemod

hackhunter must = 0 for mutate thirdperson or your screen will shake and it will kick you back to firstperson. hackhunter being disabled disables tracking but mod servers are not tracked anyways. hackhunter is where all warning you see in game are that make your screen shake.
« Last Edit: Friday, December 05, 2014, 02:27:00 AM by LEEFFM »

Offline NoBigDeal

  • Loyal Member
  • ****
  • Posts: 410
  • Banned
    • View Profile
Re: UltimateMod v1.0
« Reply #1 on: Friday, December 05, 2014, 05:12:38 AM »
Don't know how much you know about code optimisation, but this one is the mess ...
1. use 'switch' or 'else if' statement - if not, engine will check every single 'if' even if already found one.
2. no need to compare a bool variable ('if (bAllow203 == true)') - bool variable it self is enough ('if (bAllow203)')
3. use '&&' statement instead of writing the pyramid of 'if' statements.
e.g. Bad:
Quote
function checkdefaultsettings () {
    if (bAllowRifles == true) {
        if (bAllow203 == true) {
            if (bAllowMgs == true) {
                if (bAllowSnipers) {
                    if (bAllowRockets == true) {
                        if (bNVG == true) {
                            bDefaultSettings = true ;
                        }
                     }
                }
            }
         }
    }
}

Good:
Quote
function checkdefaultsettings ()
{
    if (bAllowRifles && bAllow203 && bAllowMgs && bAllowSnipers && bAllowRockets && bNVG)
        bDefaultSettings = true;
}

Last thing: Keep all brackets visible as in example above to keep code clean and transparent.
What if you could change the world by changing your perspective of it?
Would you?

Offline LEEFFM

Re: UltimateMod v1.0
« Reply #2 on: Friday, December 05, 2014, 17:50:32 PM »
thanks for the tips but as for the last tip I like doing it
Code: [Select]
function MyFunction {



}

its easier for myself to read the code that way :P but I will defiantly  use the other tips ^^

Offline NoBigDeal

  • Loyal Member
  • ****
  • Posts: 410
  • Banned
    • View Profile
Re: UltimateMod v1.0
« Reply #3 on: Friday, December 05, 2014, 21:01:33 PM »
... but harder to find missing bracket.
Try to keep your code modular as possible - it helps to understand and above all you can't get lost ...
« Last Edit: Friday, December 05, 2014, 21:13:59 PM by NoBigDeal »
What if you could change the world by changing your perspective of it?
Would you?

Offline Spanky

  • <?php echo $opinion .' is better.'; ?>
  • Administrator
  • Posts like a Spanky!
  • *
  • Posts: 10,893
    • View Profile
    • NatesComp.com
  • AA: tigobitties
Re: UltimateMod v1.0
« Reply #4 on: Saturday, December 06, 2014, 03:16:07 AM »
I gotta admit, I do the same thing LEEFFM does. Except, I comment the ending bracket to state which function or item it belongs to.
It's like shaving your pubes to make your junk look bigger.
Might look bigger, but it aint.....

Offline Alex

Re: UltimateMod v1.0
« Reply #5 on: Saturday, December 06, 2014, 14:35:17 PM »
I do what NoBigDeal does. It just makes the code much easier to read with the brace on a new line. I find it annoying that Netbeans and Eclipse default to the same line braces, although you can change it after doing some digging through the settings.

 

Download Assist

×

Download Game Client

Important: Battletracker no longer exists. However, old Battletracker accounts may still work. You can create a new 25Assist account here

Download Server Manager