wesleywillems17 Posted December 23, 2016 Posted December 23, 2016 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?
..:D&G:.. Posted December 23, 2016 Posted December 23, 2016 (edited) setPlayerWantedLevel(thePlayer, (getPlayerWantedLevel(thePlayer) + 2)) Edited December 23, 2016 by ..:D&G:.. MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
ViRuZGamiing Posted December 23, 2016 Posted December 23, 2016 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."
..:D&G:.. Posted December 23, 2016 Posted December 23, 2016 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.... MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
ViRuZGamiing Posted December 23, 2016 Posted December 23, 2016 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."
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