Jump to content

[Commands]Modify ?


Recommended Posts

Posted

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?)

Posted
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.

Posted

executeCommandHandler executes a command. It makes player "type in" the command without him actually typing it.

Posted
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.

Posted
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

Posted
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

Posted

I must create a new script with executecommandhandler and the command i want to change.

If i don't know how to script that :(

I'll go to see in the mapmanager.

  • 4 weeks later...
Posted

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)

Posted
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

Posted

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:

Posted

And robhol's second way would look like this:

-- your function + command handler ...
 
 
addCommandHandler("new",
function (player)
executeCommandHandler("changemap", player)
end
)

Untested and I'm tired..

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...