[FilterScript] Tachimetro[FS]Nuovo
#1




NON RIMUOVERE I CREDITI !!!! RISPETTATE!! I CREDITI GRAZIE
DO NOT REMOVE THE CREDITS!! RESPECT! THANKS CREDITS

Код:
//====ORIGINARIAMENTE TACHIMETRO PER LA PACE RISPETTATE I CREDITI BY SERGIOCOSTA -
#include <a_samp>
#include <zcmd>

new Text:velocidad;
new Text:ttvelocimetro[MAX_PLAYERS];
new VelOn[MAX_PLAYERS];

public OnFilterScriptInit()
{
print("Originariamente tachimetro per la Pace - rispettate i crediti by SergioCosta");

velocidad = TextDrawCreate(200.000000, 330.000000, "[]Velocita");
TextDrawBackgroundColor(velocidad, 255);
TextDrawFont(velocidad, 2);
TextDrawLetterSize(velocidad, 0.500000, 4.000000);
TextDrawColor(velocidad, -1);
TextDrawSetOutline(velocidad, 0);
TextDrawSetProportional(velocidad, 1);
TextDrawSetShadow(velocidad, 1);
for(new i=0; i<MAX_PLAYERS; i++)
{
ttvelocimetro[i] = TextDrawCreate(330.000000, 330.000000, "-_-");
TextDrawBackgroundColor(ttvelocimetro[i], 255);
TextDrawFont(ttvelocimetro[i], 2);
TextDrawLetterSize(ttvelocimetro[i], 0.500000, 4.000000);
TextDrawColor(ttvelocimetro[i], -1);
TextDrawSetOutline(ttvelocimetro[i], 0);
TextDrawSetProportional(ttvelocimetro[i], 1);
TextDrawSetShadow(ttvelocimetro[i], 1);
}
return 1;
}

public OnPlayerUpdate(playerid)
{
   	if(IsPlayerInAnyVehicle(playerid))
   	{
   	    new Velocidad[128];
   		format(Velocidad, sizeof(Velocidad), "%d KM/h", sacarvelocidad(playerid));
    	TextDrawSetString(ttvelocimetro[playerid],Velocidad);
    	TextDrawShowForPlayer(playerid,ttvelocimetro[playerid]);
    	TextDrawShowForPlayer(playerid,velocidad);
    	if(sacarvelocidad(playerid) > 140 && sacarvelocidad(playerid) < 800)
    	{
    	TextDrawColor(ttvelocimetro[playerid], -13434625);
    	}
    	if(sacarvelocidad(playerid) > 40 && sacarvelocidad(playerid) < 140)
    	{
    	TextDrawColor(ttvelocimetro[playerid], -3381505);
    	}
    	if(sacarvelocidad(playerid) > 0 && sacarvelocidad(playerid) < 40)
    	{
    	TextDrawColor(ttvelocimetro[playerid], 6684927);
    	}
    	if(sacarvelocidad(playerid) == 0)
    	{
    	TextDrawColor(ttvelocimetro[playerid], -1);
    	}
	}
	return 1;
}
stock sacarvelocidad(playerid) //GROVE4L
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
	GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
	else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 180.3;
    return floatround(ST[3]);
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
TextDrawShowForPlayer(playerid, ttvelocimetro[playerid]);
TextDrawShowForPlayer(playerid,velocidad);
}
else
{
TextDrawHideForPlayer(playerid, ttvelocimetro[playerid]);
TextDrawHideForPlayer(playerid,velocidad);
}
return 1;
}

public OnFilterScriptExit()
{
	print("Originariamente tachimetro per la Pace - rispettate i crediti by SergioCosta");
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		TextDrawHideForAll(ttvelocimetro[i]);
		TextDrawDestroy(ttvelocimetro[i]);
	}
	return 1;
	}
	
zcmd(velocimetro, playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
if(VelOn[playerid] == 0){
TextDrawHideForPlayer(playerid, ttvelocimetro[playerid]);
TextDrawHideForPlayer(playerid,velocidad);
}
else
{
TextDrawShowForPlayer(playerid, ttvelocimetro[playerid]);
TextDrawShowForPlayer(playerid,velocidad);
}
}
return 1;
}
Reply


Messages In This Thread
Tachimetro[FS]Nuovo - by SergioCosta - 01.08.2012, 11:20
Re: Tachimetro[FS]Nuovo - by StreetGT - 01.08.2012, 11:23
Re: Tachimetro[FS]Nuovo - by SergioCosta - 01.08.2012, 11:31
Re: Tachimetro[FS]Nuovo - by StreetGT - 01.08.2012, 11:33
Re: Tachimetro[FS]Nuovo - by SergioCosta - 01.08.2012, 11:36

Forum Jump:


Users browsing this thread: 2 Guest(s)