how to change Speedo look?
#1

The title says all:
This is my speedo:
pawn Код:
SetTimer("LuX_SpeedoMeterUp", UpdateSpeed, 1);
    for(new v=0; v<MAX_VEHICLES; v++){
    LuX_ReadPosition(v);}
    for(new i=0; i<PLAYERS; i++){
        //---------------------------------------------------------->
        #if TextBox
        LBox[i] = TextDrawCreate(612.000000,342.000000,"C");
        TextDrawUseBox(LBox[i],1);
        TextDrawBoxColor(LBox[i],0x00000033);
        TextDrawTextSize(LBox[i],454.000000,9.000000);
        TextDrawAlignment(LBox[i],0);
        TextDrawBackgroundColor(LBox[i],0x000000ff);
        TextDrawFont(LBox[i],3);
        TextDrawLetterSize(LBox[i],-0.000000,8.700001);
        TextDrawColor(LBox[i],BoxColor);
        TextDrawSetOutline(LBox[i],1);
        TextDrawSetProportional(LBox[i],1);
        TextDrawSetShadow(LBox[i],1);
        #endif
        //---------------------------------------------------------->
        #if TextTopLines
        LLine1[i] = TextDrawCreate(609.000000,341.000000,"L");
        TextDrawUseBox(LLine1[i],1);
        TextDrawBoxColor(LLine1[i],0xffffff33);
        TextDrawTextSize(LLine1[i],457.000000,-1.000000);
        TextDrawAlignment(LLine1[i],0);
        TextDrawBackgroundColor(LLine1[i],0x000000ff);
        TextDrawFont(LLine1[i],3);
        TextDrawLetterSize(LLine1[i],-0.000000,-0.400000);
        TextDrawColor(LLine1[i],TopLinesColor);
        TextDrawSetOutline(LLine1[i],1);
        TextDrawSetProportional(LLine1[i],1);
        TextDrawSetShadow(LLine1[i],1);
        //---------------------------------------------------------->
        LLine2[i] = TextDrawCreate(609.000000,416.000000,"L");
        TextDrawUseBox(LLine2[i],1);
        TextDrawBoxColor(LLine2[i],0xffffff33);
        TextDrawTextSize(LLine2[i],457.000000,-9.000000);
        TextDrawBackgroundColor(LLine2[i],0x000000ff);
        TextDrawFont(LLine2[i],3);
        TextDrawLetterSize(LLine2[i],-0.000000,-0.400000);
        TextDrawColor(LLine2[i],TopLinesColor);
        TextDrawSetOutline(LLine2[i],1);
        TextDrawSetProportional(LLine2[i],1);
        TextDrawSetShadow(LLine2[i],1);
        #endif
        //---------------------------------------------------------->
        #if LogoName
        LCredits[i] = TextDrawCreate(487.000000,320.000000,SpeedoLogoText);
        TextDrawAlignment(LCredits[i],0);
        TextDrawBackgroundColor(LCredits[i],0x000000ff);
        TextDrawFont(LCredits[i],0);
        TextDrawLetterSize(LCredits[i],0.399999,1.400000);
        TextDrawColor(LCredits[i],LogoColor);
        TextDrawSetOutline(LCredits[i],1);
        TextDrawSetProportional(LCredits[i],1);
        TextDrawSetShadow(LCredits[i],1);
        #endif
        //---------------------------------------------------------->
        #if TextSideLines
        LLine3[i] = TextDrawCreate(466.000000,343.000000,"T");
        TextDrawUseBox(LLine3[i],1);
        TextDrawBoxColor(LLine3[i],0xffffff33);
        TextDrawTextSize(LLine3[i],457.000000,0.000000);
        TextDrawAlignment(LLine3[i],0);
        TextDrawBackgroundColor(LLine3[i],0x000000ff);
        TextDrawFont(LLine3[i],3);
        TextDrawLetterSize(LLine3[i],-0.000000,7.499998);
        TextDrawColor(LLine3[i],SideLinesColor);
        TextDrawSetOutline(LLine3[i],1);
        TextDrawSetProportional(LLine3[i],1);
        TextDrawSetShadow(LLine3[i],1);
        //---------------------------------------------------------->
        LLine4[i] = TextDrawCreate(607.000000,343.000000,"T");
        TextDrawUseBox(LLine4[i],1);
        TextDrawBoxColor(LLine4[i],0xffffff33);
        TextDrawTextSize(LLine4[i],603.000000,-6.000000);
        TextDrawAlignment(LLine4[i],0);
        TextDrawBackgroundColor(LLine4[i],0x000000ff);
        TextDrawFont(LLine4[i],3);
        TextDrawLetterSize(LLine4[i],-0.000000,7.499999);
        TextDrawColor(LLine4[i],SideLinesColor);
        TextDrawSetOutline(LLine4[i],1);
        TextDrawSetProportional(LLine4[i],1);
        TextDrawSetShadow(LLine4[i],1);
        #endif
        //---------------------------------------------------------->
        format(lstring, sizeof(lstring), "Initializing...");
        LFunc[i] = TextDrawCreate(466.000000,343.000000,lstring);
        TextDrawAlignment(LFunc[i],0);
        TextDrawBackgroundColor(LFunc[i],0x000000ff);
        TextDrawFont(LFunc[i],1);
        TextDrawLetterSize(LFunc[i],0.299999,1.200000);
        TextDrawColor(LFunc[i],0xffffffff);
        TextDrawSetOutline(LFunc[i],1);
        TextDrawSetProportional(LFunc[i],1);
        TextDrawSetShadow(LFunc[i],1);
        //---------------------------------------------------------->
        format(lstr, sizeof(lstr), "Initializing...");
        Lmph[i] = TextDrawCreate(466.000000,400.000000,lstr);
        TextDrawAlignment(Lmph[i],0);
        TextDrawBackgroundColor(Lmph[i],0x000000ff);
        TextDrawFont(Lmph[i],1);
        TextDrawLetterSize(Lmph[i],0.299999,1.000000);
        TextDrawColor(Lmph[i],0xffffffff);
        TextDrawSetOutline(Lmph[i],1);
        TextDrawSetProportional(Lmph[i],1);
        TextDrawSetShadow(Lmph[i],1);
    }
L want it to look like this:
pawn Код:
#include <a_samp>
enum td
{
    Text:TDSpeedClock[15]
}

new TextDraws[td];
new Text:TextDrawsd[MAX_PLAYERS][4];
new DeActiveSpeedometer[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("Clock Speedometer load");

    TextDraws[TDSpeedClock][0] = TextDrawCreate(496.000000,400.000000,"~g~20");
    TextDraws[TDSpeedClock][1] = TextDrawCreate(487.000000,388.000000,"~g~40");
    TextDraws[TDSpeedClock][2] = TextDrawCreate(483.000000,375.000000,"~g~60");
    TextDraws[TDSpeedClock][3] = TextDrawCreate(488.000000,362.000000,"~g~80");
    TextDraws[TDSpeedClock][4] = TextDrawCreate(491.000000,349.000000,"~g~100");
    TextDraws[TDSpeedClock][5] = TextDrawCreate(508.000000,336.500000,"~g~120");
    TextDraws[TDSpeedClock][6] = TextDrawCreate(536.000000,332.000000,"~g~140");
    TextDraws[TDSpeedClock][7] = TextDrawCreate(567.000000,337.000000,"~g~160");
    TextDraws[TDSpeedClock][8] = TextDrawCreate(584.000000,348.000000,"~g~180");
    TextDraws[TDSpeedClock][9] = TextDrawCreate(595.000000,360.000000,"~g~200");
    TextDraws[TDSpeedClock][10] = TextDrawCreate(603.000000,374.000000,"~g~220");
    TextDraws[TDSpeedClock][11] = TextDrawCreate(594.000000,386.000000,"~g~240");
    TextDraws[TDSpeedClock][12] = TextDrawCreate(585.000000,399.000000,"~g~260");
    TextDraws[TDSpeedClock][13] = TextDrawCreate(534.000000,396.000000,"~r~/ \\");
    TextDraws[TDSpeedClock][14] = TextDrawCreate(548.000000,401.000000,".");
    TextDrawLetterSize(TextDraws[TDSpeedClock][13], 1.059999, 2.100000);
    TextDrawLetterSize(TextDraws[TDSpeedClock][14], 0.73, -2.60);
    for(new i; i < 15; i++)
    {
        TextDrawSetShadow(TextDraws[TDSpeedClock][i], 1);
        TextDrawSetOutline(TextDraws[TDSpeedClock][i], 0);
    }


    return 1;
}

public OnFilterScriptExit()
{
    print("Clock Speedometer unload");

    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext[1], "speedo", false) == 0)
    {
        new strOptionInfo[2][37]=
            {
                "You have turned on your speedometer",
                "You have turned off your speedometer"
            };

        DeActiveSpeedometer[playerid] = !DeActiveSpeedometer[playerid];
        SendClientMessage(playerid, 0x00AA00FF, strOptionInfo[DeActiveSpeedometer[playerid]]);
        if(!DeActiveSpeedometer[playerid])
        {
            for(new i; i < 15; i++)
                TextDrawShowForPlayer(playerid, TextDraws[TDSpeedClock][i]);

            for(new i; i < 4; i++)
                TextDrawsd[playerid][i] = TextDrawCreate(555.0, 402.0, "~b~.");
        }
        else
        {
            for(new i; i < 4; i++)
                TextDrawHideForPlayer(playerid, TextDrawsd[playerid][i]);
            for(new i; i < 15; i++)
                TextDrawHideForPlayer(playerid, TextDraws[TDSpeedClock][i]);
        }

        return 1;
    }

    return 0;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && !DeActiveSpeedometer[playerid])
    {
        for(new i; i < 15; i++)
            TextDrawShowForPlayer(playerid, TextDraws[TDSpeedClock][i]);

        for(new i; i < 4; i++)
            TextDrawsd[playerid][i] = TextDrawCreate(555.0, 402.0, "~b~.");

    }
    else
    {
        for(new i; i < 4; i++)
            TextDrawHideForPlayer(playerid, TextDrawsd[playerid][i]);
        for(new i; i < 15; i++)
            TextDrawHideForPlayer(playerid, TextDraws[TDSpeedClock][i]);
    }

    return 1;
}

public OnPlayerUpdate(playerid)
{
    new
        Float:fPos[3],
        Float:Pos[4][2],
        Float:fSpeed;

    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && !DeActiveSpeedometer[playerid])
    {
        GetVehicleVelocity(GetPlayerVehicleID(playerid), fPos[0], fPos[1], fPos[2]);

        fSpeed = floatsqroot(floatpower(fPos[0], 2) + floatpower(fPos[1], 2) +
         floatpower(fPos[2], 2)) * 200;

        new Float:alpha = 320 - fSpeed;
        if(alpha < 60)
            alpha = 60;

        for(new i; i < 4; i++)
        {
            TextDrawHideForPlayer(playerid, TextDrawsd[playerid][i]);
            TextDrawDestroy(TextDrawsd[playerid][i]);
            GetDotXY(548, 401, Pos[i][0], Pos[i][1], alpha, (i + 1) * 8);
            TextDrawsd[playerid][i] = TextDrawCreate(Pos[i][0], Pos[i][1], "~b~.");
            TextDrawLetterSize(TextDrawsd[playerid][i], 0.73, -2.60);
            TextDrawSetOutline(TextDrawsd[playerid][i], 0);
            TextDrawSetShadow(TextDrawsd[playerid][i], 1);
            TextDrawShowForPlayer(playerid, TextDrawsd[playerid][i]);
        }
    }


    return 1;
}

stock GetDotXY(Float:StartPosX, Float:StartPosY, &Float:NewX, &Float:NewY, Float:alpha, Float:dist)
{
     NewX = StartPosX + (dist * floatsin(alpha, degrees));
     NewY = StartPosY + (dist * floatcos(alpha, degrees));
}
Olney problem is that this other one is a FS and the first one is in the GM so l dont know what to replace or delite and l really need help!
Reply
#2

You will have to use something to create the new TextDraw's to how you want it to look, and then replace the old one's above with the new one's.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)