SA-MP Forums Archive
some questions - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: some questions (/showthread.php?tid=281036)



some questions - the0 - 04.09.2011

hi i have some questions that i hope you can help me with

i was wondering it's possible to get different colors on a textdraw? and i don't mean ~r~ etc i mean 0xFF etc colors, like say

(white)Scores: (blue) TEAM A 0 - (red) TEAM B 1

but i want the actual colors of the teams is it possible? i define the textdraw as one textdraw and it is constantly updating with team scores

also i would like to know if someone is willing to convert a script for me from strtok to dcmd or zcmd payment is possible but pm me about that


Re: some questions - admantis - 04.09.2011

Hexadecimal colors are not supported on textdraws (i'm not sure, but i talk by experience).


Re: some questions - the0 - 04.09.2011

I have seen it before though...

For example

(Team A's color)TEAM A - (Team B's color) Team B

And I can't get them colors via standard ~r~ etc, I usually define them colors as teamactivecolors[gteam[playerid]]


Re: some questions - Kingunit - 04.09.2011

Why that doens't work? Errors?


Re: some questions - Steven82 - 04.09.2011

Maybe make multiple textdraws. With the strings the colors you want.


Re: some questions - dowster - 04.09.2011

Merry Christmas
https://sampwiki.blast.hk/wiki/TextDrawColor
:P

just use some fancy coordinates


Re: some questions - the0 - 04.09.2011

I know how to use TextDrawColor but what if I want different colors in the same textdraw?


Re: some questions - the0 - 04.09.2011

Quote:
Originally Posted by Steven82
Посмотреть сообщение
Maybe make multiple textdraws. With the strings the colors you want.
could you explain further please, or give an example

pawn Код:
stock CreatePlayerInfo(playerid)
{
    // first text-draw.
    InfoTextDraw[playerid][0] = TextDrawCreate(511.000000,102.000000, "Information textdraw 1");
    TextDrawTextSize(InfoTextDraw[playerid][0], 850.0, 0.0);
    TextDrawAlignment(InfoTextDraw[playerid][0], 0);
    TextDrawBackgroundColor(InfoTextDraw[playerid][0], 0x000000ff);
    TextDrawFont(InfoTextDraw[playerid][0], 0);
    TextDrawLetterSize(InfoTextDraw[playerid][0], 0.399999,1.500000);
    TextDrawColor(InfoTextDraw[playerid][0], 0xffffffff);
    TextDrawSetShadow(InfoTextDraw[playerid][0], 1);
    TextDrawSetOutline(InfoTextDraw[playerid][0],1);
    TextDrawSetProportional(InfoTextDraw[playerid][0],1);
    // second text-draw.
    InfoTextDraw[playerid][1] = TextDrawCreate(511.000000,102.000000, "Information textdraw 2");
    TextDrawTextSize(InfoTextDraw[playerid][1], 850.0, 0.0);
    TextDrawAlignment(InfoTextDraw[playerid][1], 0);
    TextDrawBackgroundColor(InfoTextDraw[playerid][1], 0x000000ff);
    TextDrawFont(InfoTextDraw[playerid][1], 0);
    TextDrawLetterSize(InfoTextDraw[playerid][1], 0.399999,1.500000);
    TextDrawColor(InfoTextDraw[playerid][1], 0xffffffff);
    TextDrawSetShadow(InfoTextDraw[playerid][1], 1);
    TextDrawSetOutline(InfoTextDraw[playerid][1],1);
    TextDrawSetProportional(InfoTextDraw[playerid][1],1);
    isInfoTDCreated1[playerid] = true;
    return true;
}
i am currently doing that to create my textdraws

and this for the string

pawn Код:
format(textdrawString, 256,"~r~~h~%s - ~w~%d ~b~~h~%s - ~w~%d",TeamName[T_HOME],TeamRoundsWon[T_HOME],TeamName[T_AWAY],TeamRoundsWon[T_AWAY]);
but i want the TeamName[T_HOME] to be the team color and the same for away


Re: some questions - Yamoo - 04.09.2011

Like the player's name to be a certain colour?

For example;

Team A player's name will be blue and Team B player's name to be red?


Re: some questions - admantis - 05.09.2011

pawn Код:
stock FixPlayerColors()
{
    for( new i = 0; i < MAX_PLAYERS; i++) // foreach(Player, i)
    {
        if ( ! IsPlayerConnected( i ) ) continue;
        switch ( team[i] ) // or your team identifier
        {
            case team_red: // or your red team identifier
            {
                SetPlayerColor( i , 0xFF0000FF );      
            }
            case team_blue: // or your blue team identifier
            {
                SetPlayerColor( i , 0x0000FFFF );
            }
        }
    }
    return true;
}