Garry's Mod Wiki

SANDBOX:PlayerSpawnProp

  boolean SANDBOX:PlayerSpawnProp( Player ply, string model )

Description

Called when a player attempts to spawn a prop from the Q menu.

Arguments

1 Player ply
The player who attempted to spawn a prop.
2 string model
Path to the model of the prop the player is attempting to spawn.

Returns

1 boolean
Should the player be able to spawn the prop or not.

Example

Stops non-admins from spawning props.

function GM:PlayerSpawnProp( ply, model ) if ( !ply:IsAdmin() ) then return false end end