Textdraws randomly stopped being created?
#1

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;

}
Reply
#2

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

I don't understand?
Reply
#4

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.
Reply
#5

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!
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)