Garry's Mod Wiki

SANDBOX:PlayerSpawnNPC

  boolean SANDBOX:PlayerSpawnNPC( Player ply, string npc_type, string weapon )

Description

Called to ask if player allowed to spawn a particular NPC or not.

Arguments

1 Player ply
The player that wants to spawn that NPC
2 string npc_type
The npc type that player is trying to spawn
3 string weapon
The weapon of that NPC

Returns

1 boolean
Return false to disallow spawning that NPC