Raised This Month: $ Target: $400
 0% 

Turning off mode


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
worldspawn
Senior Member
Join Date: Aug 2009
Location: Russia, Yekaterinburg
Old 03-06-2010 , 03:57   Re: Turning off mode
Reply With Quote #2

use booleans
Code:
new bool:is_vampire_active = false
when you press key in a menu(to activate vampire mode),
Code:
is_vampire_active = true
and when you hook deathmsg, check if this boolean is true to perform actions

PHP Code:
public hook_death(id

   if (
is_vampire_active == false
         return; 
   
// Killer id 
   
nKiller read_data(1

   if ( (
read_data(3) == 1) && (read_data(5) == 0) ) 
   { 
      
nHp_add get_pcvar_num (health_hs_add
   } 
   else 
      
nHp_add get_pcvar_num (health_add

   
nHp_max get_pcvar_num (health_max

   
// Updating Killer HP 
   
if(get_user_flags(nKiller) & ADMIN_LEVEL_H && vampiremode[id] == 1
    
   
nKiller_hp get_user_health(nKiller
   
nKiller_hp += nHp_add 
    

   
// Maximum HP check 
   
if (nKiller_hp nHp_maxnKiller_hp nHp_max 
   set_user_health
(nKillernKiller_hp
    


Last edited by worldspawn; 03-06-2010 at 04:07.
worldspawn is offline
Send a message via ICQ to worldspawn Send a message via Skype™ to worldspawn
 



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 08:47.


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