Jump to content

setPlayerWantedLevel


Recommended Posts

Posted

Hi all,

 

I'm busy with a drug transport script for my server.

I'm trying to add a wanted level function to it so that if the player deliverd the van he will get 2 start of wanted level.

But my problem is when i use setPlayerWantedLevel (thePlayer, 2) and the player has 4 start then the player will lose 2 start.

Can somebody tell me how to fix this? :)

Posted
6 minutes ago, wesleywillems17 said:

Hi all,

 

I'm busy with a drug transport script for my server.

I'm trying to add a wanted level function to it so that if the player deliverd the van he will get 2 start of wanted level.

But my problem is when i use setPlayerWantedLevel (thePlayer, 2) and the player has 4 start then the player will lose 2 start.

Can somebody tell me how to fix this? :)

function setWantedLevel(player, wanted)
	if (getPlayerWantedLevel(player) > wanted) then
		setPlayerWantedLevel(player, wanted)
	end
end

 

1 minute ago, ..:D&G:.. said:

setPlayerWantedLevel(thePlayer, (getPlayerWantedLevel(thePlayer) + 2))

 

This will increased the current wanted level, I think the deal is that you wouldn't want the wanted level to lower when set lower but be higher when set higher

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted
42 minutes ago, ViRuZGamiing said:

function setWantedLevel(player, wanted)
	if (getPlayerWantedLevel(player) > wanted) then
		setPlayerWantedLevel(player, wanted)
	end
end

 

This will increased the current wanted level, I think the deal is that you wouldn't want the wanted level to lower when set lower but be higher when set higher

He wants to add 2 more stars to the current wanted level of the player... Your function won't do the trick if the player has 1 or 2 stars....

76561198066470453.png

SP37Ecj.jpg?2MTA:Rust Pre-Alpha Build v.0.3:SP37Ecj.jpg?2

https://forum.mtasa.com/viewtopic.php?f=114&t=97848

2Pac: ''Only God can judge me!''

Posted
3 minutes ago, ..:D&G:.. said:

He wants to add 2 more stars to the current wanted level of the player... Your function won't do the trick if the player has 1 or 2 stars....

my bad, didn't read the question properly

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

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