SA-MP Forums Archive
Max Wanted level - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Max Wanted level (/showthread.php?tid=578126)



Max Wanted level - STONEGOLD - 16.06.2015

Well when people commit crimes, their wanted level goes up of course, but the problem is, I don't want their wanted level to be 12, 17, 25, 43 etc... I want it to stop at Wanted Level 6 as the maximum. How would I do it?

Say I was wanted level 5, stole a cop car which is worth 4 stars (wanted level 4). This would give me wanted level 9, BUT, I want it to stop at wanted level 6 and say Wanted Level 6 - Most Wanted, not Wanted Level 9 blabla...

Any ideas?

I have tired.

PHP код:
if(GetPlayerWantedLevel(playerid) >= 6) return SetPlayerWantedLevel(playerid,6); 



Re: Max Wanted level - Konstantinos - 16.06.2015

pawn Код:
#define SetPlayerWantedLevelEx(%0,%1) SetPlayerWantedLevel(%0, clamp(%1, 0, 6))
and just use SetPlayerWantedLevelEx instead.


Re: Max Wanted level - STONEGOLD - 16.06.2015

PHP код:
SetPlayerWantedLevelEx(playerid,GetPlayerWantedLevel(playerid) + 4);
                 
format(stringsizeof(string), "(Crime Committed): Casino Robbery - Wanted Level %d - Arrestable"GetPlayerWantedLevel(playerid));
                 
SendClientMessage(playeridREDstring); 
I'm using this. It always show me "Wanted Level 8,12 and blah blah. I want set it max 6. So,


""(Crime Committed): Casino Robbery - Wanted Level %d - Arrestable"

This %d always goes up like 8,12, blah , blah. i want set it max 6. even if player has 6 stars already and robbed a player so it still should show to player like this

Example:

- I have 6 wanted level already
- I robbed a player ( if you rob a player you get 2 stars )
- So, 6 + 2 = 8/
- So, I want it should show to player "

"(Crime Committed): Robbery - Wanted Level %d - Arrestable"
"(Crime Committed): Robbery - Wanted Level 6 - Arrestable
Like this.


Re: Max Wanted level - STONEGOLD - 16.06.2015

Done. Thanks man!


Re: Max Wanted level - trablon - 16.06.2015

You have to edit when player gets wanted level while he is commiting a crime..For instance;

When players get wanted level;

pawn Код:
if( GetPlayerWantedLevel(playerid) == 6) return SCM(playerid,-1,"You have reached the max level of your crimes, you are most wanted and you will not get any level from this moment.");



Re: Max Wanted level - Vince - 16.06.2015

What is with people creating duplicate topics all the time? I had already given you a solution HERE, but apparently you still don't know how to use a simple function ...


Re: Max Wanted level - STONEGOLD - 16.06.2015

Vince, I have tired your function. But it really doesn't work what i wanted. But this one work like a charm. thank you both.