/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

/*Thanks to:
v3x for some scripting stuff, and fixed ResetHUD + weapon_pickup functions.
GHW_Chronic for looking at my plugin, editing it, being all around sexy, and adding in
the de-girlified line - SO FUNNY, TY!.

Description: This plugin allows an admin to strip a users weapon. The player's model
changes to a female with less clothes than before (not pornographic - sorry :P)
The player's name also appears as an HUD message to everyone which states whatever you want.
Default is: "(Player) had his weapons... and his clothes stolen!". See line to edit if desired.

					Changelog
				1.01 - Original Coding
				1.02 - Fixed Strip Coding
				1.03 - Added Model Coding
				1.04 - Fixed Name Coding
				1.05 - Fixed Model Coding
				1.06 - Added Weapon_Pickup Function
				1.07 - Added Description
				1.08 - Added unstrip command, removed weapon_pickup function.
				1.09 - Readded weapon_pickup function.
				1.10 - Added ResetHUD function.
				1.11 - Version edited, added find_ent_by_model command.
				1.12 - Find_ent_by_model command removed - coding edited.
				1.13 - Working version!! :)*/

new girl[] = "models/player/girl/girl.mdl"
new g_User[32]
new bool:g_Strip[33];
new g_Target
new g_Name[33]

public plugin_precache()
{
	precache_model(girl);
}
//-------------------------------------------------------------------------
public plugin_init()
{
	register_plugin("amx_strip", "1.12", "SatanWoJ")
	register_clcmd("amx_strip", "strip", ADMIN_SLAY, "<nick>")
	register_clcmd("amx_unstrip", "unstrip", ADMIN_SLAY, "<nick>")
	register_event("WeapPickup", "weapon_pickup", "b")
	register_event("ResetHUD", "newround", "b")
}
//-------------------------------------------------------------------------
public strip(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2)) 
	{
		return PLUGIN_HANDLED
	}
	read_argv(1, g_User, 31)	
	g_Target = cmd_target(id, g_User, 3);
	if(!g_Target) 
	{
		return PLUGIN_HANDLED;
	}		
	get_user_name(g_Target, g_Name, 32)
	if(!g_Strip[g_Target]) 
	{
		strip_user_weapons(g_Target); 
		set_hudmessage(255, 1, 1, -1.0, -1.0, 0, 6.0, 12.0, 0.1, 0.2, 4); 
		show_hudmessage(id, "%s had his weapons... and his clothes stolen!", g_Name); //Edit the text on this line in "" if you want
		cs_set_user_model(g_Target, "girl");  
		cs_set_user_money(g_Target, 0)	
		g_Strip[g_Target] = true;
		console_print(id,"%s has been turned into a girl.", g_Name)
		return PLUGIN_CONTINUE
	}
	console_print(id, "%s is already stripped.", g_Name)
	return PLUGIN_HANDLED
}  
//-------------------------------------------------------------------------
public unstrip(id, level, cid)
{	
	if(!cmd_access(id, level, cid, 2)) 
	{
		return PLUGIN_HANDLED;
	}
	read_argv(1, g_User, 31) 
	g_Target = cmd_target(id, g_User, 3)	
	if(!g_Target) 
	{
		return PLUGIN_HANDLED;
	}
	get_user_name(g_Target, g_Name, 32) 
	if(g_Strip[g_Target])
	{		
		cs_reset_user_model(g_Target)
		give_item(g_Target, "weapon_knife")
		set_hudmessage(255, 1, 1, -1.0, -1.0, 0, 6.0, 12.0, 0.1, 0.2, 4) 
		show_hudmessage(id, "%s Is now de-girlified!!! RUN!", g_Name) 
	}
	console_print(id,"%s is not stripped.", g_Name) 
	return PLUGIN_HANDLED
}
//--------------------------------------------------------------------------
public client_connect(id) 
{ 
	g_Strip[id] = false; 
}
//--------------------------------------------------------------------------
public weapon_pickup(id) 
{ 
	if(g_Strip[id]) 
	{ 
		set_task(0.1, "stuff", id)
	} 
	return PLUGIN_CONTINUE 
}  
//--------------------------------------------------------------------------
public newround(id) 
{ 
	if(g_Strip[id]) 
	{ 
		set_task(0.1, "stuff", id)
	} 
	return PLUGIN_CONTINUE 
} 
//--------------------------------------------------------------------------
public stuff(id)
{
	cs_set_user_money(id, 0)
	strip_user_weapons(id) 
}
