MatXpl Posted October 16, 2010 Posted October 16, 2010 Hi! I have question. How to make command "/command" only if player is in the marker Sory for my bad english Pls help MTA:SA scripts/gamemodes/misc: http://www.mtasa.xn.pl
50p Posted October 16, 2010 Posted October 16, 2010 Check if player is in a marker.. ... if isElementWithinMarker( player, marker ) then -- checking if player is in a marker -- rest of your command code here end ... - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
MatXpl Posted October 17, 2010 Author Posted October 17, 2010 local marker1 = createMarker( 1599.6259765625, 1815.3583984375, 10.026741409302, 'cylinder', 2.0, 0, 250, 0, 150 ) function duty(thePlayer, matchingDimension) if isElementWithinMarker(thePlayer, leczenie1) then outputChatBox("/cm", thePlayer, 0, 255, 0) addCommandHandler ("cm", bad) end end function bad ( thePlayer ) setElementHealth ( thePlayer, 200 ) end It shows marker, but command dosn't work... MTA:SA scripts/gamemodes/misc: http://www.mtasa.xn.pl
dzek (varez) Posted October 17, 2010 Posted October 17, 2010 WTF IS THIS? This is first one and the last one I'm fixing something for you - just to let you know the correct way. But dude - learn scripting. Read THE BASICS until you get them, don't skip anything. You CAN'T just put random words and willing it to work. What is "leczenie1", when you are triggering this ugly function called "duty"? ONE -- BIG -- MESS. local marker1 = createMarker( 1599.6259765625, 1815.3583984375, 10.026741409302, 'cylinder', 2.0, 0, 250, 0, 150 ) function bad(playerSource, command) if isElementWithinMarker(playerSource) then outputChatBox("/cm", playerSource, 0, 255, 0) -- this one is weird - to "display" entered command, but whatever setElementHealth(playerSource, 200) end end addCommandHandler("cm", bad) now: CLICK HERE ** CLICK HERE ** CLICK HERE And if you ignore what I wrote and reply only "thanks" or even nothing.. argh.. 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)!
MatXpl Posted October 17, 2010 Author Posted October 17, 2010 thanks !! I understand my errors now ! MTA:SA scripts/gamemodes/misc: http://www.mtasa.xn.pl
CowTurbo Posted October 17, 2010 Posted October 17, 2010 https://wiki.multitheftauto.com/wiki/IsElementWithinMarker read it look example http://mrteamgaming.eu
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