am I doing that right?
#1

I want to do a timer for wanted level decreasing.
pawn Код:
forward WantedLevelColor(playerid);
public WantedLevelColor(playerid)
{
    new wanted = GetPlayerWantedLevel(playerid);
    if(wanted ==6)
    {
        SetPlayerColor(playerid, COLOR_RED);
       
        HasWantedTime[playerid]=300;
    }
    if(wanted ==3)
    {
        SetPlayerColor(playerid, COLOR_YELLOW);

        HasTicketTime[playerid]=150;
    }
    if(wanted == 0)
    {
        SetPlayerToTeamColour(playerid);
    }
    return true;
}

public OnPlayerUpdate(playerid)
{
    WantedLevelColor(playerid);
        return true;
}
//==================================//
//Public OneSecondTimer.
public OneSecondTimer()
{
    new pname[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(HasWantedTime[i] >= 2)
            {
                HasWantedTime[i] --;
            }
            if(HasTicketTime[i] >= 2)
            {
                HasTicketTime[i] --;
            }
            if(HasWantedTime[i] == 1)
            {
                SendClientMessage(i,COLOR_YELLOW,"Your wanted level has been decreased, you're now a suspect.");
                SetPlayerWantedLevel(i,3);
                SetPlayerColor(i, COLOR_YELLOW);
            }
            if(HasTicketTime[i] == 1)
            {
                SendClientMessage(i,COLOR_YELLOW,"You are no-longer a suspect.");
                SetPlayerWantedLevel(i,0);
                SetPlayerColor(i, COLOR_WHITE);
                TimeToPayTicket[i] =0;
                HasTicket[i] =0;
                       }           
        }
    }
}
Is it right?
Reply
#2

Did you test it?
Did it work?
if it not, What didn't work?
Reply
#3

IT takes too long for the time interval I done..
Reply
#4

Show us your settimer line.
Reply
#5

Use your brain,
Set the time interval to 1 minute so you can check it if it's working.
Don't spam such like this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)