Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2010
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. AddCSLuaFile( "cl_init.lua" )
  2. AddCSLuaFile( "shared.lua" )
  3.  
  4. include('shared.lua')
  5.  
  6. function ENT:Initialize()
  7.     self.Entity:PhysicsInit( SOLID_VPHYSICS )      
  8.     self.Entity:SetMoveType( MOVETYPE_VPHYSICS )  
  9.     self.Entity:SetSolid( SOLID_VPHYSICS )        
  10.  
  11.     self.Entity:SetModel( "models/cloudstrifexiii/football/football.mdl" )
  12. end
  13.    
  14.         local phys = self.Entity:GetPhysicsObject()
  15.     if phys:IsValid() then
  16.         phys:Wake()
  17.     end
  18.  
  19.  
  20. function ENT:PhysicsCollide( data, phys )
  21.     local ply = data.HitEntity;
  22.  
  23.     if ply and ply:IsValid() and ply:IsPlayer() then
  24.         if ply:HasWeapon("weapon_football") then
  25.                 ply:GiveAmmo(1,"grenades");
  26.         else
  27.                 ply:Give("weapon_football")
  28.         end
  29.     end
  30. end
  31.  
  32. function ENT:SetPlayer( ply )
  33.     self.player = ply
  34. end
  35.  
  36. function ENT:GetPlayer( ply )
  37.     return self.player
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement