Jump to content

help with marker !


Recommended Posts

Hello :mrgreen:

I have a problem in this script that I'm trying to put the command when the player is within the marker

:arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown:

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

-- # 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

-- # 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...