khalidahmedshalabi / SAMPBulletproof

Bulletproof Gamemode is a SA-MP gamemode which is believed to take A/D and TDM to a new level.
http://khalidahmedshalabi.github.io/BulletproofGamemodeWebsite/
Apache License 2.0
16 stars 20 forks source link

CreateCommandConfig in LoadCommands #13

Closed khalidahmedshalabi closed 8 years ago

khalidahmedshalabi commented 9 years ago

@ApplePieLife reported that he couldn't add commands with pre-set level like the example, so I suppose there's something wrong with this bunch of code in modules\src\commands.inc

                switch (YHash(Command_GetName(i), false))
        {
            /*
                        Example:
                                I'm releasing a new version with a new command '/crashplayer' and I want it to be for only level 4 admins
                                So I do this

            case _I<crashplayer>:
            {
                CreateCommandConfig("crashplayer", 4); // Level param is not ignored here (unless the command is already in the database with a level)
            }

            */
            default:
            {
                CreateCommandConfig(Command_GetName(i), 0); 
                // Level param could be ignored unless you you make a NEW ADMIN command in future versions (see example above)
            }
        }