Garry's Mod Wiki

SANDBOX:PlayerSpawnRagdoll

  boolean SANDBOX:PlayerSpawnRagdoll( Player ply, string model )

Description

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

Arguments

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

Returns

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

Example

Stops non-admins from spawning ragdolls.

function GM:PlayerSpawnRagdoll( ply, model ) if ( not ply:IsAdmin() ) then return false end end