[GameMode] Duelo de Times [BASE]
#10

Vocкs estгo muito preocupado com o trabalho dele, pois jб me deparei com coisas piores aqui no fуrum.

OnPlayerRequestClass, vocк deveria ter usado switch, mais como o Game Mode foi feito para postar..

Code mal otimizado.

pawn Code:
public Velocimetro()
{
    foreach (Player, i)
    {
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(i, aname, MAX_PLAYER_NAME);
        if(IsPlayerInAnyVehicle(i))
        {
            new Float:X, Float:Y, Float:Z, Float:Speed, Float:vcarro, velocidade, string[256], nocarro[30];
            new PlayerVehicleModelID = GetVehicleModel(GetPlayerVehicleID(i));
            GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
            Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 200.0);
            GetVehicleHealth(GetPlayerVehicleID(i), vcarro);
            velocidade = floatround(Speed, floatround_floor);
            PlayerVehicleModelID -= 400;
            format(nocarro,30,NomeCarro[PlayerVehicleModelID]);
            format(string, 256,"~l~~>~~w~ Velocidade: ~g~%i KM/h ~n~~l~~>~ ~w~Carro: ~b~%s ~n~~l~~>~ ~w~Lataria: ~r~%.0f%",velocidade,nocarro,vcarro);
            TextDrawSetString(velo[i],string);
            TextDrawShowForPlayer(i,velo[i]);
        }
        else
        {
            TextDrawHideForPlayer(i, velo[i]);
        }
    }
}
Algumas definiзхes inъteis, tirando isso parabйns.
Reply


Messages In This Thread
Duelo de Times [BASE] - by Hiuship - 21.03.2012, 20:21
Re: Duelo de Times [BASE] - by Djair_Black - 21.03.2012, 20:25
Re: Duelo de Times [BASE] - by Hiuship - 21.03.2012, 22:18
Re: Duelo de Times [BASE] - by histire - 21.03.2012, 22:27
Re: Duelo de Times [BASE] - by Hiuship - 21.03.2012, 22:50
Re: Duelo de Times [BASE] - by histire - 21.03.2012, 22:56
Re: Duelo de Times [BASE] - by Hiuship - 21.03.2012, 23:49
Re: Duelo de Times [BASE] - by paulor - 22.03.2012, 00:53
Re: Duelo de Times [BASE] - by Hiuship - 22.03.2012, 01:20
Re: Duelo de Times [BASE] - by StrondA_ - 22.03.2012, 09:36

Forum Jump:


Users browsing this thread: 4 Guest(s)