AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Class Specific Menus (https://forums.alliedmods.net/showthread.php?t=20353)

Kensai 11-06-2005 22:46

Class Specific Menus
 
Trying to make Upgrade menus pop up for a player when they reacha certain level. Instead of doing it the super hard/long way by saying if their lvl = that show menu.

How can I set it so the menu pops up, when they gain a level?

Some of my defines and such:

Code:
new PlayerClass[33] new PlayerXP[33] new PlayerLevel[33] new const CLASSES[MAXCLASSES][] = {     "None",     "Tank",     "Swift",     "Shadow",     "Healer",     "Shinobi",     "Seer" } new msgtext new const LEVELS[20] = {     100,       200,       400,       800,     1600,     3200,     6400,     12800,     25600,     51200,     64000,     76800,     89600,     102400,     115200,     128000,     140800,     153600,     166400,     179200 }

Code:
    register_menucmd(register_menuid("menu_ChooseUpgrades"),1023,"DoChooseUpgrades");

Freecode 11-06-2005 23:10

for your huge array of levels i would make a small function and an equation in it which returns the xp. but thats me.

Anyways. proly somewhere inside your plugin u will end up adding a +1 level and then call the menu. If you dont add +1 level and just go by XP i suggest proly having something like oldXPLevel[33]. and just compare current one to oldXP.

what i would do is something like this:

instead of ur huge level array i do this
Code:
public getXP(level) {      new xp = (2 << (level - 2)) * 100;      return xp; }


All times are GMT -4. The time now is 23:42.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.