[QUOTE=Invule;47634782]I want to have their name and location displayed in to the chat like so: <name> connected from <location>
example: Invule connected from Norway
I can do the name but I have no idea how to do the location, if anyone could point me in the right direction that'd be great. Thanks![/QUOTE]
Try [URL="http://facepunch.com/showthread.php?t=969950"]GeoIP[/URL].
[QUOTE=funnygamemake;47634077]
[CODE]draw.DrawText("GMCash:$"..math.Round(string.format("E", LocalPlayer():GetGCash()),2).."Million" , "gcash", 300, 12.5, Color(255,255,255,255))[/Code]
The problem in the code is the string.format, I want it to make it right the GCash into scientific notation.[/QUOTE]
why even use string.format if you're gonna concat on the same line?
[lua]string.format("GMCash:$%E Million", math.Round(LocalPlayer():GetGCash(), 2))[/lua]
also, isn't scientific notation kinda weird for showing money? I think "%.2f" would work better than "%E" and you wouldn't have to round it
[QUOTE=Luni;47634849]Try [URL="http://facepunch.com/showthread.php?t=969950"]GeoIP[/URL].[/QUOTE]
This seems very outdated, the download links no longer work :/
[QUOTE=wh1t3rabbit;47634367][B]math.Round(string.format([/B]
You are passing a string to math.Round . Swap them around, so you pass your rounded number to string.format?[/QUOTE] for the string.format, I get like 1.000002E2, how would I wround that to like 1.0E2
[QUOTE=Invule;47634885]This seems very outdated, the download links no longer work :/[/QUOTE]
Check the last page
[QUOTE=funnygamemake;47634917]for the string.format, I get like 1.000002E2, how would I wround that to like 1.0E2[/QUOTE]
%.1E
[QUOTE=-- Nate --;47634011]I want to use this simple ulx voting command to switch gamemodes by activating an rcon command doing "gamemode {insert gamemode here}". It is on the server properly, and the vote shows up, yet at the end it doesnt switch the gamemode or let alone give any feedback.
I would greatly appreciate any help at all, I am just trying to learn :)
[/QUOTE]
replace
[code]
ulx.doVote( title, { ... }, voteDone )
[/code]
with
[code]
ulx.doVote( title, { ... }, votegmDone )
[/code]
[QUOTE=skullorz;47634954]replace
[code]
ulx.doVote( title, { ... }, voteDone )
[/code]
with
[code]
ulx.doVote( title, { ... }, votegmDone )
[/code][/QUOTE]
I forgot to mention I did do that and it didn't work. It seems as though it is not giving any feedback to the vote.
[QUOTE=PortalGod;47634948]%.1E[/QUOTE]
is there anyway how I can change the print out value [CODE]1.6E+006Mil[/CODE] and change it with just[CODE] 1.6Mil[/CODE]
I think my issue is trying to run an rcon command in a lua file, which I don't know the syntax for
[editline]1st May 2015[/editline]
So I figured it out I just needed to do a runconsolecommand("ulx", "rcon", "gamemode", "t.options[ winner ]" but I am not sure if that is going to reference the variable in the code?
How would I hook up [CODE]draw.RoundedBox()[/CODE] to a timer that I have in serverside.
net?
NWint?
[QUOTE=funnygamemake;47634994]is there anyway how I can change the print out value [CODE]1.6E+006Mil[/CODE] and change it with just[CODE] 1.6Mil[/CODE][/QUOTE]
literally exactly what I said on the last page
[QUOTE=PortalGod;47635334]literally exactly what I said on the last page[/QUOTE]
I did what you said on the last post, and it gaved me,
"1.6E+006Mil"
I am now trying to change it to
" 1.6Mil"
[editline]30th April 2015[/editline]
[QUOTE=Tomelyr;47635278]net?
NWint?[/QUOTE]
how would I get the value of the timer to set a NWInt?
[QUOTE=funnygamemake;47635361]I did what you said on the last post, and it gaved me,
"1.6E+006Mil"
I am now trying to change it to
" 1.6Mil"[/QUOTE]
[QUOTE=PortalGod;47634851]also, isn't scientific notation kinda weird for showing money? I think "%.2f" would work better than "%E" and you wouldn't have to round it[/QUOTE]
Does anyone know how to get an Addon to work with FastDL?
[t]http://i.imgur.com/5Qei3jc.png[/t]
I looked it up and I'm still confused. The addon already comes with a file in lua/autorun/server that adds the materials.
Hey, I don't know if it has already been asked but.. ehh.. Is there a way to make links and popups on my MOTD to open on user's real web browser instead of the current motd?
[QUOTE=dexon;47635678]Hey, I don't know if it has already been asked but.. ehh.. Is there a way to make links and popups on my MOTD to open on user's real web browser instead of the current motd?[/QUOTE]
Steam Overlay browser is the best you're going to get.
[QUOTE=Revenge282;47635730]Steam Overlay browser is the best you're going to get.[/QUOTE]
Oh. Welp. Still, i'm curious, how would I do that for link and popups ? :)
[QUOTE=ROFLBURGER;47635434]Does anyone know how to get an Addon to work with FastDL?
[t]http://i.imgur.com/5Qei3jc.png[/t]
I looked it up and I'm still confused. The addon already comes with a file in lua/autorun/server that adds the materials.[/QUOTE]
maybe your addon folder contains uppercase and he is using unix.
[QUOTE=dexon;47635803]Oh. Welp. Still, i'm curious, how would I do that for link and popups ? :)[/QUOTE]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/gui/OpenURL]gui.OpenURL[/url]
[QUOTE=Revenge282;47635810][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/gui/OpenURL]gui.OpenURL[/url][/QUOTE]
Oh, you meant that thing. Well, thank you ;)
Is there a good tutorial over how to make C++ Modules for GMod? I'm just curious and would like to look into their power because something I want to do can't be done from regular GMod lua unfortunately.
Ehh, can I create model [URL="http://wiki.garrysmod.com/page/Entity/GetAttachments"]attachments[/URL] with Lua or am I stuck recompiling models?
[QUOTE=ROFLBURGER;47635434]Does anyone know how to get an Addon to work with FastDL?
[t]http://i.imgur.com/5Qei3jc.png[/t]
I looked it up and I'm still confused. The addon already comes with a file in lua/autorun/server that adds the materials.[/QUOTE]
For FastDL to work make sure the following code is ran serverside:
[lua]resource.AddFile( "materials/path/to/your/materials.png" )
resource.AddFile( "materials/path/to/your/materials2.vtf" )
resource.AddFile( "materials/path/to/your/materials3.png" )[/lua]
You'll need to do this with any materials, sounds, models, maps, custom fonts, or particles. Then its up to the client to upload the resources to their fastdl and put them into there server.
[QUOTE=Tomelyr;47635806]maybe your addon folder contains uppercase and he is using unix.[/QUOTE]
You mean Linux. (For the guy asking the question) Linux servers don't support spaces or capitals in file names, if there are any remove them and change it in the resource.AddFile accordingly.
IIRC only capitals aren't supported on linux. i've got an addon with spaces running for 9 months, and it still worked (debian)
[QUOTE=DevShinx;47635896]Is there a good tutorial over how to make C++ Modules for GMod? I'm just curious and would like to look into their power because something I want to do can't be done from regular GMod lua unfortunately.[/QUOTE]
[url]http://wiki.garrysmod.com/page/Setting_Visual_Studio_Up_for_Making_Binary_Modules[/url]
If you run into an error, go to [B]Project Propertie[/B]s > [B]C/C++[/B] > [B]Preprocessor[/B] and in the box that says [B]Preprocessor Definitions[/B] you want to put [B]GMMODULE[/B]. GMod's Lua C API isn't standard, but the function names are similar to the standard Lua C API's, and the functions it uses call the standard functions.
garry's LUA->PushString calls lua_pushstring. You can access the standard Lua functions if you really want to, as they are all exported in lua_shared.dll
Here's an example module by garry
[url]https://github.com/garrynewman/gmod-module-base/blob/master/example/src/gm_example.cpp[/url]
Here's a list of the functions in Lua and the Lua C API. The links to the functions in the API tell you the arguments, what it returns, what it leaves on the stack, etc. The lua_State argument is not needed at all unless you're going to use the standard functions and not garry's functions.
[url]http://pgl.yoyo.org/luai/i/_[/url]
Here's an introduction to the Lua C API
[url]http://www.lua.org/pil/24.2.html[/url]
Not all of the standard functions are in garry's API.
I'm trying to get it to sobel to render on the screen, but detect edges on the depth buffer. Any suggestions? I've tried setting the $fbtexture to the depth buffer and rendering to the screen, but it gives... underwhelming results.
I have a table like:
_table[ 1 ] = { blabla, price = 100 }
how doo I sort them after price? feels like a standard problem, but I'm not good with this math algoritms stuffs :wink:
[QUOTE=Busan1;47640558]I have a table like:
_table[ 1 ] = { blabla, price = 100 }
how doo I sort them after price? feels like a standard problem, but I'm not good with this math algoritms stuffs :wink:[/QUOTE]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/table/SortByMember]table.SortByMember[/url]
?
Sorry, you need to Log In to post a reply to this thread.