Wanted Level -
STONEGOLD - 10.06.2015
OKay, I'm using this:
I'm using this on "OnPlayerUpdate"
PHP Code:
if (GetPlayerWantedLevel(playerid) > 6)
{
SetPlayerWantedLevel(playerid, 6);
}
But
PHP Code:
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid) + 4);
format(string, sizeof(string), "Store Robbery - Wanted Level %d - Red", GetPlayerWantedLevel(playerid));
PHP Code:
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid) + 5);
format(string, sizeof(string), "Store Robbery - Wanted Level %d - Red", GetPlayerWantedLevel(playerid));
I want Set wanted level max 6 . I don't want it shows me like this .
Store Robbery - Wanted Level 8 - Red
Store Robbery - Wanted Level 12 - Red
I want if player has 6 wanted levle stars and rob a store so it still should send msg to player like this
Store Robbery - Wanted Level 6 - Red
Not
Store Robbery - Wanted Level 8 - Red
. I want set max wanted levle to 6. I don't want it goes up.
Anyone help me?
Re: Wanted Level -
Ghazal - 10.06.2015
Change
pawn Code:
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid) + 4);
format(string, sizeof(string), "Store Robbery - Wanted Level %d - Red", GetPlayerWantedLevel(playerid));
to
pawn Code:
if(GetPlayerWantedLevel(playerid) > 2)
{
SetPlayerWantedLevel(playerid, 6 );
}
else
{
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid) + 4);
}
and so on.
Re: Wanted Level -
STONEGOLD - 10.06.2015
I want set my max wanted level to 6 so it always show me 6 not 8 or 9 or 10 or whatever. Even if player has 6 and he rob a store he should get 4 stars but it should says;
Store Robbery - Wanted Level 6 - Red
Re: Wanted Level -
DarkLouis - 10.06.2015
Puah!
It's just:
PHP Code:
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
if(GetPlayerWantedLevel(playerid) > 6) SetPlayerWantedLevel(playerid, 6);
format(string, sizeof(string), "Store Robbery - Wanted Level %d - Red", GetPlayerWantedLevel(playerid));
Re: Wanted Level -
KamalBa - 10.06.2015
Can you please give me your code I want to make a wanted level for criminals which they can had 400 or 1000 stars if the cops can't catch them...
And if a cop killed him he will be jailed for a long time sometimes more than 10mins
So anyone can help out ?
Re: Wanted Level -
DarkLouis - 10.06.2015
400, 1000 stars? What?
.. Give me your skype's contact.
Re: Wanted Level -
KamalBa - 10.06.2015
Speers23 From Israel
Re: Wanted Level -
Vince - 10.06.2015
OnPlayerUpdate is not meant to cover up shoddy coding practices. Create your own wanted level wrapper like this:
PHP Code:
IncreasePlayerWantedLevel(playerid, levelIncrease)
{
SetPlayerWantedLevel(playerid, clamp((GetPlayerWantedLevel(playerid) + levelIncrease), 0, 6))
}
The clamp function forces a value in range, so in this case it sets it to 0 if it's less than that and to 6 if it's more than that.
Re: Wanted Level -
STONEGOLD - 10.06.2015
Quote:
Originally Posted by Vince
OnPlayerUpdate is not meant to cover up shoddy coding practices. Create your own wanted level wrapper like this:
PHP Code:
IncreasePlayerWantedLevel(playerid, levelIncrease)
{
SetPlayerWantedLevel(playerid, clamp((GetPlayerWantedLevel(playerid) + levelIncrease), 0, 6))
}
The clamp function forces a value in range, so in this case it sets it to 0 if it's less than that and to 6 if it's more than that.
|
Thanks, Explain more. I'm new so. I mean, where should i add this ^^?
Re: Wanted Level -
Banana_Ghost - 11.06.2015
Quote:
Originally Posted by STONEGOLD
Thanks, Explain more. I'm new so. I mean, where should i add this ^^?
|
place it anywhere in your script that's not in a callback.
Anywhere you increase a player's wanted level, replace it with
PHP Code:
IncreasePlayerWantedLevel(playerid, levelIncrease)