Players able to pick up their cars?

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 :slight_smile:

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]

use this and check if the entity is a car, if it is then return false.

[editline]29th September 2013[/editline]

damn ninja’d

Thank you so much!