Wanted Level Not Going Down
#1

please help me in my server when we are robbing killing then our wanted level not decreasing how can i decrease the wanted level ? please
Reply
#2

you can use something like that:
pawn Код:
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)-1);
Reply
#3

Just do it how Eth said and you will be fine. [do it in your OnPlayerDeath callback, under your factions check - if roleplay. - else, just put it under OnPlayerDeath]

Change from killerid if you want to decrease it for the killers
Keep them playerid if you want to decrease it for the players.
Reply
#4

And if you want it to go down after except few minutes you have to set timer.
Reply
#5

i want to down 1 stars every 2 minutes how can i make it when player get 5 or 6 wanted level every 2 minutes he lose his 1 star
Reply
#6

then onplayerspawn put that:
pawn Код:
SetTimerEx("WantedLevel",60000*2,1,"d",playerid);
and in any place in ur gamemode:
pawn Код:
forward WantedLevel(playerid);
public WantedLevel(playerid)
{
if(GetPlayerWantedLevel(playerid) >= 5)
{
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)-1);
}
return 1;
}
Reply
#7

-DELETED-
Use Eth's much easier and better than one i just posted!
Reply
#8

Eth i added your code but now when i'm getting wanted level 5 it is resetting my wanted level to 1 i want that system which lose every 2 minutes 1 wanted level like i have wanted level 6 after 2 minutes my wanted level go down to level 5 and after 2 minutes it go down to level 4 is there any way to do that?
Reply
#9

try this:
pawn Код:
// OnPlayerConnect:
ReduceTimer[playerid] = -1;

// OnPlayerUpdate:
if(GetPlayerWantedLevel(playerid) >= 1 && ReduceTimer[playerid] == -1)
{
    ReduceTimer[playerid] = SetTimerEx("ReduceWantedLevel", 120000, false, "i", playerid);// And btw. 1 minute = 60000
    ReduceTimer[playerid] = 0;
}

forward ReduceWantedLevel(playerid);
public ReduceWantedLevel(playerid)
{
    if (GetPlayerWantedLevel(playerid) >= 1) SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) -1);
    else
    {
        KillTimer(ReduceTimer[playerid]);
        ReduceTimer[playerid] = -1;
    }
}
Reply
#10

edit the old forward wantedlevel(playerid);
and public WantedLevel(playerid) with this one :
pawn Код:
forward WantedLevel(playerid);
public WantedLevel(playerid)
{
if(GetPlayerWantedLevel(playerid) != 0)
{
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)-1);
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)