Bank Money
#1

So i made textdraw for money in bank. Script is working good, bu I dont know why but all players see bank money. I see money from all players on server. Can you help me? Here is my script:

OnPlayerSpawn
Код:
	format(statusbanka, sizeof(statusbanka), "$%i", APlayerData[playerid][BankMoney]);
	Novac = TextDrawCreate(499.000000, 108.000000, statusbanka);
	TextDrawBackgroundColor(Novac, 255);
	TextDrawFont(Novac, 3);
	TextDrawLetterSize(Novac, 0.509999, 1.600000);
	TextDrawColor(Novac, 65535);
	TextDrawSetOutline(Novac, 1);
	TextDrawSetProportional(Novac, 1);
	TextDrawSetSelectable(Novac, 0);
	APlayerData[playerid][Duznost] = 0;
	TextDrawHideForAll(Text:Novac);
	SetTimerEx("CheckBank", 2000, true, "i", playerid); */
Код:
public CheckBank(playerid)
{
    format(statusbanka, sizeof(statusbanka), "$%i", APlayerData[playerid][BankMoney]);
    TextDrawSetString(Text:Novac, statusbanka);
    TextDrawShowForPlayer(playerid, Text:Novac);
    TextDrawShowForPlayer(playerid, Text:Banka);
    return 1;
}
Reply
#2

maybe this will help you
https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
Quote:

PlayerTextDrawDestroy: Destroy a player-textdraw.

PlayerTextDrawColor: Set the color of the text in a player-textdraw.

PlayerTextDrawBoxColor: Set the color of a player-textdraw's box.

PlayerTextDrawBackgroundColor: Set the background color of a player-textdraw.

PlayerTextDrawAlignment: Set the alignment of a player-textdraw.

PlayerTextDrawFont: Set the font of a player-textdraw.

PlayerTextDrawLetterSize: Set the letter size of the text in a player-textdraw.

PlayerTextDrawTextSize: Set the size of a player-textdraw box (or clickable area for PlayerTextDrawSetSelectable).

PlayerTextDrawSetOutline: Toggle the outline on a player-textdraw.

PlayerTextDrawSetShadow: Set the shadow on a player-textdraw.

PlayerTextDrawSetProportional: Scale the text spacing in a player-textdraw to a proportional ratio.

PlayerTextDrawUseBox: Toggle the box on a player-textdraw.

PlayerTextDrawSetString: Set the text of a player-textdraw.

Reply
#3

pawn Код:
format(statusbanka, sizeof(statusbanka), "$%i", APlayerData[playerid][BankMoney]);
    Novac = TextDrawCreate(499.000000, 108.000000, statusbanka);
    TextDrawBackgroundColor(Novac[playerid], 255);
    TextDrawFont(Novac[playerid], 3);
    TextDrawLetterSize(Novac[playerid], 0.509999, 1.600000);
    TextDrawColor(Novac[playerid], 65535);
    TextDrawSetOutline(Novac[playerid], 1);
    TextDrawSetProportional(Novac[playerid], 1);
    TextDrawSetSelectable(Novac[playerid], 0);
    APlayerData[playerid][Duznost] = 0;
    TextDrawHideForAll(Text:Novac);
    SetTimerEx("CheckBank", 2000, true, "i", playerid); */

public CheckBank(playerid)
{
    format(statusbanka, sizeof(statusbanka), "$%i", APlayerData[playerid][BankMoney]);
    TextDrawSetString(Novac[playerid], statusbanka);
    TextDrawShowForPlayer(playerid, Novac[playerid]);
    TextDrawShowForPlayer(playerid, Text:Banka);
    return 1;
}
The thing is you need to relate the textdraw to the player himself, else you can see other people's bank money etc.

You need to put [MAX_PLAYERS] then Novac[playerid]
I don't know if I wrote something wrong here but anyway you get the idea.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)