/* AMXMOD script.
*
* (c) Copyright 2000-2002, RAV
* This file is provided as is (no warranties).
*
*
* Required: ADMIN_LEVEL_A to use this command
*
* Changelog
*
* Version 1.1 - Initial Build
* Version 1.2 - Added random glow
* Version 1.3 - Added Sound on float.
*
* Command amx_float < part of nick >
*/

#include <amxmod>


public admin_float(id)
{
	if (!(get_user_flags(id)&ADMIN_LEVEL_A)){
		client_print(id,print_console,"[AMX] You have no access to that command")
		return PLUGIN_HANDLED
	}
	if (read_argc()<2) {
		client_print(id,print_console,"[AMX] Usage:  amx_float < part of nick >")
		return PLUGIN_HANDLED
	}
	new name[32]
	read_argv(1,name,32)
	new tofloat = find_player("b",name)
	if (tofloat)	{
		if (get_user_flags(tofloat)&ADMIN_IMMUNITY){
			client_print(id,print_console,"[AMX] The player has immunity")
			return PLUGIN_HANDLED
		}
		if (is_user_alive(tofloat)==0)	{
			client_print(id,print_console,"[AMX] Client ^"%s^" is already dead",name)
			return PLUGIN_HANDLED
		}
		new origin[3]
		new red = random_num(50,255)  
		new green = random_num(50,255)  
		new blue = random_num(50,255)  
		get_user_origin(tofloat, origin)
		get_user_name(tofloat, name , 32)
		origin[2] += 200
		set_user_origin(tofloat, origin)
		engclient_cmd(tofloat,"drop")
		engclient_cmd(tofloat,"drop")
		engclient_cmd(tofloat,"weapon_knife")
		set_user_rendering(tofloat,kRenderFxGlowShell,red,green,blue,kRenderNormal,16)
		set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
		show_hudmessage(0,"ADMIN has made %s float!",name)
		client_cmd(0,"spk misc/humiliation")
	}
	else {
		client_print(id,print_console,"[AMX] Client with that part of nick not found")
	}

	return PLUGIN_CONTINUE

}

public plugin_init()
{
	register_plugin("Admin FLOAT","1.3","Rav")
	register_clcmd("amx_float","admin_float",ADMIN_LEVEL_A,"amx_float < part of nick >")
	register_cvar("RVS_adminfloat", "1.3",FCVAR_SERVER)
	return PLUGIN_CONTINUE
	
}

