Problem with [TextDraw]
#1

If there no players in the server, textdraw works good.
But when more players connect and they start using vehicle's the textdraw going crazy.
Also the second Textdraw not showing...

pawn Код:
new Text:SpeedRek1;
new Text:SpeedRek2;
new Text:SpeedRek3;
new Text:SpeedRek4;

SpeedRek1 = TextDrawCreate(177.500000, 358.750000, "LD_SPAC:white");
TextDrawLetterSize(SpeedRek1, 0.000000, 0.000000);
TextDrawTextSize(SpeedRek1, 2.500000, 43.166687);
TextDrawAlignment(SpeedRek1, 1);
TextDrawColor(SpeedRek1, -1);
TextDrawSetShadow(SpeedRek1, 0);
TextDrawSetOutline(SpeedRek1, 0);
TextDrawFont(SpeedRek1, 4);

SpeedRek2 = TextDrawCreate(177.500000, 358.750000, "LD_SPAC:white");
TextDrawLetterSize(SpeedRek2, 0.000000, 0.000000);
TextDrawTextSize(SpeedRek2, 344.500000, 2.916686);
TextDrawAlignment(SpeedRek2, 1);
TextDrawColor(SpeedRek2, -1);
TextDrawSetShadow(SpeedRek2, 0);
TextDrawSetOutline(SpeedRek2, 0);
TextDrawFont(SpeedRek2, 4);

SpeedRek3 = TextDrawCreate(522.000000, 358.749969, "LD_SPAC:white");
TextDrawLetterSize(SpeedRek3, 0.000000, 0.000000);
TextDrawTextSize(SpeedRek3, -2.500000, 43.166687);
TextDrawAlignment(SpeedRek3, 1);
TextDrawColor(SpeedRek3, -1);
TextDrawSetShadow(SpeedRek3, 0);
TextDrawSetOutline(SpeedRek3, 0);
TextDrawFont(SpeedRek3, 4);

SpeedRek4 = TextDrawCreate(178.000000, 399.583374, "LD_SPAC:white");
TextDrawLetterSize(SpeedRek4, 0.000000, 0.000000);
TextDrawTextSize(SpeedRek4, 344.000000, 2.916625);
TextDrawAlignment(SpeedRek4, 1);
TextDrawColor(SpeedRek4, -1);
TextDrawSetShadow(SpeedRek4, 0);
TextDrawSetOutline(SpeedRek4, 0);
TextDrawFont(SpeedRek4, 4);
pawn Код:
new Text:SpeedoText[MAX_PLAYERS];
OnPlayerConnect:
pawn Код:
SpeedoText[playerid] = TextDrawCreate(180.000, 362.000," ");
    TextDrawAlignment(SpeedoText[playerid], 1);
    TextDrawFont(SpeedoText[playerid],2);
    TextDrawLetterSize(SpeedoText[playerid], 0.310, 1.400);
    TextDrawSetShadow(SpeedoText[playerid],0);
    TextDrawUseBox(SpeedoText[playerid], 1);
    TextDrawBoxColor(SpeedoText[playerid], 0x99);
    TextDrawTextSize(SpeedoText[playerid], 520.000, 0.000);

OnPlayerStateChange:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_PASSENGER)
    {
        SetPlayerArmedWeapon(playerid,0);
    }
    if(IsPlayerInAnyVehicle(playerid) && !IsBicycle(GetPlayerVehicleID(playerid)))
    {
        //TextDrawShowForPlayer(playerid, SpeedoBox);
        TextDrawShowForPlayer(playerid, SpeedoText[playerid]);
        TextDrawShowForPlayer(playerid, SpeedRek1);
        TextDrawShowForPlayer(playerid, SpeedRek2);
        TextDrawShowForPlayer(playerid, SpeedRek3);
        TextDrawShowForPlayer(playerid, SpeedRek4);
        new vehicleid = GetPlayerVehicleID(playerid);
        if(VehicleSecurity[vehicleid] == 1)
        {
            ToggleAlarm(vehicleid, VEHICLE_PARAMS_ON);
            SetTimerEx("StopAlarm", ALARM_TIME, false, "d", vehicleid);
        }
    }
    else
    {
        //TextDrawHideForPlayer(playerid, SpeedoBox);
        TextDrawHideForPlayer(playerid, SpeedoText[playerid]);
        TextDrawHideForPlayer(playerid, SpeedRek1);
        TextDrawHideForPlayer(playerid, SpeedRek2);
        TextDrawHideForPlayer(playerid, SpeedRek3);
        TextDrawHideForPlayer(playerid, SpeedRek4);
    }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)