BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
|
05-09-2011
, 06:22
Re: [Tutorial] Creating brush entities
|
#43
|
I created Func_button
PHP Code:
new entindex = CreateEntityByName("func_button");
PrecacheModel("models/props/cs_office/vending_machine.mdl", true);
if (entindex != -1)
{
DispatchKeyValue(entindex, "pushdir", "0 90 0");
DispatchKeyValue(entindex, "speed", "500");
DispatchKeyValue(entindex, "spawnflags", "64");
DispatchKeyValue(entindex, "OnPressed", "!self,Use,,-1,-1");
DispatchKeyValue(entindex, "Press", "!self,Kill,,-1,-1");
DispatchKeyValue(entindex, "OnPressed", "!self,Kill,,-1,-1");
DispatchKeyValue(entindex, "OnIn", "!self,Kill,,-1,-1");
DispatchKeyValue(entindex, "OnOut", "!self,Kill,,-1,-1");
DispatchKeyValue(entindex, "OnPlayerUse", "!self,Kill,,-1,-1");
HookSingleEntityOutput(entindex, "OnPressed", buttUse, true);
}
DispatchSpawn(entindex);
ActivateEntity(entindex);
TeleportEntity(entindex, end, normal, NULL_VECTOR);
SetEntityModel(entindex, "models/props/cs_office/vending_machine.mdl");
new Float:minbounds[3] = {-100.0, -100.0, 0.0};
new Float:maxbounds[3] = {100.0, 100.0, 200.0};
SetEntPropVector(entindex, Prop_Send, "m_vecMins", minbounds);
SetEntPropVector(entindex, Prop_Send, "m_vecMaxs", maxbounds);
SetEntProp(entindex, Prop_Send, "m_nSolidType", 2);
new enteffects = GetEntProp(entindex, Prop_Send, "m_fEffects");
enteffects |= 32;
SetEntProp(entindex, Prop_Send, "m_fEffects", enteffects);
But OnPressed, OnIn, OnPlayerUse does not work, why can this be?
|
|