Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new Float:Trip[MAX_VEHICLES];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Jakku - Speedometer/Fuel system");
- print("--------------------------------------\n");
- for(new Vehicles = 0; Vehicles < MAX_VEHICLES; Vehicles++)
- {
- Trip[Vehicles] = 0.00;
- }
- }
- public Speedometer()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
- {
- if(ShowSpeed[i] == 1)
- {
- new Float:x, Float:y, Float:z, Float:Dis, Float:health, string[256];TextDrawDestroy(black[i]); TextDrawDestroy(Speedom[i]);
- new vehicleid = GetPlayerVehicleID(i);
- Dis = floatsqroot(floatpower(floatabs(floatsub(OldCoordsX[i],x)),2) + floatpower(floatabs(floatsub(OldCoordsY[i],y)),2));
- if( speed == 0 ){
- format(string,sizeof(string),"~B~Trip:~w~%d Km",Trip[vehicleid]);
- } else if( speed >= 1 && speed <= 99 ){
- format(string,sizeof(string),"~B~Trip:~w~%d Km",Trip[vehicleid]);
- Trip[vehicleid] += 0.03;
- } else if( speed >= 100 && speed <= 179 ){
- format(string,sizeof(string),"~B~Trip:~w~%d Km",Trip[vehicleid]);
- Trip[vehicleid] += 0.06;
- } else {
- format(string,sizeof(string),"~B~Trip:~w~%d Km",Trip[vehicleid]);
- Trip[vehicleid] += 0.10;
- }
- black[i] = TextDrawCreate(504.000000,379.000000,"_");
- TextDrawUseBox(black[i],0);
- TextDrawBoxColor(black[i],0x00000085);
- TextDrawTextSize(black[i],621.000000,0.000000);
- TextDrawAlignment(black[i],0);
- TextDrawBackgroundColor(black[i],0x000000FF);
- TextDrawFont(black[i],3);
- TextDrawLetterSize(black[i],1.700000,5.250000);
- TextDrawColor(black[i],0xFFFFFFFF);
- TextDrawSetOutline(black[i],1);
- TextDrawSetProportional(black[i],1);
- TextDrawSetShadow(black[i],1);
- Speedom[i] = TextDrawCreate(505.000000,380.000000,string);
- TextDrawUseBox(Speedom[i],0);
- TextDrawBoxColor(Speedom[i],0xFFFFFF85);
- TextDrawTextSize(Speedom[i],620.000000,0.000000);
- TextDrawAlignment(Speedom[i],0);
- TextDrawBackgroundColor(Speedom[i],0x000000FF);
- TextDrawFont(Speedom[i],1);
- TextDrawLetterSize(Speedom[i],0.299999,1.000000);
- TextDrawColor(Speedom[i],0xFFFFFFFF);
- TextDrawSetOutline(Speedom[i],1);
- TextDrawSetProportional(Speedom[i],1);
- TextDrawSetShadow(Speedom[i],1);
- TextDrawShowForPlayer(i, black[i]);
- TextDrawShowForPlayer(i, Speedom[i]);
- OldCoordsX[i] = x; OldCoordsY[i] = y;
- } else {
- TextDrawDestroy(black[i]);
- TextDrawDestroy(Speedom[i]);
- }
- }
- }
- return true;
- }
- //Sad sam slucajno izbriso getspeed i sl., al to definisi, a velicinu txtdrawowa nisam ni pokusavo uredjivat...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement