Jump to content

[Commands]Modify ?


Recommended Posts

Two options: either edit the resource that adds the command (not recommended in case of upgrades and in the case of client-side scripts, conflicts between your server and servers that actually use the -real- version) or add a "proxy" command with executeCommandHandler. The latter will leave the original command open. I don't think you can block it, because executeCommandHandler still uses ACL. Not sure about this though... (Can anybody confirm?)

Link to comment
  loler said:
i recommend the first option (the 2nd it isnt sure)

You don't have any idea what you're talking about, do you..

I already mentioned why the former is a bad idea. What you could do is copy that resource and modify and use the copy so it doesn't conflict with other server's resources. However, that still doesn't change the fact that you need to redo any changes if you want to update that resource.

Link to comment
  kevin11 said:
he wants to change the command /votemap from race into /new :P:P

He can change it within map manager resource or make a new resource with /new command which will execute /votemap command... It's been said above before me.

Link to comment
  50p said:
  kevin11 said:
he wants to change the command /votemap from race into /new :P:P

He can change it within map manager resource or make a new resource with /new command which will execute /votemap command... It's been said above before me.

its just kevin pressing random keys on keyboard w/out thinking

Link to comment
  50p said:
  kevin11 said:
he wants to change the command /votemap from race into /new :P:P

He can change it within map manager resource or make a new resource with /new command which will execute /votemap command... It's been said above before me.

srry didnt read

varez please dont think ur funny or anything i didnt read that part :x

Link to comment
  • 4 weeks later...

My map manager :

What must I edit to change the command changemap to new ? (for exemple)

addCommandHandler("[color=#BF0000]changemap[/color]", changeGamemodeMap_cmd, true)
 
function changeGamemode_cmd(source, command, gamemodeName,...)
   local mapName = #{...}>0 and table.concat({...},' ') or nil
source = source or serverConsole
 
local gamemode
if gamemodeName then
	gamemode = getResourceFromName(gamemodeName)
	if not isGamemode(gamemode) then
		outputMapManager("'"..gamemodeName.."' is not a valid gamemode.",source)
		return false
	end
else
	outputMapManager("Usage: /"..command.." gamemode [map]",source)
	return false
end
 
local map
if mapName then
	map = getMapFromName(mapName)
	if not isMap(map) then
		outputMapManager("'"..mapName.."' is not a valid map.",source)
		return false
	end
end
setInstigator( source )
changeGamemode(gamemode,map)
end
addCommandHandler("gamemode", changeGamemode_cmd, true)
addCommandHandler("changemode", changeGamemode_cmd, true)

Link to comment
  [KoG]Rouche said:
My map manager :

What must I edit to change the command changemap to new ? (for exemple)

addCommandHandler("[color=#BF0000]changemap[/color]", changeGamemodeMap_cmd, true)
 
function changeGamemode_cmd(source, command, gamemodeName,...)
   local mapName = #{...}>0 and table.concat({...},' ') or nil
source = source or serverConsole
 
local gamemode
if gamemodeName then
	gamemode = getResourceFromName(gamemodeName)
	if not isGamemode(gamemode) then
		outputMapManager("'"..gamemodeName.."' is not a valid gamemode.",source)
		return false
	end
else
	outputMapManager("Usage: /"..command.." gamemode [map]",source)
	return false
end
 
local map
if mapName then
	map = getMapFromName(mapName)
	if not isMap(map) then
		outputMapManager("'"..mapName.."' is not a valid map.",source)
		return false
	end
end
setInstigator( source )
changeGamemode(gamemode,map)
end
addCommandHandler("gamemode", changeGamemode_cmd, true)
addCommandHandler("changemode", changeGamemode_cmd, true)

xD im noooob and i even i know\

change commandhandler:P

Link to comment

it's simple you would just change

function doSomething()
outputChatBox ("you can preform less than basic script editing yayyyy")
 end
addCommandHandler("randomCommand", doSomething)

into:

function doSomething()
outputChatBox ("you can preform less than basic script editing yayyyy")
 end
addCommandHandler("theCommandIwant", doSomething)

and tadaaaa :shock:

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...