
/* AMX Mod script. 
* 
* (c) Copyright 2002, OLO 
* This file is provided as is (no warranties). 
* 
*/

#include <amxmod>

new bool:camp_checkme[33]
new camp_pos[33][3]

public checksniper(param[]){
	new origin[3], id = param[0]
	camp_checkme[id] = true
	get_user_origin(id,origin)
	if ( get_distance(origin,camp_pos[id]) > 300 ) return
	new clip, ammo, wpnid =	get_user_weapon(id,clip,ammo)
	new wpnname[32], name[32]
	get_user_name(id,name,31)
	get_weaponname(wpnid,wpnname,31)
	set_hudmessage(200, 100, 0, 0.05, 0.55, 0, 6.0, 7.0, 0.5, 0.15, 1)
	show_hudmessage(0,"Psss... Be careful...^n%s is camping with %s (%d/%d)",name,wpnname[7],clip,ammo)
}

public startchecking(id){
	if ( !camp_checkme[id] ) return
	camp_checkme[id] = false
	new param[2]
	param[0] = id
	get_user_origin(id,camp_pos[id])
	set_task(8.0,"checksniper",id,param,1)
}

public removechecking(id){
	camp_checkme[id] = true
	remove_task(id)
}

public client_connect(id){
	camp_checkme[id] = true
	return PLUGIN_CONTINUE
}

public plugin_init() {
	register_plugin("Camper Detector","0.1","default")
	register_event("SetFOV","startchecking","be","1<50")
	register_event("SetFOV","removechecking","be","1=90")
	return PLUGIN_CONTINUE
} 

