daily pastebin goal
22%
SHARE
TWEET

Mapadd Lua

SirMasters Jan 13th, 2013 15 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function SpawnItem(item,amount)
  2.         local   pos = HL2.GetAbsOrigin(HL2.GetPlayer())
  3.         local   ang = HL2.GetAbsAngles(HL2.GetPlayer())
  4.         local   Cash = HL2.GetMoney()
  5.         if Cash >= amount then
  6.                 local SpawnItem = HL2.CreateEntity ( item, pos, ang )
  7.                 HL2.SpawnEntity(SpawnItem)
  8.                 HL2.SetMoney(Cash - amount)
  9.                 HL2.PlaySoundEntity ( "Player.Buy_weapon", HL2.GetPlayer() )
  10.                 print( "Dev: " .. item .. " was bought!")
  11.                 do return end
  12.         end
  13.  
  14. end
  15.  
  16.  
  17. function LoadedGame()
  18.         spawn_shotgun(true)
  19. end
  20.  
  21. function spawn_shotgun(FirstLoad)
  22.         local Shotgun_buy = HL2.CreateEntity( "prop_physics_override", HL2.Vector (-817.3, -446.3, 97.9), HL2.VectorAngles( HL2.Vector (-42, 2, 353)) )                
  23.         HL2.KeyValue( Shotgun_buy, "model", "models/weapons/w_shotgun.mdl" )
  24.         HL2.KeyValue( Shotgun_buy, "targetname", "Shotgun_buy" )
  25.         HL2.KeyValue( Shotgun_buy, "OnPlayerUse", "Shotgun_buy,kill,,.1,-1" )
  26.         HL2.KeyValue( Shotgun_buy, "spawnflags", "264")
  27.         HL2.SpawnEntity (Shotgun_buy)
  28.         if not FirstLoad then
  29.                 SpawnItem("weapon_shotgun",100)
  30.         else
  31.         end
  32. end
  33. --[[
  34. function spawn_rifle(FirstLoad)
  35.         local Shotgun_buy = HL2.CreateEntity( "prop_physics_override", HL2.Vector (-817.3, -446.3, 97.9), HL2.VectorAngles( HL2.Vector (-42, 2, 353)) )                
  36.         HL2.KeyValue( Shotgun_buy, "model", "models/weapons/w_shotgun.mdl" )
  37.         HL2.KeyValue( Shotgun_buy, "targetname", "Shotgun_buy" )
  38.         HL2.KeyValue( Shotgun_buy, "OnPlayerUse", "Shotgun_buy,kill,,.1,-1" )
  39.         HL2.KeyValue( Shotgun_buy, "spawnflags", "264")
  40.         HL2.SpawnEntity (Shotgun_buy)
  41.         if not FirstLoad then
  42.                 SpawnItem("weapon_shotgun",100)
  43.         else
  44.         end
  45. end
  46. --]]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top