just seems like you're trying to write a table that doesn't exist
[QUOTE=a-cookie;46277189]just seems like you're trying to write a table that doesn't exist[/QUOTE]
well obviously, but i don't know where it is
i added an error clause in net.lua, i'll see what happens
I can not remember this function for the life of me.
What is the name of the function that is used to make a derma panel pan down from the top of you screen and open.
There should be two of them, One to open and another to close it.
My hook I made for my money stuff isn't working. It doesn't give money or outputs the message
[lua]
hook.Add("PlayerDeath","fbox_money_death_reward",function(vic,wep,att)
if vic == att then return end
att:ChatPrint("You killed "..vic.." and recieved <color=255,255,255>:money: $100")
att:GiveMoney(100)
end)
[/lua]
[QUOTE=LUModder;46277518]My hook I made for my money stuff isn't working. It doesn't give money or outputs the message
[lua]
hook.Add("PlayerDeath","fbox_money_death_reward",function(vic,wep,att)
if vic == att then return end
att:ChatPrint("You killed "..vic.." and recieved <color=255,255,255>:money: $100")
att:GiveMoney(100)
end)
[/lua][/QUOTE]
i think there was something with return in hooks. can't quite remeber, but it was recently an discussion about it.
Try to change it to:
if vic != att then att:chatprint and so on.
[QUOTE=Giraffen93;46277337]well obviously, but i don't know where it is
i added an error clause in net.lua, i'll see what happens[/QUOTE]
That would be why a wrapper that handles it would be better... You could do networking:SendBlah( ) and have it handle everything else. If it is meant to WriteTable then it can do: if ( istable( _input ) ) then net.WriteTable( _input ); end and on the receiving side, just local _tab = net.ReadTable( ) || { };
[QUOTE=VonSpot;46265656][URL="http://wiki.garrysmod.com/page/ents/FindInCone"]ents.FindInCone[/URL][/QUOTE]
For some clarification, what is the reasoning for using DarkRP's method (or any other method?) over ents.FindInCone? I'm under the impression that it's efficiency unless I'm completely misunderstanding ents.FindInCone.
[QUOTE=bran92don;46277487]I can not remember this function for the life of me.
What is the name of the function that is used to make a derma panel pan down from the top of you screen and open.
There should be two of them, One to open and another to close it.[/QUOTE]
[URL="http://wiki.garrysmod.com/page/Panel/MoveTo"]Try this[/URL]
[QUOTE=WalkingZombie;46271949]Thanks for the idea. That ensures that there will never be a living headcrab, but I want a 100% chance that in some way, as a ragdoll or as a NPC, a headcrab comes off the head. (if I kill it manually, then it can be just the NPC)[/QUOTE]
You can check to see if the findinsphere detected any Headcrabs, and if it didn't, spawn your own and kill it.
If you do it this way then you need to change the bodygroup of the zombie right before it dies to the crabless one.
Player class help?
How can I set a bodygroup on a weapon's world model?
Not really a problem, more like a question.
While looking at some people's code I saw that some of them were doing this:
[CODE]
local type, error, pcall, pairs, AddCSLuaFile, _player = type, error, pcall, pairs, AddCSLuaFile, player;
[/CODE]
Basically, why would you localize global libraries?
It used to make your code run faster; especially if you were using those very often.
Pretty sure you don't need to to get the speed boost anymore.
[QUOTE=RonanZer0;46280424]Player class help?[/QUOTE]
What do you need help with with the Player Class system?
Is there any instruction for setting up layer masks?
For instance: [IMG]http://i.imgur.com/m7hc18Y.png[/IMG]
[QUOTE=zerf;46280664]It used to make your code run faster; especially if you were using those very often.
Pretty sure you don't need to to get the speed boost anymore.[/QUOTE]
Tried benchmarking a few things a while back. The boost was minimal at best. See here: [url]https://github.com/Facepunch/garrysmod-issues/issues/631[/url]
[editline]20th October 2014[/editline]
[QUOTE=zerf;46280553]How can I set a bodygroup on a weapon's world model?[/QUOTE]
Same way you'd set it anywhere else...
_ent:SetBodygroup( id, value )
[QUOTE=Kozmic;46281333]Is there any instruction for setting up layer masks?
For instance: [IMG]http://i.imgur.com/m7hc18Y.png[/IMG][/QUOTE]
wouldn't you use [URL="http://wiki.garrysmod.com/page/render/SetScissorRect"]SetScissorRect[/URL] to achieve this?
Philosophical question: how responsive should a standard TDM/CTF gamemode be to playercount? I.e.
- Don't start until the first player picks a team
- Return to idle after the last player quits and don't mapcycle
[QUOTE=_FR_Starfox64;46280646]Not really a problem, more like a question.
While looking at some people's code I saw that some of them were doing this:
[CODE]
local type, error, pcall, pairs, AddCSLuaFile, _player = type, error, pcall, pairs, AddCSLuaFile, player;
[/CODE]
Basically, why would you localize global libraries?[/QUOTE]
Used to make code faster ( now not so much anymore since LuaJit ).
But there are certain situations where it actually still makes code faster, and that significantly.
However, that only counts for functions that are called often.
AddCSLuaFile is a function that really shouldn't be localized.
The only other reason why is to avoid overwrites - mainly for cheats and anticheats.
Is there an easy way to use a PHP function in Lua without having the PHP file uploaded to a webserver?
[QUOTE=LUModder;46277518]My hook I made for my money stuff isn't working. It doesn't give money or outputs the message
[lua]
hook.Add("PlayerDeath","fbox_money_death_reward",function(vic,wep,att)
if vic == att then return end
att:ChatPrint("You killed "..vic.." and recieved <color=255,255,255>:money: $100")
att:GiveMoney(100)
end)
[/lua][/QUOTE]
Pretty sure ChatPrint can't do colour
The color might be a feature of a chatbox on his server.
[QUOTE=LUModder;46277518]My hook I made for my money stuff isn't working. It doesn't give money or outputs the message
hook.Add("PlayerDeath","fbox_money_death_reward",function(vic,wep,att) if vic == att then return end att:ChatPrint("You killed "..vic.." and recieved <color=255,255,255>:money: $100") att:GiveMoney(100)end)
[/QUOTE]
This is because you are getting an error - something along the lines of "attempt to concatenate a userdata value."
Change it to "..vic:Nick().." instead of "..vic.." and see what happens.
[QUOTE=Kogitsune;46288656]The color might be a feature of a chatbox on his server.
This is because you are getting an error - something along the lines of "attempt to concatenate a userdata value."
Change it to "..vic:Nick().." instead of "..vic.." and see what happens.[/QUOTE]
I already fixed this, forgot to snip it once I got it fixed.
[t]http://i.imgur.com/V1Ebd7o.jpg[/t]
I really don't understand this.
The DHTML panel has a correct size set, the white background uses it even, but when i paint it, it comes out as a different size.
Is there any way to make a sound heard from over 2000 units away?
Is there an easy way to tell if a user has been poisoned (like by poison headcrabs, the antlion queen, antlion workers, or a swep) ?
[editline]21st October 2014[/editline]
without checking if they player was attacked by them during a function called when they get hurt.
[QUOTE=WalkingZombie;46294936]Is there an easy way to tell if a user has been poisoned (like by poison headcrabs, the antlion queen, antlion workers, or a swep) ?
[editline]21st October 2014[/editline]
without checking if they player was attacked by them during a function called when they get hurt.[/QUOTE]
I believe there's a DMG_POISON enumeration for the OnTakeDamage hook. Could you check if the damage is DMG_POISON and set something like isPoisoned to true?
That is an option I guess. I meant something more like the player:Alive() thing, player:Poisoned(). I could try out what you just said, but is there a shorthand function like that? Like plr:Poisoned() ??
[editline]21st October 2014[/editline]
or perhaps in the manner of IsPoisoned( plr )
[QUOTE=WalkingZombie;46295151]That is an option I guess. I meant something more like the player:Alive() thing, player:Poisoned(). I could try out what you just said, but is there a shorthand function like that? Like plr:Poisoned() ??
[editline]21st October 2014[/editline]
or perhaps in the manner of IsPoisoned( plr )[/QUOTE]
I think you might be out of luck there. Maybe someone knows something I don't though.
Okay well how would I go abouy using a PHP function I made in Lua?
Sorry, you need to Log In to post a reply to this thread.