PDA

View Full Version : Textdraw Team.


Nicholas.
13/06/2012, 12:53 PM
I am trying to display my selected team/class when spawn using a textdraw but it won't work.

- OnPlayerConnect.


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.


TextDrawShowForPlayer(playerid, Team[playerid]);


- Forwards.

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;
}

park4bmx
13/06/2012, 01:12 PM
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

Nicholas.
14/06/2012, 01:21 AM
Didn't worked.

CidadeNovaRP
14/06/2012, 01:27 AM
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]);
}