Reduce Wanted Level
#3

Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
Well yeah ding-dong, your code "stops" after that debug message because you "return" there.
Also what's with this var assignment here, shouldn't it just equal the players team?
Код:
new cop = Info[i][Team] == BP;
Also your IsPlayerConnected check is useless there as you're already checking the distance between two (connected) players.
I just added the debug message before posting to forums, the code wasnt working before the message either. But i see how that would affect the code.
Fixed new cop to just
pawn Код:
if(GetDistanceBetweenPlayers(i,Info[i][Team] == BP) >= 80)
and removed isplayerconnected


pawn Код:
public WantedLevelReduce()
{
    new string[100];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        new plwl = GetPlayerWantedLevel(i);
        if(plwl >= 1)
        {
            if(GetDistanceBetweenPlayers(i,Info[i][Team] == BP) >= 80)
            {
                plwl--;
                SetPlayerWantedLevel(i, plwl);
                format(string, sizeof(string), "Wanted Level Decreased To: %d",plwl);
                SendClientMessage(i, GetPlayerColor(i), string);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Reduce Wanted Level - by SnG.Scot_MisCuDI - 16.08.2014, 06:11
Re: Reduce Wanted Level - by Virtual1ty - 16.08.2014, 06:27
Re: Reduce Wanted Level - by SnG.Scot_MisCuDI - 16.08.2014, 06:36
Re: Reduce Wanted Level - by Virtual1ty - 16.08.2014, 06:41
Re: Reduce Wanted Level - by SnG.Scot_MisCuDI - 16.08.2014, 06:54
Re: Reduce Wanted Level - by Norrin - 16.08.2014, 06:56
Re: Reduce Wanted Level - by SnG.Scot_MisCuDI - 16.08.2014, 06:57
Re: Reduce Wanted Level - by Virtual1ty - 16.08.2014, 11:00

Forum Jump:


Users browsing this thread: 3 Guest(s)