I'll ask again, is there a way to change the color of the text in a DTree?
Speaking of DTrees, there isn't a way to change the folder icon to something else, is there? I know normal methods aren't available (at least from what I've seen), but I'm asking if anyone has somehow found a way.
[QUOTE=Dark Slayre;38378893]Speaking of DTrees, there isn't a way to change the folder icon to something else, is there? I know normal methods aren't available (at least from what I've seen), but I'm asking if anyone has somehow found a way.[/QUOTE]
You can do DTree:AddNode( name, iconpath ), or DTreeNode:AddNode( name, iconpath ). The folder icon is "icon16/folder.png".
If you can iterate through all the nodes, you should also be able to do node.Icon:SetImage( iconpath )
On a different, yet still DTree related note - how can I add a horizontal scrollbar to a DTree?
Is there a way to get HTMLBack() and HTMLForward() to work in GM13?
Whats with the gui.OpenURL function?!
Doesnt work for me, gives me a nil
Is there a new Function?
What does the jit library do? I saw something earlier that disabling it fixes Wire E2 slowness.
[QUOTE=johnnyaka;38382194]Whats with the gui.OpenURL function?!
Doesnt work for me, gives me a nil
Is there a new Function?[/QUOTE]
It was removed, so now you need to make your own HTML panel.
@Chessnut
Thanks, why those Things arent in the "Why your Scripts are broken..." Doc?!
The HTML Panel is the next Problem,
i use that code:
[CODE] local HTML = vgui.Create( "HTML" ) --Create the HTML control
HTML:SetSize(ScrW() - 100, ScrH() - 100)
HTML:Center() --Center on screen
HTML:OpenURL(DonateURL .. "?nick=" .. nick .. "&steamid=" .. steamid .. "&months=" .. months)
local HTMLControls = vgui.Create( "DHTMLControls", HTML ) --Create the DHTMLControls control
HTMLControls:SetHTML( HTML ) --Add the bar to this HTML control[/CODE]
The Webpage appears, but i have no cursor and i cant click anywhere, do i have to add it to a Frame?
What hook "CanProperty" does?
[QUOTE=Frankess;38383064]What hook "CanProperty" does?[/QUOTE]
It controls the right click context menu.
What has gmod_vehicle_viewmode been replaced with?
[QUOTE=johnnyaka;38382993]@Chessnut
Thanks, why those Things arent in the "Why your Scripts are broken..." Doc?!
The HTML Panel is the next Problem,
i use that code:
[CODE] local HTML = vgui.Create( "HTML" ) --Create the HTML control
HTML:SetSize(ScrW() - 100, ScrH() - 100)
HTML:Center() --Center on screen
HTML:OpenURL(DonateURL .. "?nick=" .. nick .. "&steamid=" .. steamid .. "&months=" .. months)
local HTMLControls = vgui.Create( "DHTMLControls", HTML ) --Create the DHTMLControls control
HTMLControls:SetHTML( HTML ) --Add the bar to this HTML control[/CODE]
The Webpage appears, but i have no cursor and i cant click anywhere, do i have to add it to a Frame?[/QUOTE]
Yes, parent it to a DPanel or DFrame. I've had some trouble with the browser trying to load certain urls though.
Looking for help with this: [url]http://facepunch.com/showthread.php?t=1224698[/url]
Is there a way to remove the original disconnect/connect messages?
[QUOTE=Shoar;38388418]Is there a way to remove the original disconnect/connect messages?[/QUOTE]
The only way I know of is client sided.
[lua]hook.Add( "ChatText", "Block Join/Leave Messages", function( entindex, name, text, msgtype )
if msgtype == "joinleave" then
return true
end
end )[/lua]
[QUOTE=BlackAwps;38388503]The only way I know of is client sided.
[lua]hook.Add( "ChatText", "Block Join/Leave Messages", function( entindex, name, text, msgtype )
if msgtype == "joinleave" then
return true
end
end )[/lua][/QUOTE]
That works, cheers.
is it possible to draw derma elements on a cam3d2d
I'd like to change the hold type of a weapon outside of the SWEP:Initialize() hook.. I'd like to call it in the SWEP:SecondaryAttack() hook.
To achieve this I'm just trying to call the self:SetWeaponHoldType() function (With the desired holdtype) within the SWEP:SecondaryAttack() hook in code run both clientside and serverside but it seems to have no effect.
Can this function only be run once per weapon or something?
[QUOTE=/dev/sda1;38388751]is it possible to draw derma elements on a cam3d2d[/QUOTE]
Look into overriding the paint functions - they all use draw and surface and such.
What do i replace glon with in this extract of code?
[lua]
function Player:PS_LoadItems()
self.Items = POINTSHOP.ValidateItems(glon.decode(self:GetPData("PointShop_Items", {})) or {})
self:PS_UpdateItems()
end
[/lua]
[lua]local prop = ClientsideModel( model, RENDERGROUP_BOTH )
prop:SetColor( Color( 255, 255, 255, 20 ) )[/lua]
This doesn't make my prop translucent, i tried RENDERGROUP_TRANSPARENT too...
Also, what's the proper way to check each frame how far the player has moved their mouse (if cursor is visible)? Is there a hook for this or do i need to implement this in a think hook?
[QUOTE=gaz492;38389382]What do i replace glon with in this extract of code?
[lua]
function Player:PS_LoadItems()
self.Items = POINTSHOP.ValidateItems(glon.decode(self:GetPData("PointShop_Items", {})) or {})
self:PS_UpdateItems()
end
[/lua][/QUOTE]
There are many replacements for glon. Here's one: [url]http://www.facepunch.com/showthread.php?t=1194008[/url]
Is there an easy way to set the scale of a players model?
I came up with this but it doesnt work
[lua]
function ENT:Use(activator,caller)
caller:SetModelScale(Vector(1.25,1.25,1.25))
end
[/lua]
SetModelScale doesn't use a vector anymore. Just do:
[code]function ENT:Use(activator,caller)
caller:SetModelScale(1.25, 0) -- The 2nd argument is how fast it should be applied
end[/code]
[QUOTE=twoski;38389957][lua]local prop = ClientsideModel( model, RENDERGROUP_BOTH )
prop:SetColor( Color( 255, 255, 255, 20 ) )[/lua]
This doesn't make my prop translucent, i tried RENDERGROUP_TRANSPARENT too...[/QUOTE]
Have you tried prop:SetRenderMode(1)?
Doesn't anyone know how to get the current state of a door, whether its opened or closed?
I tried searching its keyvalues but nothing was obvious for me to pick up.
[QUOTE=twoski;38389957]
This doesn't make my prop translucent, i tried RENDERGROUP_TRANSPARENT too...
Also, what's the proper way to check each frame how far the player has moved their mouse (if cursor is visible)? Is there a hook for this or do i need to implement this in a think hook?[/QUOTE]
[lua]local prop = ClientsideModel( model )
prop:SetRenderMode(RENDERMODE_TRANSALPHA)
prop:SetColor( Color( 255, 255, 255, 20 ) )[/lua]
You will need to implement that in a think hook.
[QUOTE=jmazouri;38311962]Add a logo.png which should be 128px high and up to 1024px wide (goes on top of the menu) and a logo24.png which should be 24x24 and goes in the bottom right corner gamemode selector on the menu.
All lua goes into a "gamemode" folder next to info.txt (which should be the same name as your gamemode folder, in this case "shootsandpoops.txt"), and all content (fonts, textures, models, sounds, etc) go into a "content" folder also right next to info.txt.[/QUOTE]
Wait, so for the lua files. I make a new folder named "shootsandpoops" and place the shared, init and what not in there?
I am having a problem with a nil value.
My code is this, it is a death message for TTT.
[lua]
function tttDeathMessage( victim, weapon, killer )
if killer:IsTraitor() ~= nil then
if killer:IsTraitor() then
victim:PrintMessage( HUD_PRINTTALK,"You were killed by " .. killer:GetName() .. " who was a Traitor.\n" )
elseif killer:IsDetective() then
victim:PrintMessage( HUD_PRINTTALK,"You were killed by " .. killer:GetName() .. " who was a Detective.\n" )
else
victim:PrintMessage( HUD_PRINTTALK,"You were killed by " .. killer:GetName() .. " who was Innocent.\n" )
end
end
end
hook.Add( "PlayerDeath", "playerDeathTest", tttDeathMessage )
[/lua]
If a player is killed with a world prop, I get an error in the server console that says this.
[code]
[ERROR] lua/autorun/server/ttt_deathmsg.lua:2: attempt to call method 'IsTraitor' (a nil value)
1. v - lua/autorun/server/ttt_deathmsg.lua:2
2. unknown - lua/includes/modules/hook.lua:86
[/code]
if ( killer and IsValid(killer) and killer:IsPlayer() ) then
Happens whenever you go thirdperson in your vehicle, stops spamming when you hit controll key again
[CODE][ERROR] path/cl_misic.lua:47: attempt to call method 'CalcVehicleThirdPersonView' (a nil value)[/CODE]
[CODE]function GM:CalcView( ply, origin, angles, fov )
local Vehicle = ply:GetVehicle()
local wep = ply:GetActiveWeapon()
if ( IsValid( Vehicle ) and gmod_vehicle_viewmode_hack:GetInt() == 1 ) then
return GAMEMODE:CalcVehicleThirdPersonView( Vehicle, ply, origin*1, angles*1, fov )
end
local ScriptedVehicle = ply:GetScriptedVehicle()
if ( IsValid( ScriptedVehicle ) ) then
local view = ScriptedVehicle.CalcView( ScriptedVehicle:GetTable(), ply, origin, angles, fov )
if ( view ) then return view end
end
local view = {}
view.origin = origin
view.angles = angles
view.fov = fov
end[/CODE]
Sorry, you need to Log In to post a reply to this thread.