killingyasoon Posted November 12, 2018 Share Posted November 12, 2018 (edited) Hey, I want to add a marker when you get inside it takes some amount of money and you lose your wanted level Edited November 12, 2018 by killingyasoon Link to comment
LyricalMM Posted November 12, 2018 Share Posted November 12, 2018 addEventHandler("onMarkerHit") setPlayerWantedLevel takePlayerMoney 1 Link to comment
killingyasoon Posted November 12, 2018 Author Share Posted November 12, 2018 1 hour ago, LyricalMM said: addEventHandler("onMarkerHit") setPlayerWantedLevel takePlayerMoney Thank you Link to comment
killingyasoon Posted November 12, 2018 Author Share Posted November 12, 2018 it is working good , but i can make it not work for none wanted Link to comment
Moderators Patrick Posted November 12, 2018 Moderators Share Posted November 12, 2018 20 minutes ago, killingyasoon said: it is working good , but i can make it not work for none wanted if getPlayerWantedLevel(playerElement) > 0 then -- code end 1 Link to comment
killingyasoon Posted November 14, 2018 Author Share Posted November 14, 2018 (edited) 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 November 14, 2018 by killingyasoon Link to comment
mazarati21 Posted November 14, 2018 Share Posted November 14, 2018 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now