I tried converting this plugin from zp to normal
plugin is compiling but its not running can anyone tell me where am i doing mistake?
Code:
#include <amxmodx>
#include <fun>
#include <dhudmessage>
#define PLUGIN "[ZP] CSO"
#define VERSION "1.0"
#define AUTHOR "Shuri"
#define HEALTH 200
#define ARMOR 200
#define TEXT "%s is Selected as Hero"
#define MINPEOPLE 2
#define MAX_PLAYERS 32
new g_hero[33] , g_iMaxClients ;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_iMaxClients = get_maxplayers( );
}
public round_started(round)
{
if (get_playersnum() < MINPEOPLE )
return;
{
set_task(10.0,"make_hero")
}
}
public make_hero(id)
{
new id
static iPlayersNum
iPlayersNum = gAlive()
id = gRandomAlive(random_num(1, iPlayersNum))
g_hero[id] = true
set_user_health( id , get_user_health( id ) + HEALTH );
set_user_armor(id , get_user_armor( id ) + ARMOR );
new szName[ 32 ]
get_user_name( id, szName, 31 )
set_dhudmessage( 0, 255, 0, 0.05, 0.45, 1, 0.0, 5.0, 1.0, 1.0)
show_dhudmessage( 0, TEXT, szName )
}
gRandomAlive(n)
{
static Alive, id
Alive = 0
for (id = 1; id <= g_iMaxClients; id++)
{
if (Alive == n)
return id;
}
return -1;
}
gAlive()
{
static Alive, id
Alive = 0
for (id = 1; id <= g_iMaxClients; id++)
return Alive;
}
public round_ended()
{
static id;
for( id = 1; id <= g_iMaxClients; id++ )
{
if( !is_user_connected( id ) || !g_hero[ id ] )
continue;
g_hero[ id ] = false;
}
}
__________________