Evenin' guys!
I was lookin' around this radar code, and I wondered on how I could make it only detect a certain model?
I tried somethings but I never managed to get something to work..
Btw the scanning thing is :
[CODE]radar.scanfor = {"blastfungus", "rpg_missile", "crossbow_bolt", "npc_", "sent_", "prop_vehicle_"} -- What should the radar look for? Accepts partial names.
radar.dangerous = {"sent_nuke_missile", "mort_nade", "player"} -- What should the radar consider extremely hazardous? ("Hazard Mode") Only accepts full names.
[/CODE]
What I want is to make it only get a certain model of prop_physics.
(I had tried things like on this : [url]http://wiki.garrysmod.com/?title=Entity.GetModel[/url] aswell as other things)
Thanks.
Edit: Also I have this swep that doesn't work, and I wondered what was wrong.
[CODE]function SWEP:PrimaryAttack()
if ( !self:CanPrimaryAttack() ) then return end
self.Weapon:SendWeaponAnim(ACT_SLAM_DETONATOR_DETONATE)
self.Weapon:Remove()
self.Weapon:EmitSound( self.Primary.Sound )
timer.Create( "Execute"..tostring(self.Weapon), 1, 1, function()
self:EmitSound( self.Primary.Sound )
end )
timer.Create( "Meanwhile"..tostring(self.Weapon), 30, 1, function()
self.Owner:SetJumpPower(240)
self.Owner:SetRunSpeed(450)
self.Owner:SetWalkSpeed(380)
end )
timer.Create( "Cooldown"..tostring(self.Weapon), 1, 1, function()
self.Owner:SetJumpPower(160)
self.Owner:SetRunSpeed(250)
self.Owner:SetWalkSpeed(250)
self:EmitSound( self.Primary.Sound )
end )
end[/CODE]
It's an adrenaline shot, supposed to give you a speed boost for 30 seconds. 5 seconds of slower walking afterward, then go back to normal.
@ Radar thingi, I dont think you can search for only one model, since in the example, it only tracks "types". Is 1 model you want to search for, or is it an entity?
It's a specific model.
But couldn't it work if we'd put something similar to this ?
local object = ents.FindByClass("prop_physics") & ent:GetModel() == "modelpathhere"
Then in the radar scanner just add , "object"
[QUOTE=WolvesSoulZ;21254494]It's a specific model.
But couldn't it work if we'd put something similar to this ?
local object = ents.FindByClass("prop_physics") & ent:GetModel() == "modelpathhere"
Then in the radar scanner just add , "object"[/QUOTE]
I guess you could do that, but just to get it correct, I think It's supposed to be
local object = ents.FindByClass(("prop_physics") & ent:GetModel() == (""))
Im unsure wether or not it's supposed to be 1 or 2 "&'s", but you'll figure it out, wont you? :)
[QUOTE=Busymonkey;21254652]I guess you could do that, but just to get it correct, I think It's supposed to be
local object = ents.FindByClass(("prop_physics") & ent:GetModel() == (""))
Im unsure wether or not it's supposed to be 1 or 2 "&'s", but you'll figure it out, wont you? :)[/QUOTE]
Yup. I'll get them tested once I'm done working on some maps.
After this I'll still need help for my adrenaline swep hehe
Sorry, you need to Log In to post a reply to this thread.