Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SpawnItem(item,amount)
- local pos = HL2.GetAbsOrigin(HL2.GetPlayer())
- local ang = HL2.GetAbsAngles(HL2.GetPlayer())
- local Cash = HL2.GetMoney()
- if Cash >= amount then
- local SpawnItem = HL2.CreateEntity ( item, pos, ang )
- HL2.SpawnEntity(SpawnItem)
- HL2.SetMoney(Cash - amount)
- HL2.PlaySoundEntity ( "Player.Buy_weapon", HL2.GetPlayer() )
- print( "Dev: " .. item .. " was bought!")
- do return end
- end
- end
- function LoadedGame()
- spawn_shotgun(true)
- end
- function spawn_shotgun(FirstLoad)
- local Shotgun_buy = HL2.CreateEntity( "prop_physics_override", HL2.Vector (-817.3, -446.3, 97.9), HL2.VectorAngles( HL2.Vector (-42, 2, 353)) )
- HL2.KeyValue( Shotgun_buy, "model", "models/weapons/w_shotgun.mdl" )
- HL2.KeyValue( Shotgun_buy, "targetname", "Shotgun_buy" )
- HL2.KeyValue( Shotgun_buy, "OnPlayerUse", "Shotgun_buy,kill,,.1,-1" )
- HL2.KeyValue( Shotgun_buy, "spawnflags", "264")
- HL2.SpawnEntity (Shotgun_buy)
- if not FirstLoad then
- SpawnItem("weapon_shotgun",100)
- else
- end
- end
- --[[
- function spawn_rifle(FirstLoad)
- local Shotgun_buy = HL2.CreateEntity( "prop_physics_override", HL2.Vector (-817.3, -446.3, 97.9), HL2.VectorAngles( HL2.Vector (-42, 2, 353)) )
- HL2.KeyValue( Shotgun_buy, "model", "models/weapons/w_shotgun.mdl" )
- HL2.KeyValue( Shotgun_buy, "targetname", "Shotgun_buy" )
- HL2.KeyValue( Shotgun_buy, "OnPlayerUse", "Shotgun_buy,kill,,.1,-1" )
- HL2.KeyValue( Shotgun_buy, "spawnflags", "264")
- HL2.SpawnEntity (Shotgun_buy)
- if not FirstLoad then
- SpawnItem("weapon_shotgun",100)
- else
- end
- end
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement