View Single Post
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 08-21-2004 , 20:59  
Reply With Quote #4

You should add support for spawning TS weapons.

Code:
//This will create a weapon and force the person the command is force_used on to force_use it.
public CmdWeaponGive(id) { 
	new buffer[33]
	read_argv(1,buffer,32)
	new target = cmd_target(id,buffer,0)
	new SendThis[33]
	new ent = create_entity("ts_groundweapon")
	read_argv(2,SendThis,32)
	DispatchKeyValue(ent, "tsweaponid", SendThis)
	DispatchKeyValue(ent, "wduration", "1")
	read_argv(3,SendThis,32)
	DispatchKeyValue(ent, "wextraclip", SendThis)
	read_argv(4,SendThis,32)
	DispatchKeyValue(ent, "spawnflags", SendThis)
	DispatchSpawn(ent)
	force_use(target,ent)
	return PLUGIN_HANDLED 
} 

//This will create a weapon at the force_users feet.
public CmdWeaponCreate(id) { 
  
	new buffer[33]
	read_argv(1,buffer,32)
	new SendThis[33]
	new ent = create_entity("ts_groundweapon")
	read_argv(2,SendThis,32)
	DispatchKeyValue(ent, "tsweaponid", SendThis)
	DispatchKeyValue(ent, "wduration", "1")
	read_argv(3,SendThis,32)
	DispatchKeyValue(ent, "wextraclip", SendThis)
	read_argv(4,SendThis,32)
	DispatchKeyValue(ent, "spawnflags", SendThis)
	DispatchSpawn(ent)
	new Float:fNewOrigin[3]
	entity_get_vector(id, EV_VEC_origin, fNewOrigin)
	entity_set_origin(ent, fNewOrigin)

	return PLUGIN_HANDLED  
}
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka