13.06.2012, 11:53
I am trying to display my selected team/class when spawn using a textdraw but it won't work.
- OnPlayerConnect.
- OnPlayerSpawn.
- Forwards.
- 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);
pawn Код:
TextDrawShowForPlayer(playerid, Team[playerid]);
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;
}