Question about MoneyBar and Textdraws [ I give rep thanks! ]
#1

My textdraws all are looped , i mean like this
pawn Код:
public OnGameModeInit()
{

   
    for(new f = 0; f < MAX_PLAYERS; f++)
    {
             // and here comes the textdraw with the [f]
Sometimes the textdraws aren't showing to some players, and i mean all of them , if they do 3-4 relogs it will appear but my problem is how to fix this. OnGameModeExit i haven't putted anything to destroy them or at OnPlayerDisconnect because if i do this they aren't loading or something like this. My question is it will do better if they will be at OnGameModeInit ?
And my 2nd question is how to fix my moneybar, sometimes when i login the textdraws(all of them) aren't showing and my moneybar is 0. Ussualy it's showing correctly.
What i am using is :
pawn Код:
#define ResetMoneyBar ResetPlayerMoney
#define UpdateMoneyBar GivePlayerMoney
pawn Код:
public MoneyTimer()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(MedicCallTime[i] > 0)
            {
                if(MedicAccepted[i] < 999)
                {
                    if(IsPlayerConnected(MedicAccepted[i]))
                    {
                        new Float:X,Float:Y,Float:Z;
                        GetPlayerPos(MedicAccepted[i], X, Y, Z);
                        SetPlayerCheckpoint(i, X, Y, Z, 5);
                    }
                }
            }
            if(GetPlayerCash(i) != GetPlayerMoney(i))
            {
                ResetMoneyBar(i);//Resets the money in the original moneybar, Do not remove!
                UpdateMoneyBar(i,GetPlayerCash(i));//Sets the money in the moneybar to the serverside cash, Do not remove!
            }
        }
    }
}
Reply
#2

If it's player Textdraw, Hide it for player on OnPlayerDisconnect and show them at OnPlayerConnect
Reply
#3

Obviously he isn't using player textdraws of course this is going to fuck up it's likely he's filled all the textdraw slots.
Reply
#4

So i will be better removing the loop and move them to OnGameModeInit ?
Ex textdraw:
pawn Код:
wantedjail[f] = TextDrawCreate(258.823486, 365.750122, "W: 0 - JAIL: 3");
        TextDrawLetterSize(wantedjail[f], 0.449999, 1.600000);
        TextDrawAlignment(wantedjail[f], 1);
        TextDrawColor(wantedjail[f], -1);
        TextDrawSetShadow(wantedjail[f], 0);
        TextDrawSetOutline(wantedjail[f], 1);
        TextDrawBackgroundColor(wantedjail[f], 51);
        TextDrawFont(wantedjail[f], 1);
        TextDrawSetProportional(wantedjail[f], 1);
pawn Код:
TextDrawShowForPlayer(x, wantedjail[x]);
Reply
#5

Change them to player textdraws they are created in OnPlayerConnect()
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)