"Gray box" with text?
#1

So I've been to a couple of servers where there have been "gray boxes".
These "boxes" contains for example your stats when you do '/stats', or general information from the server, in stead of showing your stats in the chat box.
How can I make something like this? What kind a function is it?
Thank you
Reply
#2

Maybe you mean the TextDraw box?

https://sampwiki.blast.hk/wiki/TextDrawUseBox
https://sampwiki.blast.hk/wiki/TextDrawBoxColor
But first, you have to create a textdraw: https://sampwiki.blast.hk/wiki/TextDrawCreate
Reply
#3

Thank you, that's correct!
I tried to make it to a box, but it looks like this (the long, gray line):


How can I make it like the red box?
pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    statsbox = TextDrawCreate(1.000000,200.000000,"Stats");
    TextDrawFont(statsbox,1);
    TextDrawColor(statsbox,0xFFFFFFAA);
    TextDrawLetterSize(statsbox,0.599999,1.000000);
    TextDrawSetOutline(statsbox,0);
    TextDrawSetShadow(statsbox,0);
    TextDrawSetProportional(statsbox,1);
    TextDrawBackgroundColor(statsbox,0x000000ff);
    TextDrawUseBox(statsbox,1);
    TextDrawBoxColor(statsbox,0xAFAFAFAA);
    TextDrawAlignment(statsbox,1);
    return 1;
}
Reply
#4

I prefer this: http://forum.sa-mp.com/index.php?topic=29132.0
Use it, it's very easy.
Reply
#5

Quote:
Originally Posted by Don Correlli
I prefer this: http://forum.sa-mp.com/index.php?topic=29132.0
Use it, it's very easy.
Thank you, that made everything much easier !
Now I have a box that looks like this:


How can I fill in with "Money:"
"Level:"
Etc?
The "Money" one can just use GetPlayerMoney(); or something, but how to use it within the textdraw?

pawn Код:
Textdraw0 = TextDrawCreate(2.000000,189.000000,"stats");
    TextDrawUseBox(Textdraw0,1);
    TextDrawBoxColor(Textdraw0,0x00000066);
    TextDrawTextSize(Textdraw0,104.000000,39.000000);
    TextDrawAlignment(Textdraw0,1);
    TextDrawBackgroundColor(Textdraw0,0x00000066);
    TextDrawFont(Textdraw0,3);
    TextDrawLetterSize(Textdraw0,1.000000,1.200000);
    TextDrawColor(Textdraw0,0xffffffff);
    TextDrawSetOutline(Textdraw0,1);
    TextDrawSetProportional(Textdraw0,1);
    TextDrawSetShadow(Textdraw0,1);
Reply
#6

getplayermoney
Reply
#7

Quote:
Originally Posted by Serediucr
getplayermoney
Uhm... I asked HOW do I use it within the TextDraw? Your answer didn't help me at all.
Reply
#8

Something like this:
pawn Код:
format(string, sizeof(string), "Money: %d", GetPlayerMoney(playerid));
TextDrawSetString(TextDraw0[playerid], string);
TextDrawShowForPlayer(playerid, TextDraw0[playerid]);
I prefer to use playerid param with textdraw in this case, since you want to show money for every player, but you also must create textdraw for all players and you must use textdraw variable like this:
pawn Код:
new Text:TextDraw0[MAX_PLAYERS];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)