speedo.
#1

Hello all, so im tryied do speed show, when speed are > 90.. but, when i enter a car, ant just stay, its show red, not yellow. ( i mean that, if speed < 90 - yellow if speed > 90 - red. )

script:

pawn Код:
if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {

                if(TextShow[playerid] == false)
                {
                    TextShow[playerid] = true;
                }
                new vehicleid = GetPlayerVehicleID(playerid);
                new model = GetVehicleModel(vehicleid);
                new String[128];
                new HH, MM, SS;
                gettime(HH, MM, SS);
                new Float:vX, Float:vY, Float:vZ, Float:Speed;
                if(model == BMX || model == MTBIKE || model == BIKE)
                {
                    GetVehicleVelocity(GetPlayerVehicleID(playerid), vX, vY, vZ);
                    Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(vX, 2), floatpower(vY, 2)),  floatpower(vZ, 2))), 100.0);
                    format(String,sizeof(String)," ~g~Dviratis: ~y~%s~n~ ~g~Greitis: ~y~%i~n~ ~g~Valandos: ~y~%d:%d",aVehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400], floatround(Speed, floatround_floor),HH,MM);
                }else{
                    GetVehicleVelocity(GetPlayerVehicleID(playerid), vX, vY, vZ);
                    Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(vX, 2), floatpower(vY, 2)),  floatpower(vZ, 2))), 200.0);
                    format(String,sizeof(String)," ~g~Automobilis: ~y~%s~n~ ~g~Greitis: ~y~%i~n~ ~g~Degalai: ~y~%iL~n~ ~g~Valandos: ~y~%d:%d",aVehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400],floatround(Speed, floatround_floor),vehicleDB[GetPlayerVehicleID(playerid)][gas],HH,MM);
                }
                else if(model != BMX || model != MTBIKE || model != BIKE && GetPlayerSpeed(playerid) > 89)
                {
                format(String,sizeof(String)," ~g~Automobilis: ~y~%s~n~ ~g~Greitis: ~r~%i~n~ ~g~Degalai: ~y~%iL~n~ ~g~Valandos: ~y~%d:%d",aVehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400],floatround(Speed, floatround_floor),vehicleDB[GetPlayerVehicleID(playerid)][gas],HH,MM);
                }
                if(VHSCreated[playerid] == true)
                {
                    TextDrawDestroy(VHS[playerid]);
                }
                VHS[playerid] = TextDrawCreate(495.000000,122.000000,String);
                TextDrawAlignment(VHS[playerid],0);
                TextDrawBackgroundColor(VHS[playerid],0x000000ff);
                TextDrawFont(VHS[playerid],1);
                TextDrawLetterSize(VHS[playerid],0.299999,1.000000);
                TextDrawColor(VHS[playerid],0xffffffff);
                TextDrawSetOutline(VHS[playerid],1);
                TextDrawSetProportional(VHS[playerid],1);
                TextDrawSetShadow(VHS[playerid],1);
                TextDrawShowForPlayer(playerid, VHS[playerid]);
                VHSCreated[playerid] = true;

            }else{
                if(TextShow[playerid] == true)
                {
                    TextDrawHideForPlayer(playerid, Text:VHS[playerid]);
                    TextShow[playerid] = false;
                }
            }
}
Reply
#2

Could just use the formatting ~y~ and ~r~, no?
Reply
#3

yes. 8chz
Reply
#4

bump, 24h over.
Reply
#5

Bump! please help me
Reply
#6

I did, didn't I?
Reply
#7

Im didn't understand it. >.>
Reply
#8

I do not understand the question fully. Seems you want yellow text and red text, is that right?
Reply
#9

Yes. But only when player car speed are > 89 ( speedometer will b red ), but if car speed are < 89 (speedometer will b yellow )
Reply
#10

buumpy.;/
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)