Hey, I'm coding an addon and was wondering if it was possible to say, set an area where when the player walks in a hook is activated, derma menu or something. Is that possible? I was thinking of putting an invisible prop so as to when the character triggers the collision it can start up my hook, but I can't seem to find any oncollide commands. I was wondering if there was any way to do/workaround this?
I'm in my 3rd year of comp sci, so this shouldn't be too hard. I would really appreciate it if someone would add me on skype or something just to clear up small questions that I have. Hate having to look around the lack of information wiki.garrysmod gives me yet go by the outdated info on maurits. Had to search for 4 hours before I found out getNWInt needed 2 paramaters rather than 1.
Thanks!
You can do that using a brush entity, however that will require to edit the map.
Or you can check player position in a think hook.
[QUOTE=Robotboy655;42140696]You can do that using a brush entity, however that will require to edit the map.
Or you can check player position in a think hook.[/QUOTE]
How would I do that? to use a think hook to check player is within a certain vector? Sample of code please?
Check if players position is within the area by comparing every axis of his :GetPos() to the bounds you have. Of course this method is shitty.
[QUOTE=Robotboy655;42145103]Check if players position is within the area by comparing every axis of his :GetPos() to the bounds you have. Of course this method is shitty.[/QUOTE]
I'm assuming this is the only way to accomplish this without editing the map then?
function Popmenu(pl)
if pl:GetPos() >= Vector(0,0,0) then
print("succeed")
end
end
concommand.Add("print", Popmenu)
any reason that doesn't work?
Perhaps because your position is less then Vector(0, 0, 0)?
Sorry, you need to Log In to post a reply to this thread.