Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new ent;
- if ((ent = CreateEntityByName("prop_physics_override")) != -1)
- {
- decl String:tmp[64];
- FormatEx(tmp, sizeof(tmp), "gift_%i", ent);
- DispatchKeyValue(ent, "model", sModel[2]);
- DispatchKeyValue(ent, "physicsmode", "2");
- DispatchKeyValue(ent, "massScale", "1.0");
- DispatchKeyValue(ent, "targetname", tmp);
- DispatchSpawn(ent);
- SetEntProp(ent, Prop_Send, "m_usSolidFlags", 8);
- SetEntProp(ent, Prop_Send, "m_CollisionGroup", 1);
- TeleportEntity(ent, g_fPos[iClient], NULL_VECTOR, NULL_VECTOR);
- new rot = CreateEntityByName("func_rotating");
- FormatEx(tmp, sizeof(tmp), "gift_rot_%i", rot);
- DispatchKeyValueVector(rot, "origin", g_fPos[iClient]);
- DispatchKeyValue(rot, "targetname", tmp);
- DispatchKeyValue(rot, "maxspeed", "200");
- DispatchKeyValue(rot, "friction", "0");
- DispatchKeyValue(rot, "dmg", "0");
- DispatchKeyValue(rot, "solid", "0");
- DispatchKeyValue(rot, "spawnflags", "64");
- DispatchSpawn(rot);
- Format(tmp, sizeof(tmp), "%s,Kill,,0,-1", tmp);
- DispatchKeyValue(ent, "OnKilled", tmp);
- SetVariantString("!activator");
- AcceptEntityInput(ent, "SetParent", rot, rot);
- new trigger = CreateEntityByName("trigger_multiple");
- FormatEx(tmp, sizeof(tmp), "gift_trigger_%i", trigger);
- DispatchKeyValueVector(trigger, "origin", g_fPos[iClient]);
- DispatchKeyValue(trigger, "targetname", tmp);
- DispatchKeyValue(trigger, "wait", "0");
- DispatchKeyValue(trigger, "spawnflags", "64");
- DispatchSpawn(trigger);
- Format(tmp, sizeof(tmp), "%s,Kill,,0,-1", tmp);
- DispatchKeyValue(rot, "OnKilled", tmp);
- ActivateEntity(trigger);
- SetEntProp(trigger, Prop_Data, "m_spawnflags", 64);
- SetEntityModel(trigger, "models/items/car_battery01.mdl");
- float fMins[3], fMaxs[3];
- GetEntPropVector(ent, Prop_Send, "m_vecMins", fMins);
- GetEntPropVector(ent, Prop_Send, "m_vecMaxs", fMaxs);
- SetEntPropVector(trigger, Prop_Send, "m_vecMins", fMins);
- SetEntPropVector(trigger, Prop_Send, "m_vecMaxs", fMaxs);
- SetEntProp(trigger, Prop_Send, "m_nSolidType", 2);
- new iEffects = GetEntProp(trigger, Prop_Send, "m_fEffects");
- iEffects |= 32;
- SetEntProp(trigger, Prop_Send, "m_fEffects", iEffects);
- SetVariantString("!activator");
- AcceptEntityInput(trigger, "SetParent", rot, rot);
- AcceptEntityInput(rot, "Start");
- HookSingleEntityOutput(rot, "OnStartTouch", OnStartTouch);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement