[QUOTE=Lexic;37251632]No. But for the hell of it, I just made one for you.[/QUOTE]
I'll give it a shot thanks!
How can I skip frames in a weapon animation?
EDIT: on a view model.
Is there anyway to disable tooltips on a spawnicon?
[QUOTE=jrj996;37254385]Is there anyway to disable tooltips on a spawnicon?[/QUOTE]
Make your own SpawnIcon derma object (get the code from vgui/SpawnIcon.lua) then remove this:
[LUA]
if ( iSkin && iSkin > 0 ) then
self:SetToolTip( Format( "%s (Skin %i)", mdl, iSkin+1 ) )
else
self:SetToolTip( Format( "%s", mdl ) )
end
[/LUA]
[QUOTE=jrj996;37254385]Is there anyway to disable tooltips on a spawnicon?[/QUOTE]
I think you can also do it by setting it to nil, "", or false - I can't remember which
Thanks guys!
Okay one more question
[quote][img]http://cloud-2.steampowered.com/ugc/541809953954108570/E4F07B73500BEBD0A16966CA439819D52C20E443/1024x576.resizedimage[/img][/quote]
Is there anyway to have the camera focus on the prop without that type of shit happening?
Hey guys, sorry to ask so many questions lol (im still learning) and this thread is awesome because there isn't much help anywhere else :). Im trying to make a command for the gamemode gofish2. The command would allow me to give other players money rather than just myself.
.
This is what I have so far.
[lua]
concommand.Add("gfc_givecash", function(ply, args)
if ply:IsAdmin() then
if args[2] then
local p = args[1]
local num = args[2]
p:SetNetworkedInt("cash", p:GetNetworkedInt("cash") + num)
umsg.Start("MoneyChanged", p)
umsg.Short(p:GetNetworkedInt("cash"))
umsg.End()
else
Msg("Insufficient amount of arguments! gfc_givecash 'name' 'amount'")
end
//end
end)
[/lua]
and This is what the old lua code is.
[lua]
function givecash(ply)
if ply:IsAdmin() then
ply:SetNetworkedInt("cash", ply:GetNetworkedInt("cash") + 500)
umsg.Start("MoneyChanged",ply)
umsg.Short(ply:GetNetworkedInt("cash"))
umsg.End()
end
end
concommand.Add("givecash", givecash)
[/lua]
The error the console is spitting back at me is Lua Error: [@gamemodes\gofish2\gamemode\init.lua:40] bad key to string index (number expected, got string) and note this is happening to my script, not the original.
I am not sure on how to fix this one, or even if im doing it right at that matter. If anyone knows a way/has a better way please tell :). Btw Line 40 is the "p:SetNetworkedInt("cash", p:GetNetworkedInt("cash") + num)" part of the code. Thanks!
[editline]16th August 2012[/editline]
[QUOTE=ralle105;37246637]I would help but the line numbers get fucked up when they reach the hundreds
garry![/QUOTE]
Thats ok, The addon creator said he is updating it to work with Gmod13 :) I can wait.
I've been told GM13 won't have a GM gamemode table. What's the method of doing that sort of thing now?
[QUOTE=Undefined;37261291][LUA]
p:SetNetworkedInt("cash", p:GetNetworkedInt("cash", 0) + tonumber(num))
[/LUA][/QUOTE]
Gives the same error back out.
[code]Lua Error: [@gamemodes\gofish2\gamemode\init.lua:40] bad key to string index (number expected, got string)[/code]
[QUOTE=BorisJ;37261727]I've been told GM13 won't have a GM gamemode table. What's the method of doing that sort of thing now?[/QUOTE]
Um it appears to work for me :v:
[QUOTE=jrj996;37262320]Um it appears to work for me :v:[/QUOTE]
I haven't tested anything myself - just I was told and was worried I'd have to do a lot of work to make several gamemodes work after the update.
[QUOTE=BorisJ;37261727]I've been told GM13 won't have a GM gamemode table. What's the method of doing that sort of thing now?[/QUOTE]
I'd also like to know the answer to this; sandbox inside the gcf still uses the GM table, so I'm not really sure what to do. The gamemode that I already fixed for GM13 broke due to this :v:
Is anyone else having troubles with the net library?
[lua]
if SERVER then
util.AddNetworkString "test"
hook.Add("PlayerSay", "test", function(ply)
net.Start "test"
net.WriteString "rawr"
net.Send(ply)
end)
end
if CLIENT then
net.Receive("test", function()
chat.AddText(net.ReadString())
end)
end
[/lua]
Am I doing something wrong here?
[QUOTE=marvincmarvin;37263354]Is anyone else having troubles with the net library?
[lua]
if SERVER then
util.AddNetworkString "test"
hook.Add("PlayerSay", "test", function(ply)
net.Start "test"
net.WriteString "rawr"
net.Send(ply)
end)
end
if CLIENT then
net.Receive("test", function()
chat.AddText(net.ReadString())
end)
end
[/lua]
Am I doing something wrong here?[/QUOTE]
It takes a little while before you can send anything after precaching the message.
[QUOTE=Chessnut;37263676]It takes a little while before you can send anything after precaching the message.[/QUOTE]
How long? I had the server up for 15 minutes or so before I tested this..
*deleted*
Good lord that's badly coded.
After getting rid of all the stupid C things, I get this
[code]$ luac -p idiot.lua
luac: idiot.lua:135: unexpected symbol near ','[/code]
so I'm not entirely sure how you even manged to get it into the game let alone find out it doesn't set things on fire.
[lua]timer.Simple(Distance/1520, function() Ignite(), trace(), end)[/lua] isn't even slightly valid code.
For your comfort and convenience I have spent slightly longer than I should have running your terrible mess through a battery of regular expressions to clean it up and then shoving the entire thing into a reformatter and hoping for the best.
[lua]SWEP.Author = "SiSadmin"
SWEP.Contact = "steamcommunity.com/id/SiSadmin"
SWEP.Purpose = "Set stuff on fire"
SWEP.Instructions = "Left-Click: Fire\nReload: Regenerate Ammo"
SWEP.Spawnable = false
SWEP.AdminSpawnable = true
SWEP.ViewModel = "models/weapons/v_physcannon.mdl"
SWEP.WorldModel = "models/weapons/w_physics.mdl"
--SWEP.ViewModel = "models/weapons/v_superphyscannon.mdl"
--SWEP.WorldModel = "models/weapons/w_superphyscannon.mdl"
SWEP.HoldType = "smg1"
SWEP.Primary.Automatic = true
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Ammo = "none"
SWEP.Secondary.ClipSize = 75
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = true
SWEP.Secondary.Ammo = "ar2"
SWEP.HoldType = "smg"
SWEP.ReloadDelay = 0
local Ignite = function(trace,self)
local flame = ents.Create("point_hurt")
flame:SetPos(trace.HitPos)
flame:SetOwner(self.Owner)
flame:SetKeyValue("DamageRadius",128)
flame:SetKeyValue("Damage",4)
flame:SetKeyValue("DamageDelay",0.32)
flame:SetKeyValue("DamageType",8)
flame:Spawn()
flame:Fire("TurnOn","",0)
flame:Fire("kill","",0.72)
if trace.HitWorld then
local ents = ents.FindInSphere(trace.HitPos, 100)
for _, stuff in pairs(ents) do
if stuff ~= self.Owner then
if stuff:GetPhysicsObject():IsValid() and not stuff:IsNPC() and not stuff:IsPlayer() then
if not stuff:IsOnFire() then
stuff:Ignite(math.random(16,32), 100)
end
end
if stuff:IsPlayer() then
if stuff:GetPhysicsObject():IsValid() then
stuff:Ignite(1, 100)
end
end
if stuff:IsNPC() then
if stuff:GetPhysicsObject():IsValid() then
local npc = stuff:GetClass()
if npc == "npc_antlionguard" or npc == "npc_hunter" or npc == "npc_kleiner"
or npc == "npc_gman" or npc == "npc_eli" or npc == "npc_alyx"
or npc == "npc_mossman" or npc == "npc_breen" or npc == "npc_monk"
or npc == "npc_vortigaunt" or npc == "npc_citizen" or npc == "npc_rebel"
or npc == "npc_barney" or npc == "npc_magnusson" then
stuff:Fire("Ignite","",1)
end
stuff:Ignite(math.random(12,16), 100)
end
end
end
end
end
if trace.Entity:IsValid() then
if trace.Entity:GetPhysicsObject():IsValid() and not trace.Entity:IsNPC() and not trace.Entity:IsPlayer() then
if not trace.Entity:IsOnFire() then
trace.Entity:Ignite(math.random(16,32), 100)
end
end
if trace.Entity:IsPlayer() then
if trace.Entity:GetPhysicsObject():IsValid() then
trace.Entity:Ignite(math.random(1,2), 100)
end
end
if trace.Entity:IsNPC() then
if trace.Entity:GetPhysicsObject():IsValid() then
local npc = trace.Entity:GetClass()
if npc == "npc_antlionguard" or npc == "npc_hunter" or npc == "npc_kleiner"
or npc == "npc_gman" or npc == "npc_eli" or npc == "npc_alyx"
or npc == "npc_mossman" or npc == "npc_breen" or npc == "npc_monk"
or npc == "npc_vortigaunt" or npc == "npc_citizen" or npc == "npc_rebel"
or npc == "npc_barney" or npc == "npc_magnusson" then
trace.Entity:Fire("Ignite","",1)
end
trace.Entity:Ignite(math.random(12,16), 100)
end
end
end
if (SERVER) then
local firefx = EffectData()
firefx:SetOrigin(trace.HitPos)
util.Effect("swep_flamethrower_explosion",firefx,true,true)
end
end
function SWEP:Precache()
util.PrecacheSound("ambient/machines/keyboard2_clicks.wav")
util.PrecacheSound("ambient/machines/thumper_dust.wav")
util.PrecacheSound("ambient/fire/mtov_flame2.wav")
util.PrecacheSound("vehicles/tank_readyfire1.wav")
end
function SWEP:PrimaryAttack()
if (SERVER) then
if (self.Owner:GetAmmoCount("ar2") < 1) or (self.ReloadDelay == 1) then
self:RunoutReload()
return
end
end
if (self.Owner:GetAmmoCount("ar2") > 0) and (self.ReloadDelay == 0) then
self.Owner:RemoveAmmo( 1, self.Weapon:GetSecondaryAmmoType() )
self.Owner:MuzzleFlash()
self.Weapon:SetNextPrimaryFire( CurTime() + 0.08 )
if (SERVER) then
local trace = self.Owner:GetEyeTrace()
local Distance = self.Owner:GetPos():Distance(trace.HitPos)
if Distance < 520 then
timer.Simple(Distance/1520, function() Ignite() trace() end)
end
end
end
end
function SWEP:SecondaryAttack()
end
function SWEP:Deploy()
self.Weapon:SendWeaponAnim(ACT_VM_DRAW)
if (SERVER) then
self.Owner:EmitSound( "ambient/machines/keyboard2_clicks.wav", 42, 100 )
end
return true
end
function SWEP:Think()
if self.Owner:KeyReleased(IN_ATTACK) and (self.Owner:GetAmmoCount("ar2") > 1) and (self.ReloadDelay ~= 1) then
if (SERVER) then
self.Owner:EmitSound( "ambient/fire/mtov_flame2.wav", 24, 100 )
end
end
if (self.Owner:GetAmmoCount("ar2") > 0) and (self.ReloadDelay == 0) then
if self.Owner:KeyPressed(IN_ATTACK) then
if (SERVER) then
self.Owner:EmitSound( "ambient/machines/thumper_dust.wav", 46, 100 )
end
end
if self.Owner:KeyDown(IN_ATTACK) then
if (SERVER) then
self.Owner:EmitSound( "ambient/fire/mtov_flame2.wav", math.random(27,35), math.random(32,152) )
end
local trace = self.Owner:GetEyeTrace()
if (SERVER) then
local flamefx = EffectData()
flamefx:SetOrigin(trace.HitPos)
flamefx:SetStart(self.Owner:GetShootPos())
flamefx:SetAttachment(1)
flamefx:SetEntity(self.Weapon)
util.Effect("swep_flamethrower_flame",flamefx,true,true)
end
end
end
end
function SWEP:Reload()
if (self.Owner:GetAmmoCount("ar2") > 74) or (self.ReloadDelay == 1) then
return
end
self.ReloadDelay = 1
if (SERVER) then
self.Owner:EmitSound( "vehicles/tank_readyfire1.wav", 30, 100 )
end
timer.Simple(1.82, function()
if self:IsValid() then
self:ReloadSelf()
end
end)
end
function SWEP:RunoutReload()
if (self.Owner:GetAmmoCount("ar2") > 74) or (self.ReloadDelay == 1) then
return
end
self.ReloadDelay = 1
if (SERVER) then
self.Owner:EmitSound( "ambient/machines/thumper_dust.wav", 48, 100 )
self.Owner:EmitSound( "vehicles/tank_readyfire1.wav", 30,
[QUOTE=marvincmarvin;37264155]How long? I had the server up for 15 minutes or so before I tested this..[/QUOTE]
have you tried with net.Send( { ply } )
[lua]
function vql.QueryEx( queryz, funcz )
tmysql.query(queryz, query_correct, 1, funcz or function() end) -- attempt to call field 'query' (a nil value)
[/lua]
Note the comments.
The error is happening when calling tmysql.query. The rest of that line doesn't matter. I [B]am[/B] requiring the tmysql module and I am connected to a database.
It used to work.
try PrintTable( tmysql ) before that query
[QUOTE=Banana Lord.;37270973]try PrintTable( tmysql ) before that query[/QUOTE]
[img]http://i45.tinypic.com/2ihl5c8.png[/img]
Are you using BlackAwps' GMod 13 version by any chance? He changed the way it works to make it Object Orientated.
[QUOTE=Drakehawke;37271703]Are you using BlackAwps' GMod 13 version by any chance? He changed the way it works to make it Object Orientated.[/QUOTE]
I am. Care to explain? Or link me to someone who already has?
[QUOTE=Coffeee;37271741]I am. Care to explain? Or link me to someone who already has?[/QUOTE]
tmysql.initialize now returns a database object, I assume you run :query on that object now.
[lua]
tsql = tmysql.initialize(ad, uz, aa, db, 3306)
-- Then later in the file:
tsql:query(queryz, query_correct, 1, funcz or function() end) -- attempt to call field 'query' (a nil value)
[/lua]
Still gives me the same error. This is what you meant right?
What functions have pimpmyride? how to use it? i would like a example, i know you can color a vehicle, and change the vehicle stats in real time, but how? :)
You can't anymore, it's broken.
Sorry, you need to Log In to post a reply to this thread.