Problem showing textdraw onplayerconnect | +REP
#1

I got this Onplayerconnect

pawn Код:
SetTimerEx("ShowIntro", 0000, 0, "d", playerid);
    settime();
    SetTimerEx("LoadingScreen", 1500, false, "i", playerid);
    GameTextForPlayer(playerid, "~w~Loading account info..", 1500, 3);
    SetPVarInt(playerid, "prelogin", 1);
    SetPVarInt(playerid, "SpecOff", 1);
    SetPVarInt(playerid, "givemehit", -1);
    SetPVarInt(playerid, "acceptcontract", -1);
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 1);
    new PlayerIp[32];
    GetPlayerIp(playerid, PlayerIp, 32);
    if(CheckBan(PlayerIp) == 1) {
    SendClientMessage(playerid, -1, "Your IP is banned from the server.");
    Kick(playerid);
    return 1;
    }
    GetPlayerIp(playerid, PlayerInfo[playerid][pIp], 50);
    SetPlayerColor(playerid, 0xFFFFFF00);
    return 1;
}
I want "ShowIntro" To appear first, I tried everything but it keep appearing after GameTextForPlayer(playerid, "~w~Loading account info..", 1500, 3); appears, it appears with dialogs, Can you guys help me ?
Reply
#2

Did you try to call the ShowIntro function just by doing ShowIntro(playerid); ?
Reply
#3

Tried it, It shows a black screen, and after the dialogs appear the Textdraw TEXT appears with them
Reply
#4

I think somehow the ShowIntro function takes longer to load or is delayed somehow..
If you can check that again, just to be sure, and if you can't find anything, post the function here, and we can have a look.
Reply
#5

There you go,

pawn Код:
forward ShowIntro(playerid);
public ShowIntro(playerid)
{
        SetPVarInt(playerid, "Intro", GetPVarInt(playerid, "Intro") + 1);
        new iteration = GetPVarInt(playerid, "Intro");
        switch(iteration)
        {
                case 1:
                {
                        for(new i; i < 11; i++)
                        {
                            SendClientMessage(playerid, -1, "");
                        }
                        TextDrawShowForPlayer(playerid, Intro[0]);
                }
                case 2:
                {
                    TextDrawShowForPlayer(playerid, Intro[1]);
                }
                case 3:
                {
            TextDrawShowForPlayer(playerid, Intro[2]);
                }
                case 4:
                {
                    TextDrawHideForPlayer(playerid, Intro[2]);
                    TextDrawShowForPlayer(playerid, Intro[3]);
                }
                case 5:
                {
                    TextDrawHideForPlayer(playerid, Intro[3]);
                    TextDrawShowForPlayer(playerid, Intro[4]);
                }
                case 6:
                {
                    TextDrawHideForPlayer(playerid, Intro[4]);
                    TextDrawShowForPlayer(playerid, Intro[5]);
                }
                case 7:
                {
                    TextDrawHideForPlayer(playerid, Intro[5]);
                    TextDrawShowForPlayer(playerid, Intro[6]);
                }
                case 8:
                {
                    TextDrawHideForPlayer(playerid, Intro[6]);
                    TextDrawShowForPlayer(playerid, Intro[7]);
                }
                case 9:
                {
                    TextDrawHideForPlayer(playerid, Intro[7]);
                    TextDrawShowForPlayer(playerid, Intro[8]);
                }
                case 10:
                {
                    TextDrawShowForPlayer(playerid, Intro[9]);
                }
                case 11:
                {
                    TextDrawShowForPlayer(playerid, Intro[10]);
                }
                case 12:
                {
                    TextDrawShowForPlayer(playerid, Intro[11]);
                }
        }
        if(GetPVarInt(playerid, "Intro") < 10)
        {
                SetTimerEx("ShowIntro", 000, 0, "d", playerid);
        }
        else if(9 < GetPVarInt(playerid, "Intro") < 13)
        {
        SetTimerEx("ShowIntro", 0000, 0, "d", playerid);
        }
        else
        {
            for(new i; i < sizeof(Intro); i++)
            {
                TextDrawHideForPlayer(playerid, Intro[i]);
            }
            TogglePlayerSpectating(playerid, false);
            ForceClassSelection(playerid);
           

        }
        return 1;
}
Reply
#6

I'm not totally sure on this one, it seems it's delayed somewhere..
If you can somehow delay the GameText thing aswell, it will at least look like you want.
Reply
#7

Allright, thank anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)