Player.AddCount

From GMod Wiki

Jump to: navigation, search
Gamemode Function: Player.AddCount
Player.AddCount is a function that is defined in the Sandbox Gamemode and its derivatives.
Function
Syntax Player:AddCount( String type, Entity ent )
Description:
Adds an entity to the server limits table. This is used in sandbox mode to limit the number of objects a player can spawn.
Returns: nil
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.AddCount]Player.AddCount [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionThis example will add the entity wire_rfid_antenna to the player wire_rfid_antennas table.
Used onNewerServer.png
Code
 
local ply = self:GetOwner()
wire_rfid_antenna = ents.Create("gmod_wire_rfid_antenna")
ply:AddCount("wire_rfid_antennas", wire_rfid_antenna )
 
OutputNone


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox