Garry's Mod Wiki

Revision Difference

SANDBOX:PlayerSpawnRagdoll#553224

<function name="PlayerSpawnRagdoll" parent="SANDBOX" type="hook"> <ishook>yes</ishook>⤶ <description>Called when a player attempts to spawn a ragdoll from the Q menu.</description> <realm>Server</realm> <args> <arg name="ply" type="Player">The player who attempted to spawn a ragdoll.</arg> <arg name="model" type="string">Path to the model of the ragdoll the player is attempting to spawn.</arg> </args> <rets> <ret name="" type="boolean">Should the player be able to spawn the ragdoll or not.</ret> </rets> </function> <example> <description>Stops non-admins from spawning ragdolls.</description> <code> function GM:PlayerSpawnRagdoll( ply, model ) if ( not ply:IsAdmin() ) then return false end end </code> </example>