• Things for RP
    6 replies, posted
How do I make something that is like /mug or /911? Is there a guide to making this somewhere? I googled it but nothing really came up.
You aren't going to be getting that stuff for free try posting on codehire and see if they have one someone can make for you but it might cost money.
Well, im not asking for someone to make it for me, im asking if there is a guide to make one myself. lol
I usually do something like this; no sense in overcomplicating a !, / chat system. All you do is concommand.Add and add console commands. Remember, if you add the concommand server-side, then it's executed on the server by the player, and if it's on client-side then it's executed client-side. Wrap them with [lua]if ( CLIENT ) then // Client code else // Server code end[/lua] if you're unsure. This needs to be on the SERVER! [lua]// // Simple Chat Command System - Josh 'Acecool' Moser // // Type !command to run a console command from the player, publically for all to see. // Type /command to run a console command from the player, privately for none to see. // hook.Add( "PlayerSay", "Acecool:ChatCommands", function ( Player, text, private ) // // Do /commands privately, !commands publicly // local _bSlash = string.StartWith( text, "/" ); local _bExclaim = string.StartWith( text, "!" ); if ( _bSlash || _bExclaim ) then Player:ConCommand( string.sub( text, 2 ) ); if ( !_bExclaim ) then return ""; end end end );[/lua] Chat commands added like so: [lua] concommand.Add( "motd", function( _p, _cmd, _args ) // Make the window, or whatever.. // vgui.Create( "DFrame" ); end );[/lua] For your mug, do a concommand.Add( "mug", .... and put code in there for what the function should do. Same with 911.
Because you're being so specific. Googling "how to make a /911 darkrp command" isn't going to get you anything. Searching "facepunch chat command" will.
Tip: Google like this - "chat command site:facepunch.com"
[QUOTE=spocksgirl94;43973995]How do I make something that is like /mug or /911? Is there a guide to making this somewhere? I googled it but nothing really came up.[/QUOTE] -snip-
Sorry, you need to Log In to post a reply to this thread.