• Players able to pick up their cars?
    3 replies, posted
So I'm opening a server soon, I'm still testing it, and I found out that my friend can pick up his car, and use it as a weapon.. similar to prop killing, but even more dangerous. I want to make it that users cannot pick up cars. I'm running Dark 2.4.3, ULX. Any help would be very helpful.
For that, we hook into PhysgunPickup, which is in the shared realm. Put this in a shared file :-) I made it so admins and super admins can still pick it up. If you want no one to pick it up, use the second example. [lua]hook.Add( "PhysgunPickup", "NoCarNoNoNotYouNoCarNotYou", function( _p, _ent ) if ( _ent:IsVehicle( ) && ( !_p:IsAdmin( ) || !_p:IsSuperAdmin( ) ) ) then return false; end end );[/lua] [lua]hook.Add( "PhysgunPickup", "NoCarNoNoNotYouNoCarNotYou", function( _p, _ent ) if ( _ent:IsVehicle( ) ) then return false; end end );[/lua]
[url]http://wiki.garrysmod.com/page/GM/PhysgunPickup[/url] use this and check if the entity is a car, if it is then return false. [editline]29th September 2013[/editline] damn ninja'd
[QUOTE=Acecool;42349835]For that, we hook into PhysgunPickup, which is in the shared realm. Put this in a shared file :-) I made it so admins and super admins can still pick it up. If you want no one to pick it up, use the second example. [lua]hook.Add( "PhysgunPickup", "NoCarNoNoNotYouNoCarNotYou", function( _p, _ent ) if ( _ent:IsVehicle( ) && ( !_p:IsAdmin( ) || !_p:IsSuperAdmin( ) ) ) then return false; end end );[/lua] [lua]hook.Add( "PhysgunPickup", "NoCarNoNoNotYouNoCarNotYou", function( _p, _ent ) if ( _ent:IsVehicle( ) ) then return false; end end );[/lua][/QUOTE] Thank you so much!
Sorry, you need to Log In to post a reply to this thread.