Decreasing wanted
#1

Hi everyone i want to know how to make a timer wich will decrease the 1 wanted star every 10 minutes and a textdraw appear under money wich the timer left.Who will help me i will rep +
Reply
#2

PHP код:
new  myTimer[MAX_PLAYERS];
On Player Connect
myTimer
[playerid] = SetTimerEx("Wanted"1000 60 10true"i"playerid);
// 1000 =  1 second * 60 = 1 mn * 10 = 10 mn
On Player Disonnect
KillTimer
(myTimer[playerid]);
forward Wanted(playerid);
public 
Wanted(playerid) {
    
SetPlayerWantedLevel(playerid,  GetPlayerWantedLevel(playerid) - 1);

Reply
#3

First of all, This isn't a place where you request code... here we help you with your already writenn code.

However, Here you go:
PHP код:
//This is just some useful defines for time converting.
#define S_TO_MS(%0)            %0 * 1000
#define M_TO_MS(%0)            S_TO_MS(%0 * 60)
#define H_TO_MS(%0)            M_TO_MS(%0 * 60)
//This will be anywhere you want the timer to run.
SetTimerEx("DescreaseWantedLevel"M_TO_MS(10), 1"d"playerid);
//This will be anywhere in the script.
forward DecreaseWantedLevel(playerid);
public 
DecreaseWantedLevel(playerid)
{
    
SetPlayerWantedLevel(GetPlayerWantedLevel(playerid)--);
    return 
1;

And about textdraws, Search... There are tens of tutorials and editors about it.

E: Oh and also as Azula said, Make sure you delete the timer OnExit.
Reply
#4

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)