PlayerTextDrawString problem. -
DavidGravelli - 08.06.2018
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];
Re: PlayerTextDrawString problem. -
DeathCore - 08.06.2018
PlayerTextDrawSetString(i, HUD[i], szString);
Re: PlayerTextDrawString problem. -
Sew_Sumi - 09.06.2018
Quote:
Originally Posted by DeathCore
PlayerTextDrawSetString(i, HUD[i], szString);
|
Could you explain how you think that works please...
Re: PlayerTextDrawString problem. -
DavidGravelli - 09.06.2018
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;
}
Re: PlayerTextDrawString problem. -
Logic_ - 09.06.2018
Check your server log.
Re: PlayerTextDrawString problem. -
DavidGravelli - 09.06.2018
Nothing in the server logs.
The console doesn't say anything.
Re: PlayerTextDrawString problem. -
Sew_Sumi - 09.06.2018
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...
Re: PlayerTextDrawString problem. -
Pottus - 09.06.2018
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.
Re: PlayerTextDrawString problem. -
0x88 - 09.06.2018
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
Re: PlayerTextDrawString problem. -
0x88 - 09.06.2018
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