• ConCommand blocked!
    8 replies, posted
I was wondering how to make certain commands allowed in following example: [lua] for k,v in pairs(player.GetAll()) do v:ConCommand("rp_toggleholster") v:ConCommand("rp_toggleholster") end [/lua] I get a "ConCommand blocked! (rp_toggleholster)" In my serverside console.
EDITED nevermind, misread my own code lol post the code for the rp_toggleholster command :)
Anything with toggle in the name will get blocked
[lua] function CCToggleHolster( ply, cmd, arg ) local weap = ply:GetActiveWeapon(); if( weap:IsValid() ) then local class = weap:GetClass(); if( class == "weapon_physcannon" or class == "weapon_physgun" or class == "gmod_tool" or class == "ts2_zipties" ) then return; end local holstered = !ClientVars["Holstered"]; ClientVars["Holstered"] = holstered; if( not holstered ) then weap:GetTable().Primary.PositionMode = 2; weap:GetTable().Primary.PositionTime = .3; weap:GetTable().Primary.PositionMul = 1; else weap:GetTable().Primary.PositionMode = 3; weap:GetTable().Primary.PositionTime = .3; weap:GetTable().Primary.PositionMul = 0; end RunConsoleCommand( "eng_toggleholster", "" ); end end concommand.Add( "rp_toggleholster", CCToggleHolster ); [/lua] [editline]08:18PM[/editline] [QUOTE=Tobba;22148026]Anything with toggle in the name will get blocked[/QUOTE] Really?
ok, good to know :p why on earth is it blocked tho?
Exploits
I have no idea.. Prehaps what Tobba Said?[U][/U][URL="http://www.facepunch.com/member.php?u=189868"][/URL]
[QUOTE=Freze;22147851]I was wondering how to make certain commands allowed in following example: [lua] for k,v in pairs(player.GetAll()) do v:ConCommand("rp_toggleholster") v:ConCommand("rp_toggleholster") end [/lua] I get a "ConCommand blocked! (rp_toggleholster)" In my serverside console.[/QUOTE] You have to change the name from rp_toggleholster to something without the word toggle in it. [editline]04:17PM[/editline] [QUOTE=Freze;22148032][lua] function CCToggleHolster( ply, cmd, arg ) local weap = ply:GetActiveWeapon(); if( weap:IsValid() ) then local class = weap:GetClass(); if( class == "weapon_physcannon" or class == "weapon_physgun" or class == "gmod_tool" or class == "ts2_zipties" ) then return; end local holstered = !ClientVars["Holstered"]; ClientVars["Holstered"] = holstered; if( not holstered ) then weap:GetTable().Primary.PositionMode = 2; weap:GetTable().Primary.PositionTime = .3; weap:GetTable().Primary.PositionMul = 1; else weap:GetTable().Primary.PositionMode = 3; weap:GetTable().Primary.PositionTime = .3; weap:GetTable().Primary.PositionMul = 0; end RunConsoleCommand( "eng_toggleholster", "" ); end end concommand.Add( "rp_toggleholster", CCToggleHolster ); [/lua] [editline]08:18PM[/editline] Really?[/QUOTE] For example change this line: [lua]concommand.Add( "rp_toggleholster", CCToggleHolster );[/lua] to [lua]concommand.Add( "rp_holster", CCToggleHolster );[/lua]
How about the fact he is using [lua]RunConsoleCommand[/lua] Change it to [lua]ConCommand[/lua]
Sorry, you need to Log In to post a reply to this thread.