• Custom Concommands
    3 replies, posted
How do I add args to con commands? (I am not sure if thats how you say it just bare with me.) I tried [QUOTE] local getargsmoney = return float concommand.Add('give ' .. getargsmoney,function() GMoney = GMoney + getargsmoney end) [/QUOTE] I am trying to make it do this: give 2500 < this would give me $2500
Please use CODE tags instead of QUOTE tags. You'll want to do this: [CODE] concommand.Add('give', function( ply, cmd, args ) <-- HERE! GMoney = GMoney + args[1] -- Use args[<number] to get a specific argument. (ie. args[1]) end) [/CODE]
Thank you
[QUOTE=Bubbie;50540163]Please use CODE tags instead of QUOTE tags. You'll want to do this: [CODE] concommand.Add('give', function( ply, cmd, args ) <-- HERE! GMoney = GMoney + args[1] -- Use args[<number] to get a specific argument. (ie. args[1]) end) [/CODE][/QUOTE] [CODE] concommand.Add('give', function( ply, cmd, args ) <-- HERE! GMoney = GMoney + args[1] -- Use args[<number] to get a specific argument. (ie. args[1]) end) [/CODE] Don't forget to press the tab key!
Sorry, you need to Log In to post a reply to this thread.