SA-MP Forums Archive
Textdraw is not showing up - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Textdraw is not showing up (/showthread.php?tid=541981)



Textdraw is not showing up - lulo356 - 15.10.2014

How can i fix this problem the textdraw is not showing up

pawn Код:
forward Speedometer(playerid);
public Speedometer(playerid)
{
    new str[32],id, vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int;
    vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid != 0)
    {
        GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
        final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*136.666667; // 250.666667 = kmph  // 199,4166672 = mph
        final_speed_int = floatround(final_speed,floatround_round);
        format(speed_string,256,"Speed: %i",final_speed_int);
        PlayerTextDrawSetString(playerid,Speed1, speed_string);
        format (str, sizeof (str), "Model: %s", VehicleModel [GetVehicleModel (id) - 400]);
        TextDrawSetString (Textdraw2, str);
    }
    else
    {
        PlayerTextDrawSetString(playerid, Speed1, "0");
        PlayerTextDrawSetString(playerid, Model1, " ");
    }
    return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
    Speed1 = CreatePlayerTextDraw(playerid, 510.000000, 371.000000, "Speed:");
    PlayerTextDrawBackgroundColor(playerid, Speed1, 255);
    PlayerTextDrawFont(playerid, Speed1, 1);
    PlayerTextDrawLetterSize(playerid, Speed1, 0.400000, 1.000000);
    PlayerTextDrawColor(playerid, Speed1, -1);
    PlayerTextDrawSetOutline(playerid, Speed1, 0);
    PlayerTextDrawSetProportional(playerid, Speed1, 1);
    PlayerTextDrawSetShadow(playerid, Speed1, 1);
    PlayerTextDrawUseBox(playerid, Speed1, 1);
    PlayerTextDrawBoxColor(playerid, Speed1, 255);
    PlayerTextDrawTextSize(playerid, Speed1, 640.000000, 0.000000);
    PlayerTextDrawSetSelectable(playerid, Speed1, 0);
    PlayerTextDrawShow(playerid,Speed1);

    Dashcam1 = CreatePlayerTextDraw(playerid, 531.000000, 351.000000, "Dash Board");
    PlayerTextDrawBackgroundColor(playerid, Dashcam1, 255);
    PlayerTextDrawFont(playerid, Dashcam1, 1);
    PlayerTextDrawLetterSize(playerid, Dashcam1, 0.400000, 2.000000);
    PlayerTextDrawColor(playerid, Dashcam1, 16777215);
    PlayerTextDrawSetOutline(playerid, Dashcam1, 1);
    PlayerTextDrawSetProportional(playerid, Dashcam1, 1);
    PlayerTextDrawSetSelectable(playerid, Dashcam1, 0);
    PlayerTextDrawShow(playerid,Dashcam1);

    Model1 = CreatePlayerTextDraw(playerid, 510.000000, 399.000000, "Model:");
    PlayerTextDrawBackgroundColor(playerid, Model1, 255);
    PlayerTextDrawFont(playerid, Model1, 1);
    PlayerTextDrawLetterSize(playerid, Model1, 0.319999, 1.000000);
    PlayerTextDrawColor(playerid, Model1, -1);
    PlayerTextDrawSetOutline(playerid, Model1, 1);
    PlayerTextDrawSetProportional(playerid, Model1, 1);
    PlayerTextDrawUseBox(playerid, Model1, 1);
    PlayerTextDrawBoxColor(playerid, Model1, 255);
    PlayerTextDrawTextSize(playerid, Model1, 660.000000, 0.000000);
    PlayerTextDrawSetSelectable(playerid, Model1, 0);
    PlayerTextDrawShow(playerid,Model1);
    return 1;
}



Re: Textdraw is not showing up - lulo356 - 16.10.2014

someone


Re: Textdraw is not showing up - Dziugsas - 16.10.2014

I dont know if its the problem ,but you created textdraw and then you have to show it https://sampwiki.blast.hk/wiki/TextDrawShowForPlayer


Re: Textdraw is not showing up - lulo356 - 16.10.2014

nope not the problem


Re: Textdraw is not showing up - austin070 - 16.10.2014

Where are you calling the Speedometer(playerid) callback?