SA-MP Forums Archive
[FilterScript] Tachimetro[FS]Nuovo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Tachimetro[FS]Nuovo (/showthread.php?tid=364924)



Tachimetro[FS]Nuovo - SergioCosta - 01.08.2012




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;
}



Re: Tachimetro[FS]Nuovo - StreetGT - 01.08.2012

there you writte things in english...


Re: Tachimetro[FS]Nuovo - SergioCosta - 01.08.2012

I created Fs ITA !!!! writing ITALIAN!! no English!


Re: Tachimetro[FS]Nuovo - StreetGT - 01.08.2012

"NON RIMOVETE I CREDITI !!!! RISPETTATE!! I CREDITI GRAZIE" Is this in English?


Re: Tachimetro[FS]Nuovo - SergioCosta - 01.08.2012

ok i writing english!!