• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
[solved].
[QUOTE=Exho;45908815]Is it possible to create/remove Cubemaps and then save the map with them?[/QUOTE] I don't think you can do it within GMod without it crashing. I believe you have to go to HL2/EP2 and do it there.
[QUOTE=Teddi Orange;45902980]Just a general question here, and I know how to work around it (and have done for years) but it's a tad annoying really so I figured I'd ask. Why is it that InitialPlayerSpawn always seems to almost fail every time at applying properties to a player (eg Lock, player movement and so on) just after they load, whereas PlayerSpawn will be successful no matter what (again, talking just after they've loaded). Is InitialPlayerSpawn more like a 'PrePlayerSpawn'?[/QUOTE] Correct me if I'm wrong, but I think InitialPlayerSpawn runs while the player is still loading in, usually during Sending Client Info
[QUOTE=NiandraLades;45911973]Correct me if I'm wrong, but I think InitialPlayerSpawn runs while the player is still loading in, usually during Sending Client Info[/QUOTE] You're right, but so does PlayerSpawn from what I can see.
[QUOTE=Teddi Orange;45912530]You're right, but so does PlayerSpawn from what I can see.[/QUOTE] I agree. I had trouble setting stuff on the player durning both hooks. I now use the game event "player_spawn" and haven't had a problem.
Whats the function for getting a players speed?
[QUOTE=alex578344;45913622]Whats the function for getting a players speed?[/QUOTE] GetVelocity?
How would I check for a players speed constantly, could you give an quick example function please?
[code] local function SpeedCheckUrPrivilege() for k,v in pairs(player.GetAll()) do if v:GetVelocity():Length() > 300 then v:Kill() v:ChatPrint("Stop sprinting u fcuking scrube u aint Sanic m8") end end end hook.Add("Think", "SlowTheFuckDownAsshole", SpeedCheckUrPrivilege) [/code]
Thanks a lot
I updated it, it'll look better now
Hey I have a server which has been linked with my workshop/fastdl and I have noticed that I have way more .gma files in my addons folder compared to how many im using from workshop/fastdl. So i was wondering this may be due to me deleting a few of the addons ive 'tested' from the workshop then removed later, but do they stay in the addons folder after they've been removed from fastdl/workshop? I know this question could be fairly obvious, but I want to make sure, as I would rather not mess up the server files. The only reason I ask this is because i think this could speed up the loading time for users who join..
Yes, they stay; you have to manually remove the ones you don't use ( which is why the ds_<wsid> naming is meh; I'd recommend copying the gma files from the client to the server so you'll know what they are, and if you want the client to download them do resource.AddWorkshop( <wsid> ); ) otherwise they'll continue to load on the server.
Many thanks, I am never really clear with an explanation of my issues, but you helped me! ;D
Why doesn't this work. I'm stuck on how to incorporate the math into the function that I have. Its just this section [CODE] local speed = (math.floor(v:GetVelocty():Length())) v:ChatPrint("You are travelling at " .. speed .. "mph")[/CODE]
[QUOTE=alex578344;45914533]Why doesn't this work. I'm stuck on how to incorporate the math into the function that I have. Its just this section [CODE] local speed = (math.floor(v:GetVelocty():Length())) v:ChatPrint("You are travelling at " .. speed .. "mph")[/CODE][/QUOTE] Shows us your whole code, not just the part that doesn't work.
[CODE]AddCSLuaFile("autorun/client/script_cl_init.lua") AddCSLuaFile("autorun/script_shared.lua") -- files in autorun are ran automatically by the game function OnPlayerSpawn( ply ) --PlayerInitialSpawn has one argument print( "Initial Spawn is working") end hook.Add( "PlayerInitialSpawn", "myaddon_PlayerInitialSpawn", whenplayerspawn ) -- in addons you use hook.Add, GM:* stuff is for GAMEMODES -- There's no such hook as "InVehicle". There's a hook called "PlayerEnteredVehicle" though local function PlayerEnterVehicle( ply , veh , role) -- Localize functions so they are not overridden by other addons. end hook.Add( "PlayerEnteredVehicle", "PlayerEnterVehicle", PlayerEnterVehicle ) local function checkPlayerSpeed() for k,v in pairs(player.GetAll()) do if v:GetVelocity():Length() > 200 then v:Kill() local speed = (math.floor(v:GetVelocty():Length())) v:ChatPrint("You are travelling at " .. speed .. "mph") end end end hook.Add("Think", "SpeedCheck", checkPlayerSpeed) [/CODE]
[QUOTE=alex578344;45914533]Why doesn't this work. I'm stuck on how to incorporate the math into the function that I have. Its just this section [CODE] local speed = (math.floor(v:GetVelocty():Length())) v:ChatPrint("You are travelling at " .. speed .. "mph")[/CODE][/QUOTE] It's not mph, it's Hammer Units per Tick as far as I can tell. [editline]7th September 2014[/editline] [url]https://developer.valvesoftware.com/wiki/Dimensions[/url]
Yeah I was sort of going to make up my own unit of speed. lol but anyway it still didn't output anything to chat
An inch is 4 / 3 units; a foot is 16 units. [code]// 1 unit = 0.75 inches. // 4/3 units = 1 inch - from this we base our calculations. CONVERSION_UNITS_TO_INCHES = 4 / 3; // 4/3 units per 1 inch, 16 units per foot CONVERSION_UNITS_TO_FEET = CONVERSION_UNITS_TO_INCHES * 12; // == 16 in game units CONVERSION_UNITS_TO_METERS = 0.0254 / CONVERSION_UNITS_TO_INCHES; UNITS_PER_METER = 39.3701 * CONVERSION_UNITS_TO_INCHES; -- print( 9.81 * CONVERSION_UNITS_TO_METERS, 9.81 * UNITS_PER_METER ); // Crap choices... CONVERSION_UNITS_TO_METERS = CONVERSION_UNITS_TO_FEET * 0.3048; -- 1 foot = 0.3048 meters. 16 units = 1 foot... CONVERSION_UNITS_TO_MILES = CONVERSION_UNITS_TO_FEET * 5280; CONVERSION_UNITS_TO_KILOMETERS = CONVERSION_UNITS_TO_FEET * 3280.84; CONVERSION_UNITS_TO_MPH = CONVERSION_UNITS_TO_INCHES * 17.6; CONVERSION_UNITS_TO_KPH = CONVERSION_UNITS_TO_INCHES * 10.936133;[/code] Use the Length( ) / CONVERSION_UNITS_TO_MPH to get MPH.
[QUOTE=alex578344;45914543][CODE] local speed = (math.floor(v:GetVelocty():Length())) [/CODE][/QUOTE] You misspelled GetVelocity()
-snip, nvm found it on wiki. sorry -
[QUOTE=docdo1;45915587]-snip, nvm found it on wiki. sorry -[/QUOTE] return ""
I was trying to delete a row of data from my sql db but it ends up deleting all rows that are remotely similar to it. I tried adding LIMIT 1 but this thing is throwing a syntax error: code: [code] "DELETE FROM Market WHERE unique_id='"..id.."' AND item='"..item.."' AND category='"..category.."' AND amount='"..amount.."' AND price='"..price.."' LIMIT 1" [/code] Also I kept reading about primary keys in other sql database websites , but the gmod wiki never clarifies much on it. Is that something you would recommend for this or should my method work just fine with a LIMIT of 1. Code to create a table: [code] "CREATE TABLE Market ( unique_id varchar(255), name varchar(255), item varchar(255), category varchar(255), amount int, price int)" [/code]
Add a column named 'Key' or 'ID' (usually named like this), that's an UNSIGNED INT, PRIMARY KEY and AUTO_INCREMENT. That will give all your new created items a number which you can then use to delete exact rows you want. You should always have a INT PK AI column in you table. Always.
I've been looking all over: I'd like to know the console command to display the 'paths' nextbots are taking ie: Visualizing their MoveToPos. I've seen plenty of videos/screenshots of people having this turned on, but I can't seem to find the command? EDIT: I mean, I want this information: [T]http://i.imgur.com/QVD29YS.jpg[/T]
I have a weird glitch in my custom WIP gamemode where if a player pushes Y to talk with chat nothing happens. Instead your view angles are pushed up (so you are looking at the sky) and garrysmod refuses any keyboard input ;3; im lost here.
[QUOTE=TripsLetash;45917793]I've been looking all over: I'd like to know the console command to display the 'paths' nextbots are taking ie: Visualizing their MoveToPos. I've seen plenty of videos/screenshots of people having this turned on, but I can't seem to find the command? EDIT: I mean, I want this information: [T]http://i.imgur.com/QVD29YS.jpg[/T][/QUOTE] Correct me if i'm wrong, but NextBot uses Navigation meshes. So you should be able to draw all that stuff with these commands. [url]https://developer.valvesoftware.com/wiki/Navigation_Mesh_Commands[/url]
Yes, they do! The image shown is using a navigation mesh. There is a command that allows you to see the 'path' the nextbot is 'thinking'. The command is not listed on the dev page either :( (or I'm blind)
The movetopos function has an option to draw those. [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/base/entities/entities/base_nextbot/sv_nextbot.lua#L263-L265[/url]
Sorry, you need to Log In to post a reply to this thread.