Sign in to follow this  
VenomOG

Cancel Wanted

Recommended Posts

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

 

 

Share this post


Link to post
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

 

Share this post


Link to post
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

Share this post


Link to post
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 !
 

Share this post


Link to post

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

Share this post


Link to post
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")

 

Share this post


Link to post
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.

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.