PlayerTextDrawString problem.
#1

I don't see any problem here

Error: error 001: expected token: ";", but found "-identifier-"


pawn Код:
PlayerTextDrawSetString(i, HUD[i][0], szString);
pawn Код:
new PlayerText:HUD[MAX_PLAYERS][1];
Reply
#2

PlayerTextDrawSetString(i, HUD[i], szString);
Reply
#3

Quote:
Originally Posted by DeathCore
Посмотреть сообщение
PlayerTextDrawSetString(i, HUD[i], szString);
Could you explain how you think that works please...
Reply
#4

another problem.
the first one fixed.
When i add this function with a timer or even without a timer the console is closing auto.

pawn Код:
SetTimer("UpdateHud", 2000, 1);
pawn Код:
forward UpdateHud();
public UpdateHud()
{
    foreach (new i : Player)
    {
        if (pInfo[i][pLogged])
        {
            new
                szString[200];        
            format(szString, sizeof szString, "~w~Cash: ~w~$%d", GetPlayerMoney(i));
            PlayerTextDrawSetString(i, Hud[i], szString);
        }
    }
    return 1;
}
Reply
#5

Check your server log.
Reply
#6

Nothing in the server logs.
The console doesn't say anything.
Reply
#7

I can't see how you think that the first error got fixed, and yet are now having a crash, resulting from the same area of code...
Reply
#8

Quote:
Originally Posted by DavidGravelli
Посмотреть сообщение
another problem.
the first one fixed.
When i add this function with a timer or even without a timer the console is closing auto.

pawn Код:
SetTimer("UpdateHud", 2000, 1);
pawn Код:
forward UpdateHud();
public UpdateHud()
{
    foreach (new i : Player)
    {
        if (pInfo[i][pLogged])
        {
            new
                szString[200];        
            format(szString, sizeof szString, "~w~Cash: ~w~$%d", GetPlayerMoney(i));
            PlayerTextDrawSetString(i, Hud[i], szString);
        }
    }
    return 1;
}
That is counter-intuitive why would you ever need a timer to update that textdraw? You only need to update when a players money actually changes using a timer is silly.
Reply
#9

Quote:
Originally Posted by Pottus
Посмотреть сообщение
That is counter-intuitive why would you ever need a timer to update that textdraw? You only need to update when a players money actually changes using a timer is silly.
Right
Reply
#10

Get a serverside money detector and set a textdraw updater


Код HTML:
forward GivePlayerMoneyEx(playerid, amount);
public GivePlayerMoneyEx(playerid, amount) // replace all of the native function
{
        new
                szString[200];  

        ResetPlayerMoney(playerid);
        pInfo[playerid][pCash] += amount;
        GivePlayerMoneyEx(playerid, pInfo[playerid][pCash]);
       
        format(szString, sizeof szString, "~w~Cash: ~w~$%d", pInfo[playerid][pCash]);
        PlayerTextDrawSetString(playerid, Hud[playerid], szString);
        return 1;
}

forward GetPlayerMoneyEx(playerid);
public GetPlayerMoneyEx(playerid) { return pInfo[playerid][pCash]; } // replace all of the native function
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)