Jump to content

Farmer


Desaster

Recommended Posts

this is the beginning of a script i am posting it for my friend I can't find why it don't work

local createTeam ( "farmer", 0, 255, 0 ) 
local Marker = createMarker ( 670.69952392578, 906.75018310547, -40.3984375, "cylinder", 1, 255, 255, 255, 0 ) 
local Elem = createObject ( 3409, 670.69952392578, 906.75018310547, -40.3984375, 90, 0, 0 ) 
function onmarkethit() 
   if ( weapon == 23 ) then 
       destroyElement ( Elem ) 
       destroyElement ( Marker ) 
       givePlayerMoney ( source, 5000 ) 
    end 
   else end 

Link to comment
createTeam ( "farmer", 0, 255, 0 ) 
local Marker = createMarker ( 670.69952392578, 906.75018310547, -40.3984375, "cylinder", 1, 255, 255, 255, 0 ) 
local Elem = createObject ( 3409, 670.69952392578, 906.75018310547, -40.3984375, 90, 0, 0 ) 
  
function onmarkethit ( p ) 
    if ( weapon == 23 ) then 
        if ( isElement ( Elem ) ) then destroyElement ( Elem ) end 
        if ( isElement ( Marker ) ) then destroyElement ( Marker ) end  
        givePlayerMoney ( p, 5000 ) 
    end 
end 
addEventHandler ( "onMarkerHit", Marker onmarkerhit ) 

Link to comment
createTeam ( "farmer", 0, 255, 0 ) 
local Marker = createMarker ( 670.69952392578, 906.75018310547, -40.3984375, "cylinder", 1, 255, 255, 255, 0 ) 
local Elem = createObject ( 3409, 670.69952392578, 906.75018310547, -40.3984375, 90, 0, 0 ) 
  
function customOnMarkerHit( p ) 
local playerWeapon = getPedWeapon( p ) 
    if ( playerWeapon == 23 ) then 
        if ( isElement ( Elem ) ) then destroyElement ( Elem ) end 
        if ( isElement ( Marker ) ) then destroyElement ( Marker ) end 
        givePlayerMoney ( p, 5000 ) 
    end 
end 
addEventHandler ( "onMarkerHit", Marker, customOnMarkerHit) 
  

Should work.

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