SA-MP Forums Archive
Wanted Time - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Wanted Time (/showthread.php?tid=574603)



Wanted Time - StR_MaRy - 18.05.2015

hi guys i have no timer on wantedpoints but after 20 mins or 15 i don't know exactly 1 point of wanted disappear

i want to disappear 1 wanted point after 30 mins can some1 help me ? tutorial or something


Re: Wanted Time - amirm3hdi - 18.05.2015

You need to set a timer for each player to remove their wanted start...
Код:
forward WantedRemover(playerid);
public WantedRemover(playerid)
{
    SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) - 1);
}
Call that with a timer...

EDIT: sorry for timer u need to call a public function. (not stock)


Re: Wanted Time - StR_MaRy - 18.05.2015

this is not a tutorial or something ... i can't figure , thx you tried


Re: Wanted Time - amirm3hdi - 18.05.2015

so you want a TUT for a simple code...
pawn Код:
new timerWantedRemover[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    // Set a timer to call the WantedRemover function every 30 minutes.
    timerWantedRemover[playerid] = SetTimerEx("WantedRemover", 30 * 60000, true, "i", playerid);
}

public OnPlayerDisconnect(playerid, reason)
{
    // Killing the timer because we don't need it when the player is disconnected.
    KillTimer(timerWantedRemover[playerid]);
}

// The function to remove the player's wanted level.
forward WantedRemover(playerid);
public WantedRemover(playerid)
{
    if ( GetPlayerWantedLevel(playerid) > 0 ) // If player has 1 or more stars
    {
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) - 1);
        SendClientMessage(playerid, -1, "A wanted star removed.");
    }
}
About timer: https://sampwiki.blast.hk/wiki/SetTimerEx


Re: Wanted Time - StR_MaRy - 18.05.2015

thx man .. i rep you a good player who know how to help some1