https://developer.valvesoftware.com/wiki/Dimensions
It's in units per second.
Feet per second = speed/16
Miles per hour = (speed * 3600)/5280
Kilometers per hour = (speed * 0.3048 * 3600)/(1000 * 16)
https://developer.valvesoftware.com/wiki/Dimensions
It's in units per second.
Feet per second = speed/16
Miles per hour = (speed * 3600)/5280
Kilometers per hour = (speed * 0.3048 * 3600)/(1000 * 16)
Is there a tutorial somewhere that teaches you how to make your own particle system/particle effects that can be used in conjunction with util.Effect() or ParticleEffectAttach()?
EP2 ones are nice but I'd rather make my own.
Getting a weird problem on my server.
Basically on TTT, every so often, when someone drops any weapon on the floor then tries to pick it up with their magneto stick, the weapon gets stuck inside the floor, spazzes out (With dust clouds) and the server crashes. This never used to happen on our old host, but I have no idea why a different host would affect this.
The dumps confirmed it was a vphysics crash, but I'm not really sure what could be done to fix it aside from not letting people pick them up.
im gonna post in this thread again. hope its fine.
ive been trying all day to make a AmmoCrate. entity for rp that when you click use on it you would obtain 20 Pistol ammo ive been trying for 6hrs today without luck i hope theres some help out there
Need Help with a 3D HUD, Trying to use render targets, but dont know much about the library.
Is there any way to sort a table by key? I have a table with 20 strings as the key and want to sort alphanumerically based on that key.
for k, v in SortedPairs( tbl ) do -- blah end
The function is in lua/includes/extensions/table.lua
Perfect, thanks
How do you add 1 to network bool?
e.g
self.Entity:SetNWBool("fertlimit", +1)
It was set at 0 on initialize.
you cat 'add' to a bool, bools are 'true' or 'false'
Yes, but bools can also be 1,2,3 etc?
no
Edited:
A 'Boolean' is true or false, not numbers, use NWInts instead, or something more efficient
true false 1 0
Balls to it, Ill just use the old friend variable.
Don't know why you're trying to add one, it can only be 0 or 1 so just set it to 1
I was using it for when to remove something, or when it = 5. But now coming to think about it a variable will be much easier.
If you don't need the clients knowing the variable you shouldn't be using the SetNW functions, at all.
?
Where did he say that?
Trying to get a
ply:PrintMessage( HUD_PRINTCENTER, "Out of bounds!")
to appear when a player falls off of a stage, but only for the player. Putting this in init.lua will make everyone see it, but putting
function player_initdeath( ply, wep, killer ) ply:PrintMessage( HUD_PRINTCENTER, "Out of bounds!") end hook.Add( "PlayerDeath", "player_initalize_dvars", player_initdeath );
into cl_init.lua under the derma does nothing.
You will need to define ply in init.lua, for example local ply = self.Entity.dt.owning_ent (This is for my entity) Then do
ply:PrintMessage( HUD_PRINTCENTER, "Out of bounds!")
Where are you calling that in init.lua?
Don't think I am, but then nothing should work, right?
Edited:
Putting this in init.lua
--on player death function player_initdeath( ply, wep, killer ) ply:PrintMessage( HUD_PRINTCHAT, ply:Nick() .. " has fallen off of the stage.\n") ply:PrintMessage( HUD_PRINTCENTER, "Out of bounds!") end
makes the printcenter appear but not the printchat. Sorry to everyone who's cringing, heh.
The server is calling this function player_initdeath( ply, wep, killer ) function, so ply is registered as the server. If the player was to call that function, ply would be the player.
Mrkrabz it's nice that you're trying to help but you obviously have no idea what you're talking about.
Uhr, I've had the same problem in my gamemode and I fixed it by doing local owner = w/e, then doing owner: to send the message. ply would not work because obviously the client didn't call it itself, defining the entity's owner as the client (ply) worked.
Also, if you were going to put that, why not also be useful and post the "real" fix for him.
What the hell are you talking about? "PlayerDeath" is a serverside function. How should the client call it?
Also no, I read wrong, he put the PlayerDeath function into a clientside file.
When the player dies the server calls that function with ply being the player that died. I do understand it however I got confused where he put it into a clientside file.
Ah, I apologise for the misunderstanding then.
There doesn't seem to be anything wrong with that code so I'm guessing you have another hook somewhere further down uverwriting that one.
How do I get if prop is frozen or unfrozen?
PhysObj.IsMoveable
http://maurits.tv/data/garrysmod/wik...Obj.IsMoveable
Edited:
![]()
Try this
function _R.Entity:IsFrozen() local phys = self:GetPhysicsObject() return (phys:IsValid() and not phys:IsMoveable()) end
I'm going to try to keep this simple, in hopes of someone actually being able to help.
Basically, assuming that the v_model itself has both animations and that they work (probably), is there any reason that this:
would not work? Because its playing ACT_VM_DRAW even when the launcher is out of ammo, which is something it shouldn't be doing.Code:function SWEP:Deploy() if ( self.Weapon:Clip1() > 0 ) then self.Weapon:SendWeaponAnim( ACT_VM_DRAW ) else self.Weapon:SendWeaponAnim( ACT_VM_DRAW_EMPTY ) end end
Any help would be appreciated![]()
How can I set up some props into a render target to draw to the screen later?
1. What would be the best way to draw a border of a rounded rectangle? Drawing another rounded rectangle atop of the "border rectangle" blends the two colors together if alpha is below 255.
Perhaps anyone can give me tips on how to achieve this?
2. I decided to scoure and optimize my gamemode's code. I remember that garry's code had variables such as these ...
... defined. Can anyone explain as to why? Does it make the code run faster?local table = table local string = string local umsg = umsg local concommand = concommand
Does anyone have any ideas fora gradient outlined rect?
1. Somebody made a rounded rectangle alternative using surface.DrawPoly (don't remember who, sorry) You could use that along with the stencil buffer.
render.ClearStencil() render.SetStencilCompareFunction(STENCILCOMPARISONFUNCTION_ALWAYS) render.SetStencilPassOperation(STENCILOPERATION_REPLACE) render.SetStencilWriteMask(1) render.SetStencilReferenceValue(1) --Draw center rect render.SetStencilCompareFunction(STENCILCOMPARISONFUNCTION_EQUAL) --Draw outline rect
2. You have to do that in modules to place the variables in the modules local environment (modules don't have access to the global environment unless you create them using the package.seeall parameter)
Divran sent me a code sample for an outlined rounded box. Credits to sk8 and Divran.
How do I get a Stools owner?
Swep works with self.Owner but I can't seem to do that with Stool.
I believe it's self:GetOwner()
How can I make this so when I press the Pistols category the Submachine gun category will move down so it doesn't get in the way?