irinel1996 Posted September 8, 2011 Share Posted September 8, 2011 (edited) Hi! I've made a command, /LSA. But it only work's when I type /LSA with capital letters. I want to make it work in the same command, albeit with lower case letters. =/ Here is the first line: addCommandHandler("LSA",function(thePlayer) I don't want make another command with case letters. Thanks all! Edited September 8, 2011 by Guest Link to comment
JR10 Posted September 8, 2011 Share Posted September 8, 2011 Add it again with lower case letters, or just change it to lower case. Link to comment
SDK Posted September 8, 2011 Share Posted September 8, 2011 (edited) Read the wiki, you can make it ignore the case of the command. addCommandHandler("LSA",function(thePlayer) ... end, false, false) First false is for restricted access, just ignore that and put the default value (false) Second false is for case-insensitive Edit: Ah, no offense intended JR10 ^^. I was replying to the TS that he should read the addCommandHandler wikipage for more info. Edited September 8, 2011 by Guest Link to comment
JR10 Posted September 8, 2011 Share Posted September 8, 2011 Sorry, I never knew that. Link to comment
irinel1996 Posted September 8, 2011 Author Share Posted September 8, 2011 Well, I have 2 errors and one warning, look: SCRIPT ERROR: play\MSN_S.lua:35: unexpected symbol near '...' WARNING: Loading script failed play\MSN_S.lua:35: unexpected symbol near '...' ERROR: Client triggered serverside event RequestServerData, but event is not added serverside. Here you have the "FULL" command: addCommandHandler("LSA",function(thePlayer) ... end, false, false) if(isPedInVehicle(thePlayer)) then local theVehicle = getPedOccupiedVehicle(thePlayer) setElementPosition(theVehicle,1907.1351318359,-2491.1325683594,13.217620849609) else setElementPosition(thePlayer,1907.1351318359,-2491.1325683594,13.217620849609) end end) PD: I put it in my server.lua Sorry, I'm new in MTA. ___________ Thanks! Link to comment
SpUnKyMe Posted September 8, 2011 Share Posted September 8, 2011 addCommandHandler("LSA",function(thePlayer) if (isPedInVehicle(thePlayer)) then local theVehicle = getPedOccupiedVehicle(thePlayer) setElementPosition(theVehicle,1907.1351318359,-2491.1325683594,13.217620849609) else setElementPosition(thePlayer,1907.1351318359,-2491.1325683594,13.217620849609) end end,false,false) Link to comment
SDK Posted September 8, 2011 Share Posted September 8, 2011 Ah, if you're new I'd recommend not doing it that way (but it is correct tho!) function LSA_Command123(thePlayer) -- first create the function 'LSA_Command123' (you can rename it) if (isPedInVehicle(thePlayer)) then local theVehicle = getPedOccupiedVehicle(thePlayer) setElementPosition(theVehicle,1907.1351318359,-2491.1325683594,13.217620849609) else setElementPosition(thePlayer,1907.1351318359,-2491.1325683594,13.217620849609) end end -- then attach a command to the function addCommandHandler("LSA", LSA_Command123,false,false) Link to comment
irinel1996 Posted September 8, 2011 Author Share Posted September 8, 2011 Thanks all! It works perfectly. 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