Jump to content

Cancel Wanted


VenomOG

Recommended Posts

Posted

hello so i have this thugs script that i made and a turfing system
i want to make if player is in turf they cannot get wanted.
 

Quote

function test(player)
 if (getElementData(player,"isInTurf",true) then
      ----- what to put here?
end

 

 

Posted
8 minutes ago, Patrick2562 said:

what?

I want to cancel player wanted levels. like if he or she damages someone else and there in that getelement data, gives no wanted

 

Posted (edited)
setTimer(function(player)
 if (getElementData(player,"isInTurf",true)) then
      if (getPlayerWantedLevel(player) > 0) then
        setPlayerWantedLevel(player, 0)
      end
 end
end, 1000, 0)

 

Edited by LyricalMM
change of script
Posted
5 minutes ago, LyricalMM said:

setTimer(function(player)
 if (getElementData(player,"isInTurf",true)) then
      if (getPlayerWantedLevel(player) > 0 then
        setPlayerWantedLevel(player, 0)
      end
 end
end, 1000, 0)

 

Gonna test it thanks !
 

Posted
9 minutes ago, Gordon_G said:

A getElementData everu second and for every player (?) what a good optimisation :)

No he helped with some part ill add the rest
 

getElementData(player,"Job","Thugs")

 

Posted
12 hours ago, Knuck said:

No he helped with some part ill add the rest
 


getElementData(player,"Job","Thugs")

 

Gordon is right this, also this still leaves a 1s (maximum) gap of you having a wanted level inside the turf.

 

What I would suggest is that you:

1. Go to the 'setWantedLevel' function

2. Add an if around it checking if the player is NOT in the turf.

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