Hello, I have two questions,
First of all, is it normal that a hunter can't pick up random props around the map with "E"? So like you can pick up items to check if they are humans or not,
If it's normal hunters can't do this, is there any way to enable it? Because i'd like to enable it in my server.
Second, is there any code or custom prophunt gamemode online for free that enables props to rotate themself? For example by holding right click.
Thanks in advance
[QUOTE=Enforcerke;47180001]Hello, I have two questions,
First of all, is it normal that a hunter can't pick up random props around the map with "E"? So like you can pick up items to check if they are humans or not,
If it's normal hunters can't do this, is there any way to enable it? Because i'd like to enable it in my server.
Second, is there any code or custom prophunt gamemode online for free that enables props to rotate themself? For example by holding right click.
Thanks in advance[/QUOTE]
1. The prop can be picked up if it is supposed to be picked up. There are some random props in maps not to be picked up.
[QUOTE=SteppuFIN;47180175]1. The prop can be picked up if it is supposed to be picked up. There are some random props in maps not to be picked up.[/QUOTE]
I really, as a hunter, can't pick up anything, also, which version should I use from prophunt?
I'm using: [url]http://steamcommunity.com/sharedfiles/filedetails/?id=135509255[/url]
at the moment
Here you go: [url]http://wiki.garrysmod.com/page/GM/AllowPlayerPickup[/url]
If you're modifying behavior use hook.Add and only return true / false for SPECIFIC behavior because it will prevent the GM: function from firing if non-nil value is returned.
If you're writing a game-mode use the GM: function..
You could set up a system so that if a player is holding attack2 that based on the ▲Pitch/Yaw/Roll, that ▲ value is applied to the prop angles by setting them... ▲ = Delta, or the change-in meaning if Yaw was 100 and you moved +10 then the ▲Yaw would be 10 for that frame or so.. Then you can have smooth rotation..
You can do that all on the server but you could also use a shared hook... Some to look at would be InputMouseApply, SetupMove, CreateMove, Move... on the wiki. [url]http://wiki.garrysmod.com/[/url]
Also, Welcome to Facepunch, here are some helpful posts, etc..
Generalized Lua Help ( Links to Wikis, Answers the question of "Where do I post a simple question or DarkRP Specific question", links to other resources compiled by forum members )
[url]https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_general_lua_learning.lua.html[/url]
Useful Programs ( SteamCMD, Autosizer, Desktops, Process Explorer ) and Notepad++ Upgrades
[url]https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_useful_programs_and_notepadpp_upgrades.lua.html[/url]
[QUOTE=Acecool;47180229]Here you go: [url]http://wiki.garrysmod.com/page/GM/AllowPlayerPickup[/url]
If you're modifying behavior use hook.Add and only return true / false for SPECIFIC behavior because it will prevent the GM: function from firing if non-nil value is returned.
If you're writing a game-mode use the GM: function..
You could set up a system so that if a player is holding attack2 that based on the ▲Pitch/Yaw/Roll, that ▲ value is applied to the prop angles by setting them... ▲ = Delta, or the change-in meaning if Yaw was 100 and you moved +10 then the ▲Yaw would be 10 for that frame or so.. Then you can have smooth rotation..
You can do that all on the server but you could also use a shared hook... Some to look at would be InputMouseApply, SetupMove, CreateMove, Move... on the wiki. [url]http://wiki.garrysmod.com/[/url]
Also, Welcome to Facepunch, here are some helpful posts, etc..
Generalized Lua Help ( Links to Wikis, Answers the question of "Where do I post a simple question or DarkRP Specific question", links to other resources compiled by forum members )
[url]https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_general_lua_learning.lua.html[/url]
Useful Programs ( SteamCMD, Autosizer, Desktops, Process Explorer ) and Notepad++ Upgrades
[url]https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_useful_programs_and_notepadpp_upgrades.lua.html[/url][/QUOTE]
Thanks for the info,
Can I maybe ask where I should imply this, in which file should I do this?
bump,
Where should I create a function to do the prop rotation? with lua file etc?
Response via PM:
I'd recommend using SetupMove hook which is shared. You can detect IN_ keys natively using _p:KeyDown( IN_ATTACK2 ) and you can also check the _p:EyeAngles( ), and get the change of eye angles from the previous frame ( basically set up a previous example so....
[code]
// Inside SetupMove shared hook would work if InputMouseApply isn't shared.
if ( _p:KeyDown( IN_ATTACK2 ) then
local _ang = _p:EyeAngles( );
local _last_ang = ( _p.LastAng && _p.LastAng || _ang );
local _difference_y = math.AngleDifference( _ang.y, _last_ang.y );
local _difference_x = math.AngleDifference( _ang.x, _last_ang.x );
_p.LastAng = _ang;
// This is where you'd modify the prop angle based on the data...
-- ...
end[/code]
is the basic format... Then, based on the difference values you can modify your rotation ( inside the if statement with the IN_ATTACK2 KeyDown call... )...
Hopefully this helps. Feel free to add me on Steam.
REMOVED
I've tried something new and put this in init.lua, still doesn't work:
[LUA]function PropOrientationLock( ply )
local yaxis = ply:GetAngles().y
local zaxis = ply:GetAngles().z
local axislock = Vector(ply:GetAngles().x,yaxis+0,zaxis+0)
ply:SetAngles( axislock)
end
hook.Add("PlayerBindPress","PH_Orientation", function(ply, bind, pressed)
if (pressed and bind == "+attack2" and ply:team() == TEAM_PROPS) then
PropOrientationLock()
end
end)[/LUA]
Sorry, you need to Log In to post a reply to this thread.