Jump to content

[HELP]Scripting


Recommended Posts

When the player is outside of the Marker "HouseRob" it gives the money to the player anyways, Other thing the debugscript says me Line 20 getelementtype bad first argument How to solve this?...

  
   HouseRob =  createMarker (  2024.5205078125, 1545.6474609375, 9.81995010376, "cylinder", 10, 255, 0, 0, 150) 
  
  
function Money(hitElement) 
if ( getElementType ( hitElement ) == "player" ) then 
local Criminals = getPlayerTeam ( hitElement ) 
if ( Criminals ) then   
if isElementWithinMarker(hitElement, HouseRob) then 
setTimer(givePlayerMoney,10000,1,hitElement, 10000) 
setTimer(setPlayerWantedLevel,10000,1,hitElement, 6) 
setTimer (destroyElement,10000,1,HouseRob) 
end 
end 
end 
end 
addEventHandler ("onMarkerHit", HouseRob, Money) 
  
function Otro(hitElement) 
if ( getElementType ( hitElement ) == "player" ) then 
HouseRobC = createMarker (  2027.5205078125, 1545.6474609375, 9.81995010376, "cylinder", 10, 255, 0, 0, 150) 
if (markerevent == nil) then 
markerevent = addEventHandler ("onMarkerHit", HouseRobC, Otro) 
end 
end 
end 
addEventHandler ("onElementDestroy", HouseRob, Otro) 
  
function Otro(hitElement) 
if ( getElementType ( hitElement ) == "player" ) then 
local Criminals = getPlayerTeam ( hitElement ) 
if ( Criminals ) then   
if isElementWithinMarker(hitElement, HouseRob) then 
setTimer(givePlayerMoney,30000,1,hitElement, 10000) 
setTimer(setPlayerWantedLevel,10000,1,hitElement, 6) 
setTimer (destroyElement,30000,1,HouseRobC) 
end 
end 
end 
end 

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