Jump to content

How to make a marker which can remove your wanted level


killingyasoon

Recommended Posts


function MarkerHit (player,hitElement, matchingDimension)
   if getPlayerMoney(player) < 500 then

  outputChatBox("you dont have money", player, 255, 0, 0)
return 
 end    
   outputChatBox("You lost your stars", player, 255,255,0)
  setPlayerWantedLevel (player, 0 )
    takePlayerMoney(player, 500)

end 
addEventHandler( "onMarkerHit", Marker, MarkerHit )

--this isnt the full script

how can i restrict it for 1 to 5 stars

Edited by killingyasoon
Link to comment

Try this: 

function MarkerHit (player,hitElement)
    local level = getPlayerWantedLevel (player) -- Get player stars
       if (level < 5) then
   return outputChatBox( "You must have 5 starts to reset them", player ) 
   end
   if getPlayerMoney(player) < 500 then
   outputChatBox("You dont have enought money", player, 255, 0, 0)
return 
end    
   outputChatBox("You lost your stars", player, 255,255,0)
   setPlayerWantedLevel (player, 0 )
   takePlayerMoney(player, 500)
end
addEventHandler( "onMarkerHit", Marker, 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...