SA-MP Forums Archive
Textdraws randomly stopped being created? - 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: Textdraws randomly stopped being created? (/showthread.php?tid=480642)



Textdraws randomly stopped being created? - Dokins - 11.12.2013

I swear it's problem after problem...

They were working fine, I wasn't even working with textdraws, I didn't edit a thing on OnGameModeInit and I even undone what I coded just to make it work again and they won't...

Speedometer and clock aren't displaying anymore.
pawn Код:
public OnGameModeInit()
{

    mysql_connect(SQL_HOST, SQL_USER, SQL_DATABASE, SQL_PASS);
    SetGameModeText(HOSTNAME);
   
    printf("Max Vehicle Plate Length: %d", MAX_VEHICLE_PLATE);

    mysql_debug(1);
   
    OneMin = SetTimer("OneMinuteTimer", 60000, 1);
    DisableInteriorEnterExits();
    ShowPlayerMarkers(0);
    LoadFactions();
    LoadVehicles();
//  gettime(hours, minute, secs);
//  format(timestr,32,"%02d:%02d",hours, minute);
//  SAM_OnGameModeInit();
    LoadHouses();
    LoadBusinesses();
    BEnt = CreateDynamicPickup(1318,23,135.3096, 1955.0949, 19.4289,0);// BASE ENTRANCE
    fireman = CreateDynamicPickup(366,23,1491.9233,1305.8552,1093.2964,0);// Fireman.
    gunpart = CreateDynamicPickup(1239, 23,-2230.5210,2560.3955,1.8223,0);//Gunpart icon.
    gunorder = CreateDynamicPickup(1239, 23, -1478.3879,2630.9858,58.7879);
    ManualVehicleEngineAndLights();
   
    txtTimeDisp = TextDrawCreate(625.0,12.00,"00:00:00");
    TextDrawUseBox(txtTimeDisp, 0);
    TextDrawFont(txtTimeDisp, 3);
    TextDrawSetShadow(txtTimeDisp,0); // no shadow
    TextDrawSetOutline(txtTimeDisp,2); // thickness 1
    TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
    TextDrawColor(txtTimeDisp,0xFFFFFFFF);
    TextDrawAlignment(txtTimeDisp,3);
    TextDrawLetterSize(txtTimeDisp,0.5,1.5);

    for(new i=0;i<MAX_PLAYERS;i++)
    {
        speed[i] = TextDrawCreate(478,389,"_");
        TextDrawLetterSize(speed[i],0.37,2.0);
        TextDrawSetOutline(speed[i],1);
        TextDrawFont(speed[i], 2);
        fuel[i] = TextDrawCreate(478,413,"_");
        TextDrawLetterSize(fuel[i],0.37,2.0);
        TextDrawSetOutline(fuel[i],1);
        TextDrawFont(fuel[i], 2);
    }

    UpdateTimeAndWeather();
    SetTimer("UpdateTimeAndWeather",1000,1);
    EnableStuntBonusForAll(0);

return 1;

}



Re: Textdraws randomly stopped being created? - xVIP3Rx - 11.12.2013

Try
pawn Код:
new Text:gMyText = Text:INVALID_TEXT_DRAW;
//Or
new PlayerText:gMyPlayerText[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};



Re: Textdraws randomly stopped being created? - Dokins - 11.12.2013

I don't understand?


Re: Textdraws randomly stopped being created? - Wizzy951 - 11.12.2013

One of the possibilities is that, you are not properly destroying the textdraws when player leaves the server. Another one is that your game mode and filterscripts messed up somehow and there are collisions.


Re: Textdraws randomly stopped being created? - Wizzy951 - 12.12.2013

Quote:
Originally Posted by Dokins
Посмотреть сообщение
I don't understand?
The thing, he is showing you, is to make per-player textdraws. Read there.

Oops double posting. I'm sorry!


Re: Textdraws randomly stopped being created? - Dokins - 12.12.2013

Quote:
Originally Posted by Wizzy951
Посмотреть сообщение
One of the possibilities is that, you are not properly destroying the textdraws when player leaves the server. Another one is that your game mode and filterscripts messed up somehow and there are collisions.
Don't use filterscripts and I do destroy them properly. It was working perfectly until about 10 minutes ago.