Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] How to decrease SetPlayerWantedLevel every 5 seconds?

 
  • 0 Vote(s) - 0 Average
Pawn How to decrease SetPlayerWantedLevel every 5 seconds?
XDK6
Offline

Burgershot Member
Posts: 4
Threads: 3
Joined: Jun 2021
Reputation: 0
#1
2021-07-04, 07:13 AM
Hi guys I need help how to decrease setplayerwanted levels for every 5 second
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#2
2021-07-04, 07:29 AM (This post was last modified: 2021-07-04, 07:30 AM by Pinch.)
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.
Kwarde
Offline

Burgershot Member
Posts: 99
Threads: 2
Joined: Sep 2020
Reputation: 8
Location: The Netherlands
#3
2021-07-04, 06:55 PM
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
}
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#4
2021-07-05, 05:58 AM
(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.
Kwarde
Offline

Burgershot Member
Posts: 99
Threads: 2
Joined: Sep 2020
Reputation: 8
Location: The Netherlands
#5
2021-07-05, 08:28 AM (This post was last modified: 2021-07-05, 08:28 AM by Kwarde.)
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
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#6
2021-07-05, 09:05 AM
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.
XDK6
Offline

Burgershot Member
Posts: 4
Threads: 3
Joined: Jun 2021
Reputation: 0
#7
2021-07-12, 04:03 PM
okay guys thank you I'll try both  :)
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode