Is it possible to make a server detect if a client has Favorited it or not?
Edit: I have talked to a couple of people. I got mixed responses of no and i do not know.
Edit #2: I shouldve said that I have seen this in a tf2 Server
Is there any way to grab a list of the built ammo types generated by game.BuildAmmoTypes() ?
[QUOTE=ROFLBURGER;47440439]Is there any way to grab a list of the built ammo types generated by game.BuildAmmoTypes() ?[/QUOTE]
Just call BuildAmmoTypes and it [URL="https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/includes/extensions/game.lua#L44"]returns the list[/URL], the [URL="http://wiki.garrysmod.com/page/game/BuildAmmoTypes"]wiki says you shouldn't[/URL] but I can't see how it would negatively affect anything as long as you don't add more ammo types after calling it (since it sorts the list when called).
Hi, back again.
I heard about the new Entity:SetSubMaterial() thing, and I've been trying to use it. First, I created a clientside script that uses GM:Think to, every second, run a function that prints to console the materials of the entity I'm looking at using Entity:GetMaterials(). I tried also adding to this function an Entity:SetSubMaterial(), but it does not work. I'm guessing that this needs to be run serverside, so I took a shot at getting it to work through the net Library, here's my code.
( The script to get the entity you're looking at )
[CODE]include( 'setsubmat.lua' )
function EntityMatList()
local ply = LocalPlayer()
local trace = util.GetPlayerTrace( ply )
local line = util.TraceLine( trace )
if line.HitNonWorld then
local viewevent = line.Entity
print( "The materials in this entity are: " )
PrintTable( viewevent:GetMaterials() )
net.Start( "viewentity" )
net.WriteEntity( viewevent )
net.SendToServer()
end
end
timer.Create( "clicks", 1, 0, EntityMatList )[/CODE]
( The code that uses the net.SendToServer from the first script to get the entity the player is looking at.
[CODE]include( 'viewentity.lua' )
util.AddNetworkString( "viewentity" )
net.Receive( "viewentity", function( viewevent )
viewevent:SetSubMaterial( 5, "metal/citadel_metalwall063" )
end )[/CODE]
I'm just running these both seperately in console, using lua_openscript_cl for the first and plain old lua_openscript for the second. Maybe I'm way out of it. Sorry if this post is confusing.
I'm working with nextbot at the moment. Any idea why looking at 20 bots running will make my client upload 30 k/s to the server? If the bots are standing still or if the bots are outside the screen, I have around 2.2 k/s going out.
This is the base gamemode and the only connected player is myself.
My 8 slot Elpis server is choking if I look at 60 NextBots running, but it's fine if they're outside the screen.
@Sheeplie
Right, you are going to want to do viewevent = net.ReadEntity()
But [url]http://wiki.garrysmod.com/page/Player/GetEyeTrace[/url] is shared so you can use it serverside and don't need to network.
How should I best display 6 options with vgui, where only one option can be selected at a time? I want to be able to put tooltips on them, but that's not truly required.
Also, how should I display 7 options with an internal value, and only allow selection if the internal values of them all don't go over a limit?
[QUOTE=Ghost_Sailor;47441730]How should I best display 6 options with vgui, where only one option can be selected at a time? I want to be able to put tooltips on them, but that's not truly required.
Also, how should I display 7 options with an internal value, and only allow selection if the internal values of them all don't go over a limit?[/QUOTE]
[url]http://wiki.garrysmod.com/page/Category:Panels[/url]
Pick whatever one suits you best.
I find it best though to read the source code for the derma you choose, helps you do what you wanna do and a lot of times any questions that people have with derma are normally answered by looking at the source
[QUOTE=AnonTakesOver;47441775][url]http://wiki.garrysmod.com/page/Category:Panels[/url]
Pick whatever one suits you best.
I find it best though to read the source code for the derma you choose, helps you do what you wanna do and a lot of times any questions that people have with derma or normally answered by looking at the source[/QUOTE]
I looked through that, and the closest thing I could find was DComboBox, which doesn't seem to have much room for styling, and I would have to recreate a lot of it to implement tooltips.
[QUOTE=Ghost_Sailor;47441893]I looked through that, and the closest thing I could find was DComboBox, which doesn't seem to have much room for styling, and I would have to recreate a lot of it to implement tooltips.[/QUOTE]
Welcome to derma.
Generally if you want to make something exactly like you have in your head, you are going to have to recreate and make most of the stuff. Derma is very basic but gives you a lot to work with.
Alright, I've toyed around a bit and I'm curious, has anyone else gotten this Entity:SetSubMaterial() thing to work yet? My code didn't end up working, but I even tried using lua_run to troubleshoot.
[CODE]] lua_run Entity(1):GetEyeTrace().Entity:SetSubMaterial( 5, "concrete/concretefloor019" ) // This is basically Player:GetEyeTrace().Entity:SetSubMaterial but I can't use LocalPlayer() with serverside.
> Entity(1):GetEyeTrace().Entity:SetSubMaterial( 5, "concrete/concretefloor019" )...[/CODE]
And just to make sure I'm not crazy..
[CODE]] lua_run print( Entity(1):GetEyeTrace().Entity )
> print( Entity(1):GetEyeTrace().Entity )...
NPC [471][npc_kleiner][/CODE]
[QUOTE=DarthTealc;47442678]I'm not sure if this is a Gmod bug or if I'm doing something wrong. Basically, serverside ragdolls can't be coloured like playermodels can (and they use a dull blue regardless of what it should be, eg Kleiner's jacket should be white).
This is how I tested it:
[code]
concommand.Add("testragdolls", function(ply)
local rag = ents.Create("prop_ragdoll")
if not IsValid(rag) then return nil end
rag:SetPos(ply:GetPos())
rag:SetModel(Model("models/player/p2_chell.mdl"))
rag:SetAngles(ply:GetAngles())
rag:SetColor(Color(255,0,0))
rag:Spawn()
rag:Activate()
end)
[/code]
This should spawn a Chell playermodel ragdoll with a red (255,0,0) jacket. But it spawns the ragdoll with a dull blue one. Am I doing something wrong or is this a bug?[/QUOTE]
Add this to the entity with your color clientside:
[url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/gamemode/editor_player.lua#L188[/url]
[QUOTE=DarthTealc;47442865]The ragdoll is being created serverside. It's the TTT ragdoll, they don't follow the player's colour (which is the same for every player, per round) so I'm stripping it back to basics and found that doing :SetColor on it doesn't work even when it's hardcoded (eg just creating a ragdoll with Color(255,0,0) above)
I tried [I]rag.GetPlayerColor = function() return Vector(1,0,0) end[/I] but that's serverside.[/QUOTE]
You missed what RobotBoy meant.
He said attach the GetPlayerColor to the entity *clientside*.
You'll need to network the color if the color is decided serverside.
Hi,
I just realised that i can't move players with my physgun even if i'm in the superadmin usergroup.
But, when i aims players, i can "holo" them as you can see in the screen:
[IMG]http://i.imgur.com/rPKfNSi.png[/IMG]
Does anyone know how to fix this?
Thanks
ok, i just fixed it, thanks anyway
[QUOTE=DarthTealc;47442936]I'm a bit confused about how the prop_ragdoll entity works then. I'm sure a serverside :SetColor used to work on TTT for setting the colour of a ragdoll. Has something changed?
I'll try this tomorrow and see how it goes.[/QUOTE]
You must manually add the GetPlayerColor CLIENTSIDE function to any entity you want to use the PlayerColor matproxy with. It has nothing to do Set/GetColor at all. You CAN make the function just use GetColor and convert the color to vector.
The death ragdoll is automatically taken care of by the matproxy.
Can't remember if this got a response, but we ever find out if there are any hooks to manipulate where 3D voicechat is coming from / how far away the dropoff is?
hello,
I need a simple script to define when all players of a team are dead, the round ends.
That's an option but if someone have a script about xp and level.
thank you
Sorry if my english is bad but i am french
So, anyone else also have bad luck with Entity:SetSubMaterial?
Not a problem, more out of curiosity but do you recommend having a vps running both a server and a forum or I run the forum on a smaller one? Also popular picks seem to be DO, Ramnode and OVH, what would you pick out of those?
Where can I find the script that does the "Crazy physics on entity, removing..." stuff?
[QUOTE=VIoxtar;47444618]Where can I find the script that does the "Crazy physics on entity, removing..." stuff?[/QUOTE]
I'd assume it's C++ side, can't find it in the Github repo.
[QUOTE=VIoxtar;47444618]Where can I find the script that does the "Crazy physics on entity, removing..." stuff?[/QUOTE]
Nowhere. It is written in C++.
Thanks. I'm also interested in force limits. I want to manipulate them. Where can I find these? I want to know how they are handled (by what hooks).
Hey guys.
I am trying to create a 3D2D circle, how would i be able to do that?
Force limits?
If you mean ApplyForce or SetVelocity, [url]http://wiki.garrysmod.com/page/physenv/SetPerformanceSettings[/url] and it is also dependent on PhysObj.Mass.
[editline]2nd April 2015[/editline]
[QUOTE=tzahush;47445189]Hey guys.
I am trying to create a 3D2D circle, how would i be able to do that?[/QUOTE]
You can find an example on drawing circles here:
[url]http://wiki.garrysmod.com/page/surface/DrawPoly[/url]
And 3D2D example here:
[url]http://wiki.garrysmod.com/page/cam/Start3D2D[/url]
[QUOTE=Robotboy655;47445197]Force limits?
If you mean ApplyForce or SetVelocity, [url]http://wiki.garrysmod.com/page/physenv/SetPerformanceSettings[/url] and it is also dependent on PhysObj.Mass.
[editline]2nd April 2015[/editline]
You can find an example on drawing circles here:
[url]http://wiki.garrysmod.com/page/surface/DrawPoly[/url]
And 3D2D example here:
[url]http://wiki.garrysmod.com/page/cam/Start3D2D[/url][/QUOTE]
Hey man, first of all thanks for the quick answer!
Second of all, i was wondering if there is anyway of doing so with just typing a position and a radius?
Thanks.
[QUOTE=tzahush;47445221]Hey man, first of all thanks for the quick answer!
Second of all, i was wondering if there is anyway of doing so with just typing a position and a radius?
Thanks.[/QUOTE]
Only if you actually open the pages I liked and look at the examples I told you to look at.
[QUOTE=Robotboy655;47445197]Force limits?
If you mean ApplyForce or SetVelocity, [url]http://wiki.garrysmod.com/page/physenv/SetPerformanceSettings[/url] and it is also dependent on PhysObj.Mass.[/QUOTE]
Sorry, I was being unclear. By force limits, I meant constraint force limits, such as welds, ropes, and the like. How does a rope know when to tear, or how does a weld know when to break? Where can I find the code that handles these?
Now I'm trying to make it so that GM:OnPlayerChat, it will make the player's text red.
I've put this in addons/playerchat/lua/autorun/client
[CODE]
function GM:OnPlayerChat( player, text, bTeamOnly, bIsdead )
chat.AddText( player, ": ", Color( 192, 57, 43, 255 ), text )
end[/CODE]
I usually get an error saying that GM is a nil value.
Sorry, you need to Log In to post a reply to this thread.