Max Wanted level
#1

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); 
Reply
#2

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

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.
Reply
#4

Done. Thanks man!
Reply
#5

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.");
Reply
#6

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)