Hi again

Finaly i created my new plugin. Life mode. Yep... it looks awfl. but it works !

Anyway what I wanna to do to is share with you guys and try to help me a little bit. Here is the code:
Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <colorchat>
#include <fakemeta_util>
#define PLUGIN "Life Mode"
#define VERSION "1.0"
#define AUTHOR "DataSource"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event( "DeathMsg", "lf_someone_death", "a")
register_event( "BombDrop", "lf_bomb_planted", "a")
register_event("CurWeapon", "CurWeapon","be", "1=1")
register_logevent("lf_bomb_plant", 3, "2=Planted_The_Bomb")
register_logevent("lf_round_end", 2, "1=Round_End")
register_logevent("lf_round_start", 2, "1=Round_Start")
set_task( 20.0, "lf_textmsg")
}
public lf_textmsg(id) {
ColorChat( 0, Color:RED, "^x04Plant or defuse the bomb to save your teammates and ^x03 yourself!")
set_task(300.0, "lf_textmsg", id)
}
public lf_round_end() {
new players[32], num, tid
get_players(players, num, "a")
for( new i = 0; i < num; i++ )
{
tid = players[i]
remove_task(tid)
}
}
public lf_round_start() {
if (fm_find_ent_by_class(-1, "weapon_c4") ) {
new players[32], num, tid
get_players(players, num, "a")
for( new i = 0; i < num; i++ )
{
tid = players[i]
if ( cs_get_user_team(tid) == CS_TEAM_T ) {
set_task(1.0, "lf_mode_start", tid, "", 0, "a", 100)
}
}
}
}
public lf_mode_start(tid) {
if( !is_user_alive(tid) ) {
remove_task(tid)
}
else {
new Health = get_user_health(tid)
set_user_health( tid, Health - 1)
}
}
public lf_someone_death() {
new iVictim = read_data( 2 )
remove_task(iVictim)
}
new planter
public lf_bomb_plant() {
new players[32], num, tid
get_players(players, num, "a")
for( new i = 0; i < num; i++ )
{
tid = players[i]
if ( cs_get_user_team( tid ) == CS_TEAM_T )
if ( planter == ( tid ) ) {
new t_health = get_user_health( tid )
set_user_health( tid, t_health + 20 )
} else {
new t_health = get_user_health( tid )
set_user_health( tid, t_health + 10 )
}
}
}
public CurWeapon(tid) {
if(read_data(2) == CSW_C4)
planter = tid
}
public lf_bomb_planted() {
new BombPlanted = read_data(4)
new players[32], num, tid
if ( BombPlanted == 1 ) {
get_players(players, num, "a")
for( new i = 0; i < num; i++ )
{
tid = players[i]
remove_task(tid)
}
set_task(1.0, "lf_bomb_defuse_time")
}
}
public lf_bomb_defuse_time(tid) {
new players[32], num, tid
get_players(players, num, "a")
for (new i = 0; i < num; i++ )
{
tid = players[i]
if ( cs_get_user_team(tid) == CS_TEAM_CT ) {
set_task(1.0, "lf_mode_start", tid, "", 0, "a", 100)
}
}
}
It doesn't look very good but problem is when someone connects 1-2s later and joinded the game the plugin doesn't work because it only checks at round start not when somebody connected... Any ideas?