26.02.2012, 19:01
(
Последний раз редактировалось ValenRatti; 27.02.2012 в 00:35.
)
Yo hago esto:
el textdraw
pawn Код:
new Activar[MAX_PLAYERS]; // si esta en 1 el velocimetro se activa, en 0 se desactiva
pawn Код:
for(new i=0; i<GetMaxPlayers(); i++)
{
Activar[i] = 1;// lo activa
Velocimetro[i] = TextDrawCreate(450.000000, 429.000000, " ");
TextDrawAlignment(Velocimetro[i],0);
TextDrawBackgroundColor(Velocimetro[i],0x000000ff);
TextDrawFont(Velocimetro[i],0);
TextDrawLetterSize(Velocimetro[i],0.48000,0.90000);
TextDrawSetProportional(Velocimetro[i],1);
TextDrawSetShadow(Velocimetro[i],0);
TextDrawSetOutline(Velocimetro[i],1);
TextDrawColor(Velocimetro[i],0xFFFFFFAA);
pawn Код:
forward Velo();
pawn Код:
public Velo()
{
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && Gosterge[i] == 1)
{
new HGG[265]; new Float:Can;
GetVehicleHealth(GetPlayerVehicleID(i), Can);
GetPlayerPos(i,Xa,Ya,Za);
KMH = floatsqroot(floatpower(floatabs(floatsub(Xa,Xb[i])),2)+floatpower(floatabs(floatsub(Ya,Yb[i])),2)+floatpower(floatabs(floatsub(Za,Zb[i])),2));
KMH *= 10.2;
format(HGG, sizeof(HGG), "~h~Velocidad: ~w~%0.0f km/h",KMH);
TextDrawSetString(Text:Velocimetro[i], HGG);// el nombre del velocimetro
TextDrawShowForPlayer(i, Velocimetro[i]);
} GetPlayerPos(i,Xb[i],Yb[i],Zb[i]), Xb[i] = Xa; Yb[i] = Ya; Zb[i] = Za;
}
}
pawn Код:
new HGS;
pawn Код:
public OnGameModeInit //o filterscriptinit
{
HGS = SetTimer("Velo",300,1); // si pones que loopee mas rapido te va a dar velocidad mas presisa
}