MatXpl Posted October 16, 2010 Share 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 Link to comment
50p Posted October 16, 2010 Share 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 ... Link to comment
MatXpl Posted October 17, 2010 Author Share 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... Link to comment
dzek (varez) Posted October 17, 2010 Share 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.. Link to comment
MatXpl Posted October 17, 2010 Author Share Posted October 17, 2010 thanks !! I understand my errors now ! Link to comment
CowTurbo Posted October 17, 2010 Share Posted October 17, 2010 https://wiki.multitheftauto.com/wiki/IsElementWithinMarker read it look example 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