Raised This Month: $ Target: $400
 0% 

Class help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-13-2006 , 11:27  
Reply With Quote #5

i think this works.
Code:
public AddXP(id, ammount) {     if ( g_PlayerClass[id] > 0) {                 g_PlayerXP[id] += ammount                 for ( new i = 0 ; i < MAXLEVELS ; i++ ) {                         if ( g_PlayerLevel[id]!= MAXLEVELS + 1 ) {                                 if ( g_PlayerXP[id] >= LEVELS[g_PlayerLevel[id] + 1 ]) {                     g_PlayerLevel[id]++                                         client_print(id, print_chat, "[* Mod] Congratulations! You are now level %i!", g_PlayerLevel[id])                 }                                 if ( g_PlayerXP[id] < LEVELS[g_PlayerLevel[id]])                     if ( g_PlayerLevel[id] > 0 )                     g_PlayerLevel[id]--             }         }     }         if(get_cvar_num("MM_savexp") == 1) {         SaveXP(id)     }         ShowHUD(id) // Call This every time xp changes. }

change your DeathMsg to this:
Code:
public DeathMsg() {     if(!get_cvar_num("sv_mythmod"))         return         new attacker = read_data(1)         new tempxp = get_cvar_num("MM_xp_per_kill")         AddXP(attacker, tempxp) }
and to that other problem with set_user_health, add if ( is_user_alive(id) && is_user_connected(id) ) {
set_user_hp(id, 100 + .....

and if you got a cvar, for giving xp, do something like this:
Code:
public GiveXP(id, level, cid) {     if (! cmd_access( id, level, cid, 0 ) )         return PLUGIN_HANDLED     new arg[32], xp[10]         read_argv(1, arg, 31)     read_argv(2, xp, 9)         new player = cmd_target( id, arg, 2 )         if ( !player ) {         return PLUGIN_HANDLED     }         AddXP(player, str_to_num(xp))         client_print(player,print_chat,"An admin gave you %d xp", str_to_num(xp))     ShowHUD(id)     return PLUGIN_CONTINUE }

hope this helps ya
[ --<-@ ] Black Rose is offline
 



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 20:14.


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