timer problem
#1

Im trying to make a reduceplayerwantedlevel system that reduces the player wanted level i made a forward and i also added a timer but it only reduces the player level once and then it stop it doesnt do it again can someone tell me whats the problem with the code?
pawn Код:
//the timer
SetTimer("ReduceWantedLevel",6000,true);// thats not the real time(6000) jus used it to test

forward ReduceWantedLevel(playerid);
public ReduceWantedLevel(playerid)
{
    for(new i = 0; i < MAX_PLAYERS;i++)
    {
    if(GetPlayerWantedLevel(i) == 0) return 1;
    else if(GetPlayerWantedLevel(i) >= 40)
    {
        SetPlayerWantedLevel(i, 35);
        SendClientMessage(i, yellow,"test");
        return 1;
    }
    else if(GetPlayerWantedLevel(i) == 35)
    {
        SetPlayerWantedLevel(i, 30);
        SendClientMessage(i, yellow, "[WANTED]: You have lost 5 wanted levels.[level 30] ");
        return 1;
    }
    else if(GetPlayerWantedLevel(i) == 30)
    {
        SetPlayerWantedLevel(i, 28);
        SendClientMessage(i, yellow, "[WANTED]: You have lost 2 wanted levels.[level 28] ");
        return 1;
    }
    else if(GetPlayerWantedLevel(i) == 28)
    {
        SetPlayerWantedLevel(i, 20);
        SendClientMessage(i, yellow, "[WANTED]: You have lost 8 wanted levels.[level 20] ");
        return 1;
    }
    else if(GetPlayerWantedLevel(i) == 20)
    {
        SetPlayerWantedLevel(i, 15);
        SendClientMessage(i, yellow, "[WANTED]: You have lost 5 wanted levels.[level 15] ");
        return 1;
    }
    else if(GetPlayerWantedLevel(i) == 15)
    {
        SetPlayerWantedLevel(i, 10);
        SendClientMessage(i, yellow, "[WANTED]: You have lost 5 wanted levels.[level 10] ");
    }
    else if(GetPlayerWantedLevel(i) == 10)
    {
        SetPlayerWantedLevel(i, 9);
        SendClientMessage(i, yellow, "[WANTED]: You have lost 1 wanted levels.[level 9] ");
    }
    else if(GetPlayerWantedLevel(i) == 9)
    {
        SetPlayerWantedLevel(i, 8);
        SendClientMessage(i, yellow, "[WANTED]: You have lost 1 wanted levels.[level 8]");
    }
    else if(GetPlayerWantedLevel(i) == 8)
    {
        SetPlayerWantedLevel(i, 7);
        SendClientMessage(i, yellow, "[WANTED]: You have lost 1 wanted levels.[level 7]");
    }
    else if(GetPlayerWantedLevel(i) == 7)
    {
        SetPlayerWantedLevel(i, 6);
        SendClientMessage(i, yellow, "[WANTED]: You have lost 1 wanted levels.[level 6]");
    }
    else if(GetPlayerWantedLevel(i) == 5)
    {
        SetPlayerWantedLevel(i, 4);
        SendClientMessage(i, yellow, "[WANTED]: You have lost 1 wanted levels.[level 4]");
    }
    else if(GetPlayerWantedLevel(i) == 4)
    {
        SetPlayerWantedLevel(i, 3);
        SendClientMessage(i,yellow, "[WANTED]: You have lost 1 wanted levels.[level 3]");
    }
    else if(GetPlayerWantedLevel(i) == 2)
    {
        SetPlayerWantedLevel(i, 1);
        SendClientMessage(i, yellow, "[WANTED]: You have lost 1 wanted levels.[level 1]");
    }
    else if(GetPlayerWantedLevel(i) == 1)
    {
        SetPlayerWantedLevel(i, 0);
        SendClientMessage(i,yellow, "[WANTED]: You have now lost your wanted levels [Innocent]");
    }
    }
    return 1;
}
Reply


Messages In This Thread
timer problem - by 1fret - 17.12.2014, 20:19
Re: timer problem - by Schneider - 17.12.2014, 20:54
Re: timer problem - by Threshold - 18.12.2014, 02:30

Forum Jump:


Users browsing this thread: 2 Guest(s)