Jump to content

i got a problem


Machine

Recommended Posts

myMarker = createMarker(2488.1000976563, -1667.5, 13.300000190735, 'cylinder', 2.0, 255, 0, 0, 150) 
function MarkerHit( killer, matchingDimension ) 
setTimer( givePlayerMoney, 1000, 0, hitElement, 10 ) 
end 
  
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) 
  

script must create marker and when player hit it he got 1000$

and i use timer to make him only can do it every 5 mins

but something wrong in it

Link to comment
myMarker = createMarker(2488.1000976563, -1667.5, 13.300000190735, 'cylinder', 2.0, 255, 0, 0, 150) 
function MarkerHit( killer, matchingDimension ) 
setTimer( givePlayerMoney, 1000, 0, hitElement, 10 ) 
end 
  
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) 
  

script must create marker and when player hit it he got 1000$

and i use timer to make him only can do it every 5 mins

but something wrong in it

Your code is wrong .. try this :

-- # Server Side ... 
  
local myMarker = createMarker( 2488.1000976563, -1667.5, 13.300000190735, 'cylinder', 2.0, 255, 0, 0, 150)  
local aTimerFlood = {       } 
  
function MarkerHit( hitElement, matchingDimension ) 
        if getElementType ( hitElement ) == "player" then 
            if isTimer ( aTimerFlood [ hitElement ] ) then return outputChatBox ("Please Wait a Minute!!!",hitElement,255,0,0) end 
                givePlayerMoney ( hitElement,1000 ) 
            aTimerFlood [ hitElement ] = setTimer (  
              function (    )  
            if isTimer ( aTimerFlood [ hitElement ] ) then  
            killTimer ( aTimerFlood [ hitElement ] ) 
            aTimerFlood [ hitElement ] = nil 
            end end 
            ,300000 
            , 
            1 
        ) 
    end 
end 
addEventHandler( "onMarkerHit", myMarker, MarkerHit,false ) 
  

Link to comment

try:

myMarker = createMarker(2488.1000976563, -1667.5, 13.300000190735, 'cylinder', 2.0, 255, 0, 0, 150) 
function MarkerHit( player ) 
    if getElementType(player) == "player" then 
    givePlayerMoney (1000, player) 
    setTimer( 
    destroyElement(myMarker) 
    30000, 1) 
    end 
end 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) 
  
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...