Thank you all for the answers.I dont wan't to post a new topic(becouse i will make to much spam) and i will ask my another question here.Can someone tell me why my noob code doesn't work
PHP Code:
#include <amxmodx>
#include <engine>
#include <cstrike>
#include <fakemeta>
#include <csx>
#include <colorchat>
public plugin_init()
{
register_plugin("C4 Anti-Camper","1.0","Apokalipsisa")
register_logevent("start",2,"1=Round_Start")
register_forward(FM_CmdStart,"fwd_FM_CmdStart_pre",0)
if(engfunc(EngFunc_FindEntityByString, -1, "classname","func_bomb_target") || engfunc(EngFunc_FindEntityByString, -1, "classname","info_bomb_target"))
{
register_event("StatusIcon", "event_bomb_pickup", "be", "1=1", "1=2", "2=c4")
register_event("TextMsg", "event_bomb_pickup", "bc", "2&#Got_bomb")
register_event("TextMsg", "event_bomb_dropped", "bc", "2&#Game_bomb_d")
}
else
{
pause("ad")
return
}
}
public event_bomb_pickup(id)
{
if(!is_user_alive(id)) return
if(cs_get_user_team(id) == CS_TEAM_T)
{
remove_task(id + 222)
set_task(1.0,"CheckMoving",id + 111 , _, _, "b")
}
}
public event_bomb_dropped()
{
new players[32],num, i,id
get_players(players,num)
for(i=0;i<num;i++)
{
id = players[i]
if(!is_user_alive(id)) return
remove_task(id + 111)
set_task(2.0,"BombPlant",id + 222 , _, _, "b")
}
}
public bomb_planted(id)
{
if(!is_user_alive(id)) return
remove_task(111)
if(cs_get_user_team(id) == CS_TEAM_CT)
{
set_task(1.0,"CheckMoving",id + 111 , _, _, "b")
}
}
public CheckMoving(id)
{
static iStillCounter[33]
static Float: fVelocity[3]
if(!is_user_alive(id)) return
pev(id,pev_velocity,fVelocity)
if(fVelocity[0] || fVelocity[1] || fVelocity[2])
{
iStillCounter[id] = 0
}
else
{
if (++iStillCounter[id] >= 5)
{
if(cs_get_user_team(id) == CS_TEAM_T)
{
ColorChat(id,GREEN,"PLANT C4!")
user_slap(id,0)
}
if(cs_get_user_team(id) == CS_TEAM_CT)
{
ColorChat(id,GREEN,"DEFUSE C4!")
user_slap(id,0)
}
}
}
}
public bomb_defusing(id)
{
new buttons = pev(id, pev_button)
new oldbuttons = pev(id, pev_oldbuttons)
if(buttons & IN_USE)
{
remove_task(id + 111)
}
if(oldbuttons & IN_USE && !(buttons & IN_USE))
{
set_task(1.0,"CheckMoving",id + 111 , _, _, "b")
}
if(buttons & IN_USE && !(oldbuttons & IN_USE))
{
ColorChat(id,GREEN,"test test test")
}
return FMRES_IGNORED
}
public start(id)
{
remove_task(id + 111)
}
public bomb_defused(id)
{
remove_task(id + 111)
}
public bomb_explode(id)
{
remove_task(id + 111)
}
public BombPlant(id)
{
if(!is_user_alive(id)) return
ColorChat(id,GREEN,"TAKE C4 AND PLANT!")
user_slap(id,0)
}
public bomb_planting(id)
{
new button;
button = pev(id, pev_button);
if (button & IN_ATTACK)
{
remove_task(id + 111)
}
else
{
set_task(1.0,"CheckMoving",id + 111 , _, _, "b")
}
}