Textdraw Team.
#1

I am trying to display my selected team/class when spawn using a textdraw but it won't work.

- OnPlayerConnect.

pawn Код:
Team[playerid] = TextDrawCreate(495.000000, 118.000000, "Team: %s");
    TextDrawBackgroundColor(Team[playerid], 255);
    TextDrawFont(Team[playerid], 1);
    TextDrawLetterSize(Team[playerid], 0.420000, 1.900000);
    TextDrawColor(Team[playerid], -1);
    TextDrawSetOutline(Team[playerid], 1);
    TextDrawSetProportional(Team[playerid], 1);
- OnPlayerSpawn.

pawn Код:
TextDrawShowForPlayer(playerid, Team[playerid]);
- Forwards.

pawn Код:
forward Stats(playerid);
public Stats(playerid)
{
    new String[5];
    format(String, sizeof(String), "Team: %s", GetTeamName(playerid));
    TextDrawSetString(Team[playerid], String);
}

forward GetTeamName(playerid);
public GetTeamName(playerid)
{
    new String[30];
    switch(GetPlayerTeam(playerid))
    {
        case 0: format(String, sizeof(String), "---");
        case 1: format(String, sizeof(String), "---");
        case 2: format(String, sizeof(String), "---");
        case 3: format(String, sizeof(String), "---");
        case 4: format(String, sizeof(String), "---");
    }
    return 1;
}
Reply
#2

pawn Код:
forward GetTeamName(playerid);
public GetTeamName(playerid)
{
    new String[30];
    switch(GetPlayerTeam(playerid))
    {
        case 0: format(String, sizeof(String), "---");
        case 1: format(String, sizeof(String), "---");
        case 2: format(String, sizeof(String), "---");
        case 3: format(String, sizeof(String), "---");
        case 4: format(String, sizeof(String), "---");
    }
    return String;
}
you need to return the string
also if it dont work but it should if you have the GetPlayerTeam(playerid) defined currectly
Reply
#3

Didn't worked.
Reply
#4

pawn Код:
forward Stats(playerid);
public Stats(playerid)
{
    new String[5];
    format(String, sizeof(String), "Team: %s", GetTeamName(playerid));
    TextDrawHideForPlayer(playerid, Team[playerid]);
    TextDrawSetString(Team[playerid], String);
    TextDrawShowForPlayer(playerid, Team[playerid]);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)