AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Gain Level Problem (https://forums.alliedmods.net/showthread.php?t=20319)

broertje 11-06-2005 05:50

Gain Level Problem
 
So how can i do like when a player gain a new level he got something like +15 hp,
i thought something like getxp and if xp is ... he will get +15hp.
Can someone show me a little example like when you gain a lvl?

[ --<-@ ] Black Rose 11-06-2005 07:45

in what mod?

broertje 11-06-2005 07:58

My own,i just need a example : when you gain new lvl you recieve something

XxAvalanchexX 11-06-2005 13:54

Do you have an experience system set up yet?

Peli 11-06-2005 13:59

Well whenever I try that, I just base the xp by amount of kills, and use :
Code:
new frags = get_user_frags(id) if(frags == x) {    level2[id] == true    set_user_health(id, get_user_health(id) + 15)    client_print(id, print_chat, "You are level 2, you recieve 15 hp!") }
Something like that, but if you want a real xp mod you should try to look at the XP Mod Tutorial by Xuntric
Sorry if my codings a little wrong, it's early and it's just an example.

Kensai 11-06-2005 14:02

Here's I did it in my Ninja Mod.

Code:
#define CLASS_NOTHING 0 #define CLASS_TANK 1 #define CLASS_SWIFT 2 #define CLASS_SHADOW 3 #define CLASS_HEALER 4 #define CLASS_SHINOBI 5 #define MAXCLASSES 6

Code:
new PlayerClass[33] new PlayerXP[33] new PlayerLevel[33] new const CLASSES[MAXCLASSES][] = {     "None",     "Tank",     "Swift",     "Shadow",     "Healer",     "Shinobi" } new msgtext new const LEVELS[10] = {     100,       200,       400,       800,     1600,     3200,     6400,     12800,     25600,     51200 }

Code:
    register_event("ResetHUD","newround","b")

Code:
public newround(id)     {     new attacker = read_data(1)     ShowHUD(attacker)         if(get_cvar_num("amx_ninjaon") == 0)         {         return PLUGIN_HANDLED     }         //Strong Class     if(PlayerLevel[id] == 1 && PlayerClass[id] == CLASS_STRONG)         {                 set_user_health (id,125)         cs_set_user_armor(id,20,CS_ARMOR_KEVLAR)                 return PLUGIN_CONTINUE     }     if(PlayerLevel[id] == 2 && PlayerClass[id] == CLASS_STRONG)         {                 set_user_health (id,150)         cs_set_user_armor(id,40,CS_ARMOR_KEVLAR)                 return PLUGIN_CONTINUE         }                 //Etc.     return PLUGIN_CONTINUE }

It's REAL cumbersome that way, once you get over like 10 levels. Which is why I'm switching to an upgrde menu.


All times are GMT -4. The time now is 00:02.

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