Hello,
Am having problem here...
How do can i set for ranks to be able touch everyone prop ? For exapmle for moderator rank. Using ULX i can set only player physc gun.
Sorry for mah bad english spelling... hope you get what i meant :(
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PhysgunPickup]GM/PhysgunPickup[/url]
Return true if the player is a certain rank or owner of the prop.
So and how do i make it for props and moderator rank ?
[QUOTE=Grizly;47503615]So and how do i make it for props and moderator rank ?[/QUOTE]
Do what Greetings said, in conjunction with the [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/IsUserGroup]Player:IsUserGroup[/url] function.
[QUOTE=r0uge;47503685]Do what Greetings said, in conjunction with the [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/IsUserGroup]Player:IsUserGroup[/url] function.[/QUOTE]
This : ?
[code]
function PlayerPickup( ply, ent )
if Player:IsUserGroup() and ent:GetClass():lower() == "moderator" then
return true
end
end
hook.Add( "PhysgunPickup", "Allow Prop Pickup", PropPickup )
[/code]
[QUOTE=Grizly;47503729]This : ?
[code]
function PlayerPickup( ply, ent )
if Player:IsUserGroup() and ent:GetClass():lower() == "moderator" then
return true
end
end
hook.Add( "PhysgunPickup", "Allow Prop Pickup", PropPickup )
[/code][/QUOTE]
No, check if the user group is "moderator" and the ents class is a prop
[editline]11th April 2015[/editline]
also, you haven't defined what"Player" is
[QUOTE=smithy285;47503737]No, check if the user group is "moderator" and the ents class is a prop
[editline]11th April 2015[/editline]
also, you haven't defined what"Player" is[/QUOTE]
Now am confused... isnt that only for player pickup ?
[QUOTE=Grizly;47503933]Now am confused... isnt that only for player pickup ?[/QUOTE]
What are you on about???
[QUOTE=r0uge;47503937]What are you on about???[/QUOTE]
That Moderator rank can pickup other player props and remove them
It doesn't matter what the function is called -_-
[CODE]
function PlayerPickup( ply, ent )
if ply:IsUserGroup( "moderator" ) and ent:GetClass() == "prop_*" then
return true
end
end
hook.Add( "PhysgunPickup", "Allow Prop Pickup", PropPickup )
[/CODE]
I think that should work...
How can people be this dumb.
As stated before, but obviously ignored, Player isn't defined.
What is going on in this thread
1. [I]Localize your functions[/I] if you're not calling them outside that file.
2. Player isn't defined. ply is.
[code]
local function modpickup( ply, ent )
if (ply:IsUserGroup( "moderator" ) and ent:GetClass() == "prop_*") then
return true
end
end
hook.Add( "PhysgunPickup", "moderator_allowpickup", modpickup )
[/code]
And here's how to make them be able to toolgun things
[code]
local function modtool( ply, tr, tool )
if (ply:IsUserGroup( "moderator" ) and tr.Entity and tr.Entity:GetClass() == "prop_*") then
return true
end
end
hook.Add( "CanTool", "moderator_allowtoolgun", modtool )
[/code]
[URL="https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index2bde.html"]Useful for learning how to Lua[/URL]
[URL="https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7a06.html"]A more in depth tutorial series[/URL]
[URL="http://facepunch.com/showthread.php?t=1337945"]The Holy Grail of getting into Lua[/URL]
[QUOTE=Lolcats;47509337]What is going on in this thread
1. [I]Localize your functions[/I] if you're not calling them outside that file.
2. Player isn't defined. ply is.
[code]
local function modpickup( ply, ent )
if (ply:IsUserGroup( "moderator" ) and ent:GetClass() == "prop_*") then
return true
end
end
hook.Add( "PhysgunPickup", "moderator_allowpickup", modpickup )
[/code]
And here's how to make them be able to toolgun things
[code]
local function modtool( ply, tr, tool )
if (ply:IsUserGroup( "moderator" ) and tr.Entity and tr.Entity:GetClass() == "prop_*") then
return true
end
end
hook.Add( "CanTool", "moderator_allowtoolgun", modtool )
[/code]
[URL="https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index2bde.html"]Useful for learning how to Lua[/URL]
[URL="https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7a06.html"]A more in depth tutorial series[/URL]
[URL="http://facepunch.com/showthread.php?t=1337945"]The Holy Grail of getting into Lua[/URL][/QUOTE]
Still cMod cant move other props
[QUOTE=Grizly;47510148]Still cMod cant move other props[/QUOTE]
What are the exact names of your user groups?
[QUOTE=r0uge;47510579]What are the exact names of your user groups?[/QUOTE]
superadmin/admin/moderator/vio/trusted/user(default)
Sorry, you need to Log In to post a reply to this thread.