[KoG]Rouche Posted June 2, 2010 Share Posted June 2, 2010 How can I modify the commands ? /votemap >>> /new (for exemple) Link to comment
robhol Posted June 2, 2010 Share Posted June 2, 2010 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 Posted June 3, 2010 Share Posted June 3, 2010 (edited) Ok sorry Edited June 3, 2010 by Guest Link to comment
robhol Posted June 3, 2010 Share Posted June 3, 2010 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
[KoG]Rouche Posted June 5, 2010 Author Share Posted June 5, 2010 Quote add a "proxy" command with executeCommandHandler > How to use "executeCommandHandler" ? > What is the name of the ressource with all commands ? Admin ? Link to comment
50p Posted June 5, 2010 Share Posted June 5, 2010 executeCommandHandler executes a command. It makes player "type in" the command without him actually typing it. Link to comment
kevin11 Posted June 5, 2010 Share Posted June 5, 2010 he wants to change the command /votemap from race into /new Link to comment
50p Posted June 5, 2010 Share Posted June 5, 2010 kevin11 said: he wants to change the command /votemap from race into /new 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
dzek (varez) Posted June 5, 2010 Share Posted June 5, 2010 50p said: kevin11 said: he wants to change the command /votemap from race into /new 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
kevin11 Posted June 5, 2010 Share Posted June 5, 2010 50p said: kevin11 said: he wants to change the command /votemap from race into /new 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 Link to comment
[KoG]Rouche Posted June 6, 2010 Author Share Posted June 6, 2010 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. Link to comment
[KoG]Rouche Posted July 4, 2010 Author Share Posted July 4, 2010 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
[DMC] Posted July 4, 2010 Share Posted July 4, 2010 [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) im noooob and i even i know\ change commandhandler:P Link to comment
trajik Posted July 5, 2010 Share Posted July 5, 2010 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 Link to comment
MaddDogg Posted July 5, 2010 Share Posted July 5, 2010 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.. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now