I made a SWep and I can't spawn it :<
xx=WeaponName;
It should be like this:
[QUOTE]/garrysmod/garrysmod/lua/xx[/QUOTE]
Or this:
[QUOTE]/garrysmod/garrysmod/lua/weapons/xx[/QUOTE]
?
Second one.
#Now it's spawning.
Last question: Where I can find pathes to Sounds/Models? Thanks.
You can google a sound list for source games ro get GCFScape and look at the GCFs for the games.
since file.Size doesn't seem to work properly, is there any sort of module out there that can do the same exact thing?
[QUOTE=marvincmarvin;35179671]gm_hIO
[url]http://facepunch.com/threads/970999[/url][/QUOTE]
Thanks, but are there any working downloads (and a Linux version, forgot to mention that)?
[QUOTE=Banana Lord.;35179720]Thanks, but are there any working downloads (and a Linux version, forgot to mention that)?[/QUOTE]
I'm gonna look now.. I know python has this on his server..
Is there an actual guide to coding gamemodes for Garry's Mod 13 with the crazy silly content system
[QUOTE=The freeman;35180788]Is there an actual guide to coding gamemodes for Garry's Mod 13 with the crazy silly content system[/QUOTE]
[url]http://wiki.garrysmod.com/page/Gamemode_Creation[/url]
Probably the only thing actually on the new Wiki :v:
[QUOTE=ArmageddonScr;35178020]You can google a sound list for source games ro get GCFScape and look at the GCFs for the games.[/QUOTE]
Found sounds on GCFScape, but can't use them, even if I put path to them.
Any other suggestions for using sounds in SWep?
I thought this would work but it doesn't, thoughts? It's probably something really stupid no doubt.
[LUA]function ENT:OnTakeDamage(dmg)
self.damage = self.damage - dmg:GetDamage()
if (self.damage <= 0) then
self.Entity:Destruct()
self.Entity:Remove()
end
if ent:GetPhysicsAttacker():IsPlayer() then
Msg (..ent:GetPhysicsAttacker():Nick().." Destroyed a Gun Lab! \n")
end
end[/LUA]
if ent:GetPhysicsAttacker():IsPlayer() then
Msg (..ent:GetPhysicsAttacker():Nick().." Destroyed a Gun Lab! \n")
end
that bit in particular. It says ent is nil.
Because ent is nil. Use self.
edit: and shouldn't it be dmg:GetPhysicsAttacker() or will self:GetPhysicsAttacker() work?
[QUOTE=ArmageddonScr;35183009]Because ent is nil. Use self.
edit: and shouldn't it be dmg:GetPhysicsAttacker() or will self:GetPhysicsAttacker() work?[/QUOTE]
I think I tried dmg. I'll post my findings.
EDIT:
I tried this code but it just errored in the main.lua of darkrp as it normally does if something isn't written correctly.
[LUA]function ENT:OnTakeDamage(dmg)
self.damage = self.damage - dmg:GetDamage()
if (self.damage <= 0) then
self.Entity:Destruct()
self.Entity:Remove()
end
if self:GetPhysicsAttacker():IsPlayer() then
Msg(..self:GetPhysicsAttacker():Nick().." Destroyed a Gun Lab! \n")
end
end[/lua]
By taking out:
[LUA] if self:GetPhysicsAttacker():IsPlayer() then
Msg(..self:GetPhysicsAttacker():Nick().." Destroyed a Gun Lab! \n")
end[/LUA]
It loads as normal.
You don't need Msg(.., use Msg(
Hm well its not erroring now. But its not printing into the console when I destroy it either.
Just saying couldn't dispatch user message. Fuck annoying how something so simple doesn't work :\
Decided I should post this here as well, since it belongs here more than in the WAYWO thread, really. :v:
So, I got around that strange particle effect issue I had with the flames by just tossing them into the effect's think. Not ideal, but it worked.
However, I have the same issue with my laser effect now. [url=http://pastebin.com/kzhehDrm]Here's the pastebin[/url]. Furthermore, as is inherit with the render, when the beam's start is not within view of the client, the laser doesn't draw. Now, I realize I can just make another beam using the opposite points for start and end, but if neither point is visible, the beam still won't draw, which is an issue.
The "shove the render crap into think" solution doesn't work for this, though. It yells at me. :v:
Any suggestions?
How does ApplyForceOffset work? Does it take local or global coordinates?
Is there a difference, performance-wise between the two methods?
[lua]
--method 1
for k,v in pairs(player.GetAll()) do
if v:IsAdmin() then
umsg.Start("fuckyou",v)
umsg.End()
end
end
--method 2
local RP=RecipientFilter()
for k,v in pairs(player.GetAll()) do
if v:IsAdmin() then
RP:AddPlayer(v)
end
end
umsg.Start("fuckyou",RP)
umsg.End()
[/lua]
I'd assume method 2 is smarter, and I know the Wiki says that sending each message individually with the net library is bad.
I can't handle it. Tried another way to emite sounds for weapons, still nothing.
Maby there's someone who knows how add sound to SWep?
And another problem:
Tried to ent:SetAngles(), but I don't know how to put angles.
All time I got this:
[QUOTE][@lua\weapons\scorpionspear\shared.lua:133] bad argument #1 to 'SetAngles' (Angle expected, got number)
[[/QUOTE]
How would I go about dissolving an object? I am creating a no build spawn, and just need the ability to dissolve the props instead of just removing them.
Thank you :)
EDIT:
Figured it out myself, thanks anyway :)
Does anyone have a link to a list of collision groups and what they each do?
Rotated text anyone?
Didn't find any functions for it, although I thought there was one.
Would it be feasible to render text to a render target then draw a rotated textured quad? Or does it not have alpha.. hmm.
I made a thread about this, but no one responded yet, so i figured i'd put it here too.
[code]SWEP.ReloadTable = {}
SWEP.ReloadTable["CanEmptyReload"] = false
SWEP.ReloadTable["RemoveClip"] = {}
SWEP.ReloadTable["RemoveClip"].Time = 0.70
SWEP.ReloadTable["RemoveClip"].EmptyTime = 0
SWEP.ReloadTable["RemoveClip"].Cylinder = false
SWEP.ReloadTable["SetClip"] = {}
SWEP.ReloadTable["SetClip"].Time = 2.4
SWEP.ReloadTable["SetClip"].EmptyTime = 0
SWEP.CanFixReload = true
SWEP.SpecialCrossHair = false
SWEP.DryFireAnim = false
SWEP.UseSilencer = false
SWEP.CanIdle = true
SWEP.ViewAnim = true[/code]
The reload tables for a custom deagle model on Leeroy's swep base, but when i try to reload, the ammo count goes to 0, and i can keep reloading and nothing happens. Is this something i need to find in the base? or is a problem here?
Okay, I got this:
I re-made a SWep from Tutorial (that on Lua Wiki, "Your first scritped weapons", so you can check code) and now I got problem.
How Am I supouse to check When Spawned entity (chair) hitted the Gound or Player?
Everything there is in Shared.lua and Hook: ENT:PhysicsCollide is server side.
Can someone help me out or help me understand this?
[addons\evolve\lua\ev_plugins\sh_country.lua:16] attempt to perform arithmetic o
n local 'i' (a nil value)Dropped aLTeR from server (Disconnect by user.)
[CODE]
/*-------------------------------------------------------------------------------------------------------------------------
Country
-------------------------------------------------------------------------------------------------------------------------*/
local PLUGIN = {}
PLUGIN.Title = "Country"
PLUGIN.Description = "Displays the Country of the spawning Players."
PLUGIN.Author = "MrWireTuts"
PLUGIN.ChatCommand = nil
function PLUGIN:PlayerInitialSpawn( ply )
if not ply then return end
http.Get("http://www.ip2location.com/" .. string.Explode(":",ply:IPAddress())[1],"",function(contents,size)
if not contents then return end
local i = string.find(string.lower(contents), "lblicountry")
local country = string.sub(contents,i + 13)
country = string.Explode("<",country)[1]
country = string.sub(country,0,1) .. string.lower(string.sub(country,2))
evolve:Notify(evolve.colors.blue,ply:Nick(),evolve.colors.white," has connected from ",evolve.colors.red,country,evolve.colors.white,".")
end)
end
evolve:RegisterPlugin( PLUGIN )
[/CODE]
-snip-
[QUOTE=airidas338;35204532][addons\evolve\lua\ev_plugins\sh_country.lua:16] attempt to perform arithmetic o
n local 'i' (a nil value)Dropped aLTeR from server (Disconnect by user.)
-code-[/QUOTE]
Line 15:
[lua]local i = string.find(string.lower(contents), "lblicountry")[/lua]
"lblicountry" was not found in "contents". So string.find returns nil.
Sorry, you need to Log In to post a reply to this thread.