Hey, I've made a code that should select a player every round from both teams, and give them +hp +ap +speed, but it doesn't work.
here is my code:
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#define PLUGIN "Round boss"
#define VERSION "1.0"
#define AUTHOR "addinol"
new Boss:PlayerMode[33];
new hp, ap, bspeed
enum Boss
{
boss = 1
}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawnPost", 1 );
hp = register_cvar("inch_bosshp","200")
ap = register_cvar("inch_bossap","200")
bspeed = register_cvar("inch_bosssp","30.0")
register_event("CurWeapon", "Event_CurWeapon", "be","1=1");
}
public FwdHamPlayerSpawnPost(id)
{
if(cs_get_user_team(id) == CS_TEAM_T){
PlayerMode[id] = Boss:random( 1 );
}else if(cs_get_user_team(id) == CS_TEAM_CT){
PlayerMode[id] = Boss:random( 1 );
}
if(PlayerMode[id] == Boss)
{
client_print(id, print_chat, "This round you will be the chosen one")
if(get_pcvar_num(hp) != 0){
set_user_health(id , get_pcvar_num(hp));
}else{
}
if(get_pcvar_num(ap) != 0){
set_user_armor(id , get_pcvar_num(ap));
}else{
}
}
}
public Event_CurWeapon(id)
{
if(PlayerMode[id] == Boss)
{
if(get_pcvar_float(bspeed) != 0){
new Float:speed = get_user_maxspeed(id) + get_pcvar_float(bspeed);
set_user_maxspeed(id , speed);
}else{
}
}
}
Where the hell is problem ?