Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RemoveIt(pl, cmd, arg)
- if TimerStatus == 1 then
- if pl.SpawnWait < CurTime() then
- if Props[arg[1]] then
- local tr = util.TraceLine(util.GetPlayerTrace(pl))
- local ent = ents.Create( "prop_physics" )
- if ( !ent:IsValid() ) then return end
- ent:SetModel(arg[1])
- ent:PhysicsInit( SOLID_VPHYSICS )
- ent:SetSolid( SOLID_VPHYSICS )
- ent:SetMoveType( MOVETYPE_VPHYSICS )
- local Raise = ent:OBBCenter():Distance(ent:OBBMins())
- ent:SetPos(tr.HitPos + Vector(0, 0, (Raise + 5)))
- ent:SetNetworkedEntity("Owner", pl)
- ent:SetNWInt("NAMEY", pl:Name())
- ent:Spawn()
- ent:Activate()
- ent:SetHealth(100000)
- ent:SetNWInt("PropHealth", Props[arg[1]].HEALTH)
- --local bone = ent:GetModelPhysBoneCount()
- local Bone = tr.PhysicsBone
- if pl:GetNWInt("Cash") >= Props[arg[1]].COST then -- If player cash is greater then the cost of the prop
- if pl:IsAdmin() -- If the player is an admin
- if pl:GetNWInt("Props") >= 30 then -- if he has reached the admin prop limit
- ent:Remove() --remove the prop
- pl:ChatPrint("You Have Hit the prop limit") --display this messege
- end
- else
- if pl:GetNWInt("VIP") >= 1 then -- If the player is a vip and an admin
- pl:SetNWInt("Cash", pl:GetNWInt("Cash") - math.Round(Props[arg[1]].COST * 0.75)) -- purchases the prop at a reduced cost
- pl:SetNWInt("Props", pl:GetNWInt("Props") + 1) -- add 1 to the prop count
- else
- pl:SetNWInt("Cash", pl:GetNWInt("Cash") - Props[arg[1]].COST) -- if the player is not a vip purchase at regular price
- pl:SetNWInt("Props", pl:GetNWInt("Props") + 1) -- add 1 to the prop count
- end
- else
- if pl:GetNWInt("Props") == 20 then -- if he has reached the regular player prop limit
- ent:Remove() --remove the prop if he is over the prop limit
- pl:ChatPrint("You Have Hit the prop limit") -- display messege
- end
- else
- if pl:GetNWInt("VIP") >= 1 then -- if the player is a vip
- pl:SetNWInt("Cash", pl:GetNWInt("Cash") - math.Round(Props[arg[1]].COST * 0.75)) -- purchase prop at a discounted price
- pl:SetNWInt("Props", pl:GetNWInt("Props") + 1) -- add 1 to prop count
- else
- pl:SetNWInt("Cash", pl:GetNWInt("Cash") - Props[arg[1]].COST) -- if regular player purchase at regular
- pl:SetNWInt("Props", pl:GetNWInt("Props") + 1) -- add 1 to prop count
- end
- else
- ent:Remove() -- remove the prop if does not have enough cash
- pl:ChatPrint("You don't have enough cash!") -- display if player does not have enough cash
- end
- end
- pl.SpawnWait = CurTime() + .2
- end
- end
- end
- end
- concommand.Add( "RemoveIt", RemoveIt )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement