Raised This Month: $ Target: $400
 0% 

Round master


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 06-06-2010 , 07:12   Re: Round master
Reply With Quote #1

I would do it this way:
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN "Round boss"
#define VERSION "1.0"
#define AUTHOR "addinol"

new bool:g_is_boss[33]
new 
g_max_players
new hpapbspeed

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_logevent("logevent_round_start"2"1=Round_Start")
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
register_event("CurWeapon""Event_CurWeapon""be","1=1");
    
g_max_players get_maxplayers()
    
    
hp register_cvar("inch_bosshp","200")
    
ap register_cvar("inch_bossap","200")
    
bspeed register_cvar("inch_bosssp","30.0")
}


public 
event_new_round(){
    for(new 
i=0i<=g_max_playersi++)
        
g_is_boss[i] = false
}


public 
logevent_round_start(){
    static 
players[32], pnum
    get_players
(playerspnum"ae""CT")
    if(
pnum>0)
        
make_boss(playersrandom(pnum) ])

    
get_players(playerspnum"ae""TERRORIST")
    if(
pnum>0)
        
make_boss(playersrandom(pnum) ])
}


public 
make_boss(id){
    
set_user_health(id get_pcvar_num(hp))
    
cs_set_user_armor(idget_pcvar_num(ap), CS_ARMOR_VESTHELM)
    
g_is_boss[id] = true
}


public 
Event_CurWeapon(id){
    if(
g_is_boss[id])
        
set_user_maxspeed(id get_user_maxspeed(id) + get_pcvar_float(bspeed));

__________________
Impossible is Nothing
Sylwester is offline
Reply



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 05:16.


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