TextDraw doesn't appear OnPlayerSpawn
#1

I have a problem. I am trying to appear a text draw. For example, if player spawns as team 1 member then under money bar appears texdraw "Team One" and If player spawns as team 2 member happens same.
Text draws works fine, only they don't work under OnPlayerSpawn same with text draw "Rank"
Only difference is that I wan't text draw "Rank" get to appear when player spawns. But even that text draw doesn't work.

gTeam system works fine.

Any ideas?


pawn Код:
public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == TEAM_ONE)
    {
        if(IsPlayerConnected(playerid))
        {
            TextDrawShowForPlayer(playerid, TeamOne);
        }
                return 1;
    }
    if(gTeam[playerid] == TEAM_TWO)
    {
        if(IsPlayerConnected(playerid))
        {
            TextDrawShowForPlayer(playerid, TeamTwo);
        }
        return 1;
    }
   
    TextDrawShowForPlayer(playerid, Rank);
   
    for(new i; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            TextDrawShowForPlayer(i, TeamOne);
            TextDrawShowForPlayer(i, TeamTwo);
            TextDrawShowForPlayer(i, Rank);
        }
    }
    return 1;
}
Reply
#2

Lets make a list

Quote:
Originally Posted by kasis223
Посмотреть сообщение
if player spawns ... then under money bar appears texdraw ...
1. Team textdraws apper if you spawn

Quote:
Originally Posted by kasis223
Посмотреть сообщение
... they don't work under OnPlayerSpawn ...
2. Textdraws dont work in OnPlayerSpawn

Quote:
Originally Posted by kasis223
Посмотреть сообщение
... I wan't text draw "Rank" get to appear when player spawns ... even that text draw doesn't work
3. Textdraw "Rank" doesnt work in OnPlayerSpawn


I would say item 1 and item 2 doesnt match

But I guess its just the return you used in your team statements

And whenever OnPlayerSpawn is called by the server the player is connected
pawn Код:
// OnPlayerSpawn
    if(gTeam[playerid] == TEAM_ONE)
    {
        TextDrawShowForPlayer(playerid, TeamOne);
    }
    else if(gTeam[playerid] == TEAM_TWO)
    {
        TextDrawShowForPlayer(playerid, TeamTwo);
    }
Reply
#3

You didn't get my idea!

Anyway I fixed this by adding
pawn Код:
TextDrawShowForPlayer(playerid, TeamOne);
Under OnPlayerRequestClass .

About "IsPlayerConnected"
I red that info somewhere while I was browsing for solution. But thanks! I will know that now.

However thanks, because I got this idea from your post, lol!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)