Player.GetInfo
From GMod Wiki
Function | |
Syntax | Player:GetInfo( String clientconvar ) |
Description: | |
Grabs a convar string from the client, this is used in stool code. | |
Returns: | String |
In Object: | Player |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Player.GetInfo]Player.GetInfo [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Example code from the gmod_tool swep. |
---|---|
Used on | |
Code | Defined in (Source Code)
//This part is from the gmod_tool code. Basically an alias. function ToolObj:GetClientInfo( property ) local mode = self:GetMode() return self:GetOwner():GetInfo( mode.."_"..property ) end Defined in (Source Code) //This part is from the Material stool code. function TOOL:LeftClick( trace ) if !( trace.Entity && // Hit an entity trace.Entity:IsValid() && // And the entity is valid trace.Entity:EntIndex() != 0 // And isn't worldspawn ) then return end local mat = self:GetClientInfo( "override" ) SetMaterial( self:GetOwner(), trace.Entity, { MaterialOverride = mat } ) return true end |
Output | N/A |