JuniorMelo Posted June 12, 2013 Share Posted June 12, 2013 Hello I have a problem in this script that I'm trying to put the command when the player is within the marker marker = createMarker ( 2786.16235, 1222.62122, 09.85634, "cylinder", 1.5, 255, 255, 255, 200 ) function weapon ( player ) giveWeapon ( player, 24 , 100 ) end addCommandHandler ( "give" , weapon ) addEventHandler ( "onMarkerHit", marker, weapon ) Sorry My english Link to comment
iPrestege Posted June 12, 2013 Share Posted June 12, 2013 -- # Server Side : local marker = createMarker ( 2786.16235, 1222.62122, 09.85634, "cylinder", 1.5, 255, 255, 255, 200 ) local isCommandHandler = nil addEventHandler ( "onMarkerHit", marker, function ( player ) if getElementType ( player ) == 'player' then if isCommandHandler ~= true then addCommandHandler ( 'give',GiveWeaponHandler ) isCommandHandler = true else outputChatBox('* You are already handle it!',player,255,0,0) end end end,false ) function GiveWeaponHandler ( player ) giveWeapon ( player,24,100 ) end You mean that? Link to comment
JuniorMelo Posted June 12, 2013 Author Share Posted June 12, 2013 no I'm trying to put to be able to type the command /give when is within the marker ( local marker = createMarker ) Link to comment
iPrestege Posted June 12, 2013 Share Posted June 12, 2013 -- # Server Side : local marker = createMarker ( 2786.16235, 1222.62122, 09.85634, "cylinder", 1.5, 255, 255, 255, 200 ) function GiveWeaponHandler ( player ) if isElementWithinMarker ( player,marker ) then giveWeapon ( player,24,100 ) end end addCommandHandler('give',GiveWeaponHandler) Try this. 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