Raised This Month: $ Target: $400
 0% 

Gain Level Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
broertje
Senior Member
Join Date: Mar 2005
Old 11-06-2005 , 05:50   Gain Level Problem
Reply With Quote #1

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?
broertje is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-06-2005 , 07:45  
Reply With Quote #2

in what mod?
[ --<-@ ] Black Rose is offline
broertje
Senior Member
Join Date: Mar 2005
Old 11-06-2005 , 07:58  
Reply With Quote #3

My own,i just need a example : when you gain new lvl you recieve something
broertje is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-06-2005 , 13:54  
Reply With Quote #4

Do you have an experience system set up yet?
XxAvalanchexX is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 11-06-2005 , 13:59  
Reply With Quote #5

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.
Peli is offline
Send a message via MSN to Peli
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 11-06-2005 , 14:02  
Reply With Quote #6

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.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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