text draw screwing other textrdraw
#1

Why is this timer not showing up properly the text draw?
It doesnt bug other textdraw (in this case the clock) if i dont show it (the gas one)

pawn Код:
public CheckGas()
 {
  for(new i=0;i<MAX_PLAYERS;i++)
   {
      if(IsPlayerConnected(i))
       {
       //-----------------------------------------------------------------
       if  (IsPlayerInAnyVehicle(i)){
        if (VehicleInfo[GetPlayerVehicleID(i)][buybar] == 0){
        return 1;
        }
        new GasString[256];
        new TBarZone[MAX_ZONE_NAME];
        GetPlayer2DZone(i, TBarZone, MAX_ZONE_NAME);  // Location
        TextDrawHideForPlayer(i,GASTD[i]);
        VehicleInfo[GetPlayerVehicleID(i)][gas]=VehicleInfo[GetPlayerVehicleID(i)][gas]-1;
        format(GasString, sizeof(GasString), "] %s ] %s ] Gas: %d % ]", TBarZone, VehicleInfo[GetPlayerVehicleID(i)][name], VehicleInfo[GetPlayerVehicleID(i)][gas]);
        TextDrawSetString(GASTD[i],GasString);
        TextDrawShowForPlayer(i,GASTD[i]);
        return 1;
       }
       //-----------------------------------------------------------------
       new GasString[256];
       new TBarZone[MAX_ZONE_NAME];
       GetPlayer2DZone(i, TBarZone, MAX_ZONE_NAME); // Location
       TextDrawHideForPlayer(i,GASTD[i]);
       format(GasString, sizeof(GasString), "] %s ]", TBarZone);
       TextDrawSetString(GASTD[i],GasString);
       TextDrawShowForPlayer(i,GASTD[i]);
       return 1;


       }
       
   }
   
 return 1;
 }
Reply
#2

bump :P plz
Reply
#3

is this in a filterscript?
Reply
#4

no it's on my GM


it seems to be working for id 0 only? rest of id's screw the player's clock
Reply
#5

whats the checkgas timer set to
Reply
#6

SetTimer("CheckGas", 500, 1);

--------------------

also other things that may help to figure out:

pawn Код:
new Text:GASTD[MAX_PLAYERS];
//(on top) ----------------------------------------------------------------------------


TextDrawHideForPlayer(playerid,GASTD[playerid]);
//(on player death) ----------------------------------------------------------------------------

TextDrawShowForPlayer(playerid,GASTD[playerid]);
//(on player spawn) ----------------------------------------------------------------------------


    GASTD[playerid] = TextDrawCreate(78.000000, 437.000000, "_"); // ] ocean flats ] infernus ] gas: 100% ]
    TextDrawBackgroundColor(GASTD[playerid], 255);
    TextDrawAlignment(GASTD[playerid], 1);
    TextDrawFont(GASTD[playerid], 2);
    TextDrawLetterSize(GASTD[playerid], 0.220000, 0.899999);
    TextDrawColor(GASTD[playerid], 16777215);
    TextDrawSetOutline(GASTD[playerid], 0);
    TextDrawSetProportional(GASTD[playerid], 1);
    TextDrawSetShadow(GASTD[playerid], 1);

//(on player connect) ----------------------------------------------------------------------------


TextDrawDestroy(GASTD[playerid]);
//(on player disconnect) ----------------------------------------------------------------------------
Reply
#7

onplayer disconnect hidetextdraw dont destroy it

under gamemodeexit destroy textdraw in a loop

maybe try using onplayerstatechange to for when player goes in vehicle it shows because i dont understand why you show gas if player is out of vehicle?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)