umsg.PoolString

From GMod Wiki

Jump to: navigation, search
Function
Syntax umsg.PoolString( String value )
Where is this used?
Description:
Pools a User Message name. This adds a string to a table that is shared between the client and server. This is useful for strings that are being sent often.
Returns: nil
Part of Library: umsg
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Umsg.PoolString]Umsg.PoolString [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionPool the string "asdf."
Used onNewerServer.png
Code
 
--The string is pooled at the top of an entity's init file
umsg.PoolString("asdf")
 
function ENT:Use(activator,caller)
    --Make sure a player used this item
    if !activator:IsPlayer() then return false end
 
    --Send the player a usermessage
    umsg.Start("Hello",activator)
        umsg.String("asdf")
    umsg.End()
end
 
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox