Search:
Type: Posts; User: Divran
Search took 0.02 seconds.
for I = 0, 360, 30 do
table.insert( self.Pos, Vector( math.cos( I ), math.sin( I ), 0 ) )
end
sin and cos assume radians:
http://www.lua.org/manual/5.2/manual.html#pdf-math.cos
EDIT: I'll...
I decided to take a look in your teleport plugin because I can be a perfectionist from time to time and I get annoyed when a mod's teleport/goto/bring commands get you stuck in shit. I wanted to make...
https://github.com/wiremod/wire/issues/290
I don't listen to music at all. The only music I hear is the background music in games or the car stereo or what other people put on. I guess I'm one in a million?
That doesn't mean I don't like...
Garry is right. Saying client side Lua should be allowed by default on sandbox servers just because the server hosts are ignorant (of the console command) or stupid isn't a valid argument. If you are...
While that is cool, that isn't how it looks in real life, is it? Shouldn't the scope be much closer to your eye? Maybe you could add a button that moves the scope closer to your eye or something. It...
This is wrong. __index has nothing to do with the "self" reference, and it'll work regardless of what __index is set to. Lexic already explained what __index was but I have my own explanation:
When...
I made a little test you can use and modify if you want
require("luaclass2")
class( "Bank" )
private()
money = 0
protected()
function getMoney(self)
return self.money
This doesn't work because of the way Lua iterates through tables. Your globals "private", "protected", "public" will have numeric indexes, and thus be iterated first. "money", "getMoney","stealMoney"...
I'm not sure what these territories are for (I might have missed the post where you explained it) but if they are supposed to be placed on a map and then sit there forever (and saved to a file to be...
That pumping reminded me of a water gun. Then I thought: Hey.. how come nobody has made a water gun that you have to fill up by dipping it in water? And then up the pressure by pumping it (aka just...
I'm not very good at this sort of thing, but it seems to me the scrollbar sticks out a bit too much. Perhaps remove the outline from it? Or make the outline appear when you hover over it? I dunno
...
I also dislike that sv_allowcslua is set to 0 by default, because then the radial menu mod I use to more easily select my most used tools doesn't work.
But I don't really care because I only play...
Actually, tonumber(txt) is not the same as type(txt) == "number"
In fact, type(txt) == "number" will always return false, so you might as well replace it with "false"
Yeah I know but it's still funny.
Sorry I'm 2 days late but I just had to post this to all of you who don't yet know.
Caps' playtime as of today:
And google tells me that
25 623 hours = 2.92306038 years
I'm not arguing either way, just stating what I think here.
Back a while ago there used to be subforums in the lua forum titled "help", etc. I think that was pretty ordered and it prevented...
I disagree because his "correction" makes no sense whatsoever
What he said. The entity probably doesn't exist
this is the same as
local pw, ph = DHTML:GetSize()
pw = math.power2(pw)
ph = math.power2(ph)
just saying
Then I suppose you don't feel like moving it some more? Because it should be coming into the screen from the bottom right, not the top. Try holding an imaginary lantern (that's what I assume that...
Sorry for not replying sooner. Yeah go ahead and do whatever you want with them.
EDIT: I can recommend the map cycle plugin, that's probably the best one. You could fix it up for gmod 13 and add it...
False. There is an updated version of evolve somewhere on facepunch.
EDIT: Found it http://www.facepunch.com/showthread.php?t=1239304
It got removed, and replaced by the net library.
String concatenation vs table concatenation:
local rep = 100000
local t = os.clock()
local str = ""
for i=1,rep do
str = str .. "hi"
end
Except the spelling is worse than in elementary school.
You don't need regular expressions for that.
if tonumber(TextBox:GetValue()) then
-- it's a number
else
-- it's not a number
end
Sorry, I made a small mistake. Here's the fixed code
hook.Add("TTTBeginRound", "my unique name", function()
for k,ply in pairs( player.GetAll() ) do
if ply:IsUserGroup("vip") or...
change
hook.Add("TTTBeginRound", "ply", function()
to
hook.Add("TTTBeginRound", "my unique name", function( ply )
where "my unique name" should be a unique name for this specific hook. A name...
There was a post somewhere about a new official release of evolve (for gmod 13), but I can't find it anymore
local metatable = {
__newindex = function( tbl, key, value )
print("something has been added to " .. tostring(tbl) .. " at " .. tostring(key) .. " with value " .. tostring(value))...
http://www.lua.org/manual/5.2/manual.html#2.4
__newindex is called when writing a value with a key that is not already present in the table.
__index is called in every other situation (when...
Fixed
TableOfNames = {
["John"] = true,
["Tom"] = true,
["David"] = true
}
function CheckTblForName(ply)
if !IsValid(ply) then return end
if TableOfNames[ply:Nick()] then
local _,count=txt:gsub("\n","\n")
txt=txt..('_'):rep(count)
what's this for?
Steam chat:
23:32 - !cake: I detoured surface.DrawText to ... well.
I REGRET NOTHING
23:34 - Divran: oh god
http://wiki.garrysmod.com/page/http
"demon.mp3"
EDIT: Btw I've made some useful or useless plugins for evolve ages ago which I've placed in my SVN here:...
That sounds like Xerasin alright
What about me :V
I poked overv constantly to get him to work on evolve. And I helped him debug it. And I made the goto, bring, and teleport plugins not suck (they used to just teleport you. I made...
Something like
local firstname, lastname = string.match( text, "^(%w+) (%w+)$" )
if firstname and lastname then
-- Valid name
else
-- Not a valid name
end
Awkward? Unfortunately? I think it's a great idea. It lets you easily have high precision with your sliders.
Strange. Garry must have changed that, then.
I checked Evolve, and it uses Lock & UnLock.
Wiki:
http://wiki.garrysmod.com/page/Classes/Player/Lock
http://wiki.garrysmod.com/page/Classes/Player/UnLock
Yep that seems to be it.
I have a memory of there being a way to freeze a player without disabling looking around, but I could be remembering wrong.
Why not just freeze the player
I tried this, and it looks like you're wrong (me() is a convenience function I made, its purpose should be self explanatory).
] lua_run eye1 = me():GetAimVector() timer.Simple(1,function() eye2 =...
I've already answered the question about getting two instances of the player's aim vector, but that's evidently not what you want to know.
I can't make sense of your code. What does it do?
just do
local playermouseaim1 = ply:GetAimVector()
timer.Create("leftkeydown", 0.2, 0, function()
local playermouseaim2 = ply:GetAimVector()
done
Write/ReadInt doesn't take the size of the entire message. I suggest you take a look here: http://wiki.garrysmod.com/page/Libraries/net/WriteInt
Try this
function GetFactionName(factionID, callback)
local query1 = db:query("SELECT FactionName FROM gfactions_factionlist WHERE FactionID = '"..factionID.."'")
query1.onSuccess = callback...