• Help with EMP Tazer
    2 replies, posted
Hello Guys nd Gurlz ! I have a problem with the EMP, its not unfreezing the car after 10 seconds, if would be really thankfull when someone could help me. [CODE]if ( SERVER ) then AddCSLuaFile( "shared.lua" ) SWEP.Weight = 5 SWEP.AutoSwitchTo = true SWEP.AutoSwitchFrom = true SWEP.HoldType = "pistol" end if ( CLIENT ) then SWEP.PrintName = "EMP"; SWEP.Slot = 3; SWEP.SlotPos = 1; SWEP.DrawAmmo = true; SWEP.DrawCrosshair = true; end SWEP.Author = "Pennerlord"; SWEP.Contact = ""; SWEP.Purpose = "Paralyzing Cars"; SWEP.Instructions = "Left click to paralyze a car!"; SWEP.Spawnable = false SWEP.AdminSpawnable = true SWEP.ViewModel = "models/weapons/v_pistol.mdl" SWEP.WorldModel = "models/weapons/w_pistol.mdl" SWEP.Primary.ClipSize = 1 SWEP.Primary.DefaultClip = 10 SWEP.Primary.Automatic = false SWEP.Primary.Ammo = "357" SWEP.Secondary.ClipSize = -1 SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "" function SWEP:Reload() self.Weapon:DefaultReload( ACT_VM_RELOAD ) end function SWEP:PrimaryAttack() if ( !self:CanPrimaryAttack() ) then return end local eyetrace = self.Owner:GetEyeTrace(); if !eyetrace.Entity:IsVehicle() then return end local Dist = (self:GetPos() - eyetrace.Entity:GetPos()):Length() if (Dist > 300) then return end self.Weapon:EmitSound("Weapon_StunStick.Activate") self.BaseClass.ShootEffects( self ) self:TakePrimaryAmmo(1) if (!SERVER) then return end if eyetrace.Entity:IsVehicle() then self.Owner:PrintMessage( HUD_PRINTCENTER, "Car is paralyzed now!") self:taseVehicle(eyetrace.Entity) end end function SWEP:taseVehicle(eyetrace) eyetrace:SetColor(0,0,255,255) eyetrace:Fire("TurnOff", "1", 0) eyetrace:Fire("HandBrakeOn", "1", 0) timer.Create("timer1", 10, 1, self.retrieve, self, eyetrace) end function SWEP:retrieve(eyetrace) eyetrace:SetColor(255,255,255,255) eyetrace:Fire("TurnOn", "1", 0) eyetrace:Fire("HandBrakeOff", "1", 0) end[/CODE]
The timer is in the wrong format. YOu have to use the gmod 13 version. [url]http://wiki.garrysmod.com/page/timer/Create[/url] Also, this is the wrong section.
Like that ? Code deleted.
Sorry, you need to Log In to post a reply to this thread.