Дрифт счетчик
#3

Оптимизация:
pawn Код:
public PlayerDrift() {
    for (new Player, PlayerVehicleID = INVALID_VEHICLE_ID; Player < GetMaxPlayers(); Player++) {
        if (IsPlayerConnected(Player) && GetPlayerState(Player) == PLAYER_STATE_DRIVER && VehicleIsCar((PlayerVehicleID = GetPlayerVehicleID(Player)))) {
            new Float:Angle,
                vehicleSpeed = VehicleSpeed(PlayerVehicleID),
                Float:playerTheoreticAngle = PlayerTheoreticAngle(Player);
            GetVehicleZAngle(PlayerVehicleID, Angle);
            Angle = floatabs(floatsub(Angle, playerTheoreticAngle));
            if (10.0 < Angle && Angle < 90.0 && 30 < vehicleSpeed && vehicleSpeed < 300) {
                if (!PlayerMoney[Player] && !PlayerScore[Player] && PlayerCombo[Player] == 1) {
                     
                    TextDrawShowForPlayer(Player, ServerTextDrawThree[Player]);
                    TextDrawShowForPlayer(Player, ServerTextDrawFour[Player]);
                    TextDrawShowForPlayer(Player, ServerTextDrawFive[Player]);
                    TextDrawSetString(ServerTextDrawThree[Player]," ");
                    TextDrawSetString(ServerTextDrawFour[Player]," ");
                    TextDrawSetString(ServerTextDrawFive[Player]," ");
                }
                PlayerMoney[Player] += floatround((Angle * (vehicleSpeed * 0.1)) / 10);
                PlayerScore[Player] += floatround((Angle * 3 * (vehicleSpeed* 0.1)) / 10);
                PlayerCombo[Player] = PlayerScore[Player] / 1000;
                if (PlayerCombo[Player] < 1) {
                    PlayerCombo[Player] = 1;
                }
                new String[100];
                format(String, sizeof(String),"~r~~h~%d~g~$ ~w~+", PlayerMoney[Player]);
                TextDrawSetString(ServerTextDrawThree[Player], String);
                format(String, sizeof(String),"~r~~h~%d~g~ ~w~+", PlayerScore[Player]);
                TextDrawSetString(ServerTextDrawFour[Player], String);
                format(String, sizeof(String),"~W~~H~X%d",PlayerCombo[Player]);
                TextDrawSetString(ServerTextDrawFive[Player], String);
                PlayerTimerOne[Player] = SetTimerEx("PlayerDriftEnd", 3000, 0, "d", Player);
            }
        }
    }
    return 1;
}
У тебя походу проблема с таймерами, попробуй их отследить.
Reply


Messages In This Thread
Дрифт счетчик - by Kuroki - 31.03.2014, 07:51
Re: Дрифт счетчик - by Dragunovje - 31.03.2014, 08:03
Re: Дрифт счетчик - by Stepashka - 31.03.2014, 08:08
Re: Дрифт счетчик - by Kuroki - 31.03.2014, 08:10
Re: Дрифт счетчик - by Stepashka - 31.03.2014, 08:56
Re: Дрифт счетчик - by Kuroki - 31.03.2014, 09:55
Re: Дрифт счетчик - by Alexander_Petrov - 31.03.2014, 10:05
Re: Дрифт счетчик - by Kuroki - 31.03.2014, 10:09
Re: Дрифт счетчик - by Kuroki - 31.03.2014, 12:32
Re: Дрифт счетчик - by warlock02 - 31.03.2014, 19:40

Forum Jump:


Users browsing this thread: 2 Guest(s)