SuperVisor Posted December 21, 2018 Share Posted December 21, 2018 local Marker = createMarker ( x , y , z , 'cylinder' , 3 , 255 , 255 , 0 , 255 ) addEventHandler ( 'onMarkerHit' , root , function ( Player ) local MarkerColShape = getElementColShape ( source ) local Elements = getElementsWithinColShape ( MarkerColShape ) for _ , v in ipairs ( Elements ) do if ( getElementType ( v ) == 'player' ) then if ( not v == Elements [ 1 ] ) then setElementHealth ( v , 0 ) end end end end ) function MarkerHit (player,hitElement) local level = getPlayerWantedLevel (player) if (level < 6) then return exports.Messages:sendClientMessage( "You must have 5 starts to reset them", player ) end if getPlayerMoney(player) < 1000 then exports.Messages:sendClientMessage("You dont have enought money", player, 255, 0, 0) return end exports.Messages:sendClientMessage("You lost your stars", player, 255,255,0) setPlayerWantedLevel (player, 0 ) takePlayerMoney(player, 1000) end addEventHandler( "onMarkerHit", Marker, MarkerHit ) This Function true? i need when player get in marker for remove his stars pay 1k for lose it Link to comment
DNL291 Posted December 21, 2018 Share Posted December 21, 2018 local player = getElementType(player) == "player" and player or false if player and getPlayerWantedLevel(player) >= 1 and getPlayerMoney(player) >= 1000 then takePlayerMoney(player, 1000) if setPlayerWantedLevel(player, 0) then exports.Messages:sendClientMessage("You lost your stars", player, 255,255,0) end elseif player and getPlayerMoney(player) < 1000 then exports.Messages:sendClientMessage("You dont have enought money", player, 255, 0, 0) end I think you mean something like that. Link to comment
SuperVisor Posted December 22, 2018 Author Share Posted December 22, 2018 17 hours ago, DNL291 said: local player = getElementType(player) == "player" and player or false if player and getPlayerWantedLevel(player) >= 1 and getPlayerMoney(player) >= 1000 then takePlayerMoney(player, 1000) if setPlayerWantedLevel(player, 0) then exports.Messages:sendClientMessage("You lost your stars", player, 255,255,0) end elseif player and getPlayerMoney(player) < 1000 then exports.Messages:sendClientMessage("You dont have enought money", player, 255, 0, 0) end I think you mean something like that. Yea thanks But how to add message if player haven't stars say You haven't stars ? and marker? local Marker = createMarker ( x , y , z , 'cylinder' , 3 , 255 , 255 , 0 , 255 ) addEventHandler ( 'onMarkerHit' , root , function ( Player ) local MarkerColShape = getElementColShape ( source ) local Elements = getElementsWithinColShape ( MarkerColShape ) for _ , v in ipairs ( Elements ) do if ( getElementType ( v ) == 'player' ) then if ( not v == Elements [ 1 ] ) then setElementHealth ( v , 0 ) end end end end Link to comment
DNL291 Posted December 22, 2018 Share Posted December 22, 2018 elseif player and getPlayerWantedLevel(player) == 0 then exports.Messages:sendClientMessage("0 WL", player, 255, 0, 0) end Link to comment
SuperVisor Posted December 22, 2018 Author Share Posted December 22, 2018 1 hour ago, DNL291 said: elseif player and getPlayerWantedLevel(player) == 0 then exports.Messages:sendClientMessage("0 WL", player, 255, 0, 0) end K THANKS 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