Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.38 KB | None | 0 0
  1.     new ent;
  2.  
  3.     if ((ent = CreateEntityByName("prop_physics_override")) != -1)
  4.     {
  5.         decl String:tmp[64];
  6.  
  7.         FormatEx(tmp, sizeof(tmp), "gift_%i", ent);
  8.  
  9.         DispatchKeyValue(ent, "model", sModel[2]);
  10.         DispatchKeyValue(ent, "physicsmode", "2");
  11.         DispatchKeyValue(ent, "massScale", "1.0");
  12.         DispatchKeyValue(ent, "targetname", tmp);
  13.         DispatchSpawn(ent);
  14.  
  15.         SetEntProp(ent, Prop_Send, "m_usSolidFlags", 8);
  16.         SetEntProp(ent, Prop_Send, "m_CollisionGroup", 1);
  17.        
  18.         TeleportEntity(ent, g_fPos[iClient], NULL_VECTOR, NULL_VECTOR);
  19.        
  20.         new rot = CreateEntityByName("func_rotating");
  21.         FormatEx(tmp, sizeof(tmp), "gift_rot_%i", rot);
  22.         DispatchKeyValueVector(rot, "origin", g_fPos[iClient]);
  23.         DispatchKeyValue(rot, "targetname", tmp);
  24.         DispatchKeyValue(rot, "maxspeed", "200");
  25.         DispatchKeyValue(rot, "friction", "0");
  26.         DispatchKeyValue(rot, "dmg", "0");
  27.         DispatchKeyValue(rot, "solid", "0");
  28.         DispatchKeyValue(rot, "spawnflags", "64");
  29.         DispatchSpawn(rot);
  30.        
  31.         Format(tmp, sizeof(tmp), "%s,Kill,,0,-1", tmp);
  32.         DispatchKeyValue(ent, "OnKilled", tmp);
  33.        
  34.         SetVariantString("!activator");
  35.         AcceptEntityInput(ent, "SetParent", rot, rot);
  36.        
  37.         new trigger = CreateEntityByName("trigger_multiple");
  38.         FormatEx(tmp, sizeof(tmp), "gift_trigger_%i", trigger);
  39.         DispatchKeyValueVector(trigger, "origin", g_fPos[iClient]);
  40.         DispatchKeyValue(trigger, "targetname", tmp);
  41.         DispatchKeyValue(trigger, "wait", "0");
  42.         DispatchKeyValue(trigger, "spawnflags", "64");
  43.         DispatchSpawn(trigger);
  44.        
  45.         Format(tmp, sizeof(tmp), "%s,Kill,,0,-1", tmp);
  46.         DispatchKeyValue(rot, "OnKilled", tmp);
  47.        
  48.         ActivateEntity(trigger);
  49.         SetEntProp(trigger, Prop_Data, "m_spawnflags", 64);
  50.         SetEntityModel(trigger, "models/items/car_battery01.mdl");
  51.        
  52.         float fMins[3], fMaxs[3];
  53.         GetEntPropVector(ent, Prop_Send, "m_vecMins", fMins);
  54.         GetEntPropVector(ent, Prop_Send, "m_vecMaxs", fMaxs);
  55.        
  56.         SetEntPropVector(trigger, Prop_Send, "m_vecMins", fMins);
  57.         SetEntPropVector(trigger, Prop_Send, "m_vecMaxs", fMaxs);
  58.         SetEntProp(trigger, Prop_Send, "m_nSolidType", 2);
  59.        
  60.         new iEffects = GetEntProp(trigger, Prop_Send, "m_fEffects");
  61.         iEffects |= 32;
  62.         SetEntProp(trigger, Prop_Send, "m_fEffects", iEffects);
  63.        
  64.         SetVariantString("!activator");
  65.         AcceptEntityInput(trigger, "SetParent", rot, rot);
  66.         AcceptEntityInput(rot, "Start");
  67.  
  68.         HookSingleEntityOutput(rot, "OnStartTouch", OnStartTouch);
  69.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement