[QUOTE=havejack;39519877]How wouldl i use the FindInBox function ? The vectors are where its at but what vectors do i use ?
[url]http://wiki.garrysmod.com/page/Libraries/ents/FindInBox[/url][/QUOTE]
The min and max can be any opposite corners of the cube, you see, to make a cube you just have to set those two points.
I assume you cannot imagine a cube so i drew you one :3
[IMG]http://puu.sh/1ZKg7[/IMG]
The red and green points are examples of those two opposite points just so you can better imagine it in 3D space.
How would I be able to get the last part of ex. model/human/group3/<Modelname>.
Wish to set the model by using different groups, so you get the same, male_xx but with another group.
Thanks for yer time :D
Hope this wont get me banned.
[IMG]http://puu.sh/1ZQ3Y[/IMG]
[highlight](User was banned for this post ("Off topic / dumb" - Craptasket))[/highlight]
[QUOTE=ash47;39524109]I want to save the "state" of a vehicle, it's position, angles, and velocity. It seemed simple enough, I managed to save position, and angle no worries. The problem comes with restoring the velocity, when I do AirBoat:SetVelocity(velocity), it doesn't do anything, I think it might be something to do with it's using an engine, so I'm wondering how I reference the engine, so I can save it's RPM etc, then restore it?[/QUOTE] Try AirBoat:SetLocalVelocity( vector )? Just a thought.
[QUOTE][url]http://puu.sh/1ZRUB[/url][/QUOTE]
I'm trying to make it so that I can log any commands ran by a user (I will replace print with a net function to log on the server when it's working), but it is not working correctly.
I have already logged RunConsoleCommand and filtered out all of my gamemode's commands, but I cannot get LocalPlayer:ConCommand() to log correctly.
Anybody know why?
[QUOTE=>>;39528864]I'm trying to make it so that I can log any commands ran by a user (I will replace print with a net function to log on the server when it's working), but it is not working correctly.
I have already logged RunConsoleCommand and filtered out all of my gamemode's commands, but I cannot get LocalPlayer:ConCommand() to log correctly.
Anybody know why?[/QUOTE]Dear mother of god.
Did you really just override basic functions to print them...
don't do that.
[lua]
local Player = FindMetaTable("Player")
local _oldPlayerConCommand = Player.ConCommand
function Player:ConCommand(str)
print(str)
_oldPlayerConCommand(self, str)
end
[/lua]
i'll try it that way in a moment
[editline]9th February 2013[/editline]
worked, im stupid
How would one center allign WordBox?
[lua]draw.WordBox(4,x,y,"Text","Default",Color(50,50,50,150),Color(255,255,255,200))[/lua]
Spawnmenu won't open in custom gamemode, cl_init, init and shared are pretty much empty apart from the essentials...
What's going on?
[QUOTE=jaooe;39529480]Spawnmenu won't open in custom gamemode, cl_init, init and shared are pretty much empty apart from the essentials...
What's going on?[/QUOTE]
Are you deriving from sandbox?
I still need help getting Hold Type to change during Run time, again it said it needed to be replicated to the client.
[QUOTE=Drakehawke;39529637]Are you deriving from sandbox?[/QUOTE]
Yeah.
[lua]
DeriveGamemode("sandbox")
[/lua]
[QUOTE=Crashty;39529452]How would one center allign WordBox?
[lua]draw.WordBox(4,x,y,"Text","Default",Color(50,50,50,150),Color(255,255,255,200))[/lua][/QUOTE]
[lua]
//to get the width of the wordbox you would have to do
surface.GetTextSize( text )
//if you want to align it to the centre of a derma element.
draw.WordBox(4, element:GetWide()/2 - width, element:GetTall()/2 - heightOfWordBox, "Text", "Default", Color(50,50,50,150), Color(255,255,255,200))
//else, you could do,
draw.WordBox(4, ScrW()/2 - width, ScrHl()/2 - heightOfWordBox, "Text", "Default", Color(50,50,50,150), Color(255,255,255,200))
//if you wanted to align it to the centre of the screen.
//not sure how to get the height of the text though.
[/lua]
[QUOTE=>>;39529762]surface.GetTextSize returns width, height
[lua]local w,h = surface.GetTextSize("nigeria")[/lua][/QUOTE]
Yeah sorry...
By the way, that freaked me out. I'm half Nigerian.
[QUOTE=jaooe;39529778]Yeah sorry...
By the way, that freaked me out. I'm half Nigerian.[/QUOTE]
i know :v:
[QUOTE=>>;39529829]i know :v:[/QUOTE]
What's my other half then?
[QUOTE=jaooe;39529964]What's my other half then?[/QUOTE]
korean
[editline]9th February 2013[/editline]
[t]http://i3.kym-cdn.com/entries/icons/original/000/006/227/1309291821012.jpg[/t]
Nope.
Back on-topic though, any help as to why my spawn menu isn't working?
[editline]9th February 2013[/editline]
[QUOTE=coolkid93;39527414]How would I be able to get the last part of ex. model/human/group3/<Modelname>.
Wish to set the model by using different groups, so you get the same, male_xx but with another group.
Thanks for yer time :D[/QUOTE]
What do you mean by group?
Like, all the male_x models?
or folders?
are you overriding the SpawnMenuOpen or SpawnMenuEnabled hooks for any reason
How do you make ULX ban someone via an addon.
I've tried
RunConsoleCommand("ulx ban", Sam, 5)
RunConsoleCommand("ulx ban", "Sam", "5")
RunConsoleCommand("ulx ban", ply:GetName(), "5")
RunConsoleCommand("ulx ban", v:Nick(), "5")
Can someone help me out here?
[QUOTE=Sam7100;39530966]How do you make ULX ban someone via an addon.
I've tried
RunConsoleCommand("ulx ban", Sam, 5)
RunConsoleCommand("ulx ban", "Sam", "5")
RunConsoleCommand("ulx ban", ply:GetName(), "5")
RunConsoleCommand("ulx ban", v:Nick(), "5")
Can someone help me out here?[/QUOTE]
[code]RunConsoleCommand( "ulx", "ban", ply:Nick(), 5 )[/code]
Assuming ply is the player object for the player you want to ban, and this is run clientside for a user who has ban permission on ulx, this should work.
How would you go around getting the number of players currently connected on the server?~
[QUOTE=>>;39530396]are you overriding the SpawnMenuOpen or SpawnMenuEnabled hooks for any reason[/QUOTE]
Nope.
[editline]9th February 2013[/editline]
[QUOTE=Mr.Tactical;39531043]How would you go around getting the number of players currently connected on the server?~[/QUOTE]
[lua]
for k,v in pairs(player.GetAll()) do
print(v:Nick())
end
[/lua]
Will print the nicknames of all players connected to the server.
[lua]
for k,v in pairs(player.GetAll()) do
print(v:Nick())
end
[/lua]
I know about that, but I'm wondering of a way to actually get the number of players and use it as an actual integer.
[QUOTE=Mr.Tactical;39531043]How would you go around getting the number of players currently connected on the server?~[/QUOTE]
[code]print( #player.GetAll() )[/code]
[QUOTE=thomasfn;39531282][code]print( #player.GetAll() )[/code][/QUOTE]
player.GetAll() returns a table of Player objects.
prefixing # to a table will give you the number of elements in that table.
[QUOTE=thomasfn;39531282][code]print( #player.GetAll() )[/code][/QUOTE]
Thank you!~
[editline]9th February 2013[/editline]
[QUOTE=jaooe;39531370]player.GetAll() returns a table of Player objects.
prefixing # to a table will give you the number of elements in that table.[/QUOTE]
Ah, I didn't know about that~
[QUOTE=Sam7100;39530966]How do you make ULX ban someone via an addon.
I've tried
RunConsoleCommand("ulx ban", Sam, 5)
RunConsoleCommand("ulx ban", "Sam", "5")
RunConsoleCommand("ulx ban", ply:GetName(), "5")
RunConsoleCommand("ulx ban", v:Nick(), "5")
Can someone help me out here?[/QUOTE]
It's RunConsoleCommand("ulx","ban")
Is it possible to add physics to a clientside model?
Sorry, you need to Log In to post a reply to this thread.