• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] How to decrease SetPlayerWantedLevel every 5 seconds?
#1
Hi guys I need help how to decrease setplayerwanted levels for every 5 second
  Reply
#2
Code:
forward DeceraseWantedLevel(playerid);
public DecreaseWantedLevel(playerid)
{
    new level = GetPlayerWantedLevel(playerid);
    if(!level)
        return;

    SetPlayerWantedLevel(playerid, --level);
}

// Somewhere in your script
SetTimerEx("DecreaseWantedLevel", true, 5 * 1000, "d", playerid);
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#3
Alternatively, if you're using YSI you can use y_timers:



Code:
//Somewhere in your script (after including y_timers ofc)

ptask DescreaseWantedLevel[5000](playerid)

{

    //Your piece of code to decrease wanted level

}
  Reply
#4
(2021-07-04, 06:55 PM)Kwarde Wrote: Alternatively, if you're using YSI you can use y_timers:



Code:
//Somewhere in your script (after including y_timers ofc)

ptask DescreaseWantedLevel[5000](playerid)

{

    //Your piece of code to decrease wanted level

}

You shouldn't really force people to use YSI if they do not want to do so
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#5
If you pay some attention to that post again:
Quote:Alternatively, if you're using YSI you can use y_timers:
1) "if" you're using YSI
2) you "can" use y_timers

Not forcing at all :-). Merely stating they can use ptask with y_timers if they are (already) using YSI
  Reply
#6
Eh that's fair, I misread the first sentence
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#7
Smile 
okay guys thank you I'll try both? :)
  Reply


Forum Jump: