[KoG]Rouche Posted June 2, 2010 Posted June 2, 2010 How can I modify the commands ? /votemap >>> /new (for exemple) Owner of Killer of GTA (Old =KoG= Servers)
robhol Posted June 2, 2010 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?) Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
loler Posted June 3, 2010 Posted June 3, 2010 (edited) Ok sorry Edited June 3, 2010 by Guest M T A Note:SAMP SUCKS BADLY!!! Note: People in fire are SAMP
robhol Posted June 3, 2010 Posted June 3, 2010 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. Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
[KoG]Rouche Posted June 5, 2010 Author Posted June 5, 2010 add a "proxy" command with executeCommandHandler > How to use "executeCommandHandler" ? > What is the name of the ressource with all commands ? Admin ? Owner of Killer of GTA (Old =KoG= Servers)
50p Posted June 5, 2010 Posted June 5, 2010 executeCommandHandler executes a command. It makes player "type in" the command without him actually typing it. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
kevin11 Posted June 5, 2010 Posted June 5, 2010 he wants to change the command /votemap from race into /new
50p Posted June 5, 2010 Posted June 5, 2010 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. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
dzek (varez) Posted June 5, 2010 Posted June 5, 2010 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 Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
kevin11 Posted June 5, 2010 Posted June 5, 2010 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
[KoG]Rouche Posted June 6, 2010 Author 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. Owner of Killer of GTA (Old =KoG= Servers)
[KoG]Rouche Posted July 4, 2010 Author 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) Owner of Killer of GTA (Old =KoG= Servers)
[DMC] Posted July 4, 2010 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) im noooob and i even i know\ change commandhandler:P
trajik Posted July 5, 2010 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
MaddDogg Posted July 5, 2010 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..
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