Timer Problem or what? HELP!!
#1

Код:
#include <a_samp>
 
new Text:SubtitleTextdraw[MAX_PLAYERS];
new SubtitleInfo[MAX_PLAYERS];
 
forward NextSubtitle(playerid);
forward HideSubtitle(playerid);
 
stock CreateSubtitleTextdraws() // OnGameModeInit()
{
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            SubtitleTextdraw[i] = TextDrawCreate(341.000000, 373.000000, " ");
                TextDrawAlignment(SubtitleTextdraw[i], 2);
                TextDrawBackgroundColor(SubtitleTextdraw[i], 255);
                TextDrawFont(SubtitleTextdraw[i], 1);
                TextDrawLetterSize(SubtitleTextdraw[i], 0.460000, 1.800000);
                TextDrawColor(SubtitleTextdraw[i], -1);
                TextDrawSetOutline(SubtitleTextdraw[i], 1);
                TextDrawSetProportional(SubtitleTextdraw[i], 1);
                SubtitleInfo[i] = 0;
        }
}
 
stock DestroySubtitleTextdraw() // OnGameModeExit()
{
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
                TextDrawDestroy(SubtitleTextdraw[i]);
                SubtitleInfo[i] = 0;
        }
}
 
/*public ShowSubtitle(text[], seconds, ...)
{
        new arg_start = 2, playerid;
        while ((playerid = getarg(arg_start++)) < numargs()+1)
        {
                CallLocalFunction("HideSubtitle", "i", playerid);
                TextDrawSetString(SubtitleTextdraw[playerid], text);
                TextDrawShowForPlayer(playerid, SubtitleTextdraw[playerid]);
                SubtitleTimer[playerid] = SetTimerEx("HideSubtitle", seconds * 1000, 0, "i", playerid);
        }
}*/
 
public HideSubtitle(playerid)
{
        KillTimer(SubtitleInfo[playerid] & 0b11111111);
        SubtitleInfo[playerid] = 0;
        TextDrawHideForPlayer(playerid, SubtitleTextdraw[playerid]);
        return 1;
}
 
public NextSubtitle(playerid)
{
        switch ((SubtitleInfo[playerid] >> 8) & 0b1111)
        {
            case 1: // Visszaemlйkezйs
            {
                switch ((SubtitleInfo[playerid] >> 12) & 0b1111111)
                {
                    case 1:
                    {
                        TextDrawSetString(SubtitleTextdraw[playerid], "Csak nйhбny dolog maradt meg bennem....");
                        SubtitleInfo[playerid] &= (((SubtitleInfo[playerid] >> 12) & 0b1111111) + 1) << 12 | 1 << 8 | SetTimerEx("NextSubtitle", 4000, 0, "i", playerid);
                        }
                        case 2:
                        {
                                TextDrawSetString(SubtitleTextdraw[playerid], "Szinte mбr csak az utolsу nap ugrik be az előző йletemből..");
                                SubtitleInfo[playerid] &= (((SubtitleInfo[playerid] >> 12) & 0b1111111) + 1) << 12 | 1 << 8 | SetTimerEx("NextSubtitle", 4000, 0, "i", playerid);
                        }
                        /*
                                a fenti mуdon folytatod, a szцveget бtнrod, vagy az időt is esetleg, az utolsу pedig ilyen:
                        case UTOLSУ:
                        {
                            TextDrawSetString(SubtitleTextdraw[playerid], "Utolsу szцveg...");
                                SubtitleInfo[playerid] &= 0 << 12 | 1 << 8 | SetTimerEx("HideSubtitle", 4000, 0, "i", playerid);
                                }
                                */
                        }
                }
                case 2: // Gondolatok a megбllуban
                {
                    switch ((SubtitleInfo[playerid] >> 12) & 0b1111111)
                {
                    case 1:
                    {
                        TextDrawSetString(SubtitleTextdraw[playerid], "hisz szemйlyazonossбgom rejtйly, ~n~csinбltatni kell, mert a valуsat sem tudom...");
                        SubtitleInfo[playerid] &= (((SubtitleInfo[playerid] >> 12) & 0b1111111) + 1) << 12 | 2 << 8 | SetTimerEx("NextSubtitle", 4000, 0, "i", playerid);
                        }
                        case 2:
                        {
                                TextDrawSetString(SubtitleTextdraw[playerid], "Majd valamifйle munkбt is talбlnom kellene, hogy el tudjak indulni.~n~A beindulбshoz jуl fog jцnni ez az цsszeg, amit kaptunk a rendőrцktől,");
                                SubtitleInfo[playerid] &= (((SubtitleInfo[playerid] >> 12) & 0b1111111) + 1) << 12 | 2 << 8 | SetTimerEx("NextSubtitle", 4000, 0, "i", playerid);
                        }
                        case 3:
                        {
                                TextDrawSetString(SubtitleTextdraw[playerid], "mert nem talбltak tulajdonosбra, hisz a~n~rablуknбl volt, йs ъgy feltйteleztйk tőlьnk van..");
                                SubtitleInfo[playerid] &= (((SubtitleInfo[playerid] >> 12) & 0b1111111) + 1) << 12 | 2 << 8 | SetTimerEx("NextSubtitle", 4000, 0, "i", playerid);
                        }
                         
                        /*
                                a fenti mуdon folytatod, a szцveget бtнrod, vagy az időt is esetleg, az utolsу pedig ilyen:
                        case UTOLSУ:
                        {
                            TextDrawSetString(SubtitleTextdraw[playerid], "Utolsу szцveg...");
                                SubtitleInfo[playerid] &= 0 << 12 | 2 << 8 | SetTimerEx("HideSubtitle", 4000, 0, "i", playerid);
                                }
                                */
                        }
                }
        }
        return 1;
}
 
forward Megmenekules(playerid,part);
public Megmenekules(playerid,part)
{
        if(IsPlayerConnected(playerid) && Logged(playerid))
        {
                if(PlayerInfo[playerid][pTut] == 0)
                {
                    if(part == 1)
                    {
                        HideDialog(playerid);
                                if(Magyar(playerid))
                                        GameTextForPlayer(playerid, "~n~~n~~n~~g~Utazбs...", 30000, 5);
                                else
                                        GameTextForPlayer(playerid, "~n~~n~~n~~g~Traveling...", 30000, 5);
                        SetPlayerInterior(playerid,0);
                        SetPlayerPos(playerid,-1963.5682,96.9067,4.3183);
                                ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
                                Freeze(playerid,5000);
                        SetTimerEx("Megmenekules",90000,0,"dd",playerid,2);
                                Cselekves(playerid, "Leьl a vonaton йs visszagondol a mъltra mi is tцrtйnt vele.");
                               
                                // Felirat
                                CallLocalFunction("HideSubtitle", "i", playerid);
                                TextDrawSetString(SubtitleTextdraw[playerid],
                                        "Alig emlйkszem mбr arra a napra, amikor tцbbй~n~nem mehettem haza a szeretteimhez, barбtaimhoz...");
                                TextDrawShowForPlayer(playerid, SubtitleTextdraw[playerid]);
                        SubtitleInfo[playerid] &= 1 << 12 | 1 << 8 | SetTimerEx("NextSubtitle", 6000, 0, "i", playerid);
                    }
                    else if(part == 2)
                    {
                        SetPlayerInterior(playerid, 0);
                        SetPlayerVirtualWorld(playerid, 0);
                        SetPlayerPos(playerid, -1951.1206, 138.4060, 26.613);
                        GiveMoney(playerid,250000);
                                if(Magyar(playerid))
                                Cselekves(playerid, "Leszбll a vonatrуl , nйzelődik йs gondolkodik.");
                                GameTextForPlayer(playerid, "'~n~~n~~n~~g~Megйrkeztьnk", 1000, 1);
                                Freeze(playerid,5000);
                                /*GameTextForPlayer(playerid, "'~n~~n~~n~~g~Megtudtam, hogy 2013-at нrunk, йs az utamnak a vбroshбzбba kell, hogy vezessen...", 5000, 1);
                                GameTextForPlayer(playerid, "'~n~~n~~n~~g~hisz szemйlyazonossбgom rejtйly, csinбltatni kell, mert a valуsat sem tudom..", 5000, 1);
                                GameTextForPlayer(playerid, "'~n~~n~~n~~g~Majd valamifйle munkбt is talбlnom kellene, hogy el tudjak indulni...", 5000, 1);
                                GameTextForPlayer(playerid, "'~n~~n~~n~~g~A beindulбshoz jуl fog jцnni ez az цsszeg, amit kaptunk a rendőrцktől...", 5000, 1);
                                GameTextForPlayer(playerid, "'~n~~n~~n~~g~ mert nem talбltak tulajdonosбra, hisz a rablуknбl volt, йs ъgy feltйteleztйk tőlьnk van..", 5000, 1);
                                GameTextForPlayer(playerid, "'~n~~n~~n~~g~El kellene jutnom valamilyen kцzцssйghez is...", 5000, 1);
                                GameTextForPlayer(playerid, "'~n~~n~~n~~g~mбr 3 йve nem beszйltem tцbb emberrel, ideje barбtokat szereznem!", 5000, 1);
                                */
 
                // Felirat
                                CallLocalFunction("HideSubtitle", "i", playerid);
                                TextDrawSetString(SubtitleTextdraw[playerid],
                                        "Megtudtam, hogy 2013-at нrunk, йs az utamnak a vбroshбzбba kell, hogy vezessen,");
                                TextDrawShowForPlayer(playerid, SubtitleTextdraw[playerid]);
                        SubtitleInfo[playerid] &= 1 << 12 | 2 << 8 | SetTimerEx("NextSubtitle", 6000, 0, "i", playerid);
                       
                        // Ezek itt alul sztem a beszйd utбn jцnnek,akkor tedd бt a NextSubtitle() megfelelő rйszйbe...
                                Cselekves(playerid,"Йszrevesz valamit a fцldцn йs felveszi.");
                                GameTextForPlayer(playerid, "'~n~~n~~n~~g~Ohh, csak nem egy vбrosi ъtmutatу? mйg hasznomra lehet!", 5000, 1);
                                PlayerInfo[playerid][pLokator] = 1;
                               
                                //else
                                        //Msg(playerid,"The State has received an emergency 1000.000Ft!");
                                       
                                //if(Magyar(playerid))
                                        //GameTextForPlayer(playerid, "~n~~n~~n~~g~Megйrkeztьnk", 1000, 5);
                                //else
                                        //GameTextForPlayer(playerid, "~n~~n~~n~~g~We have arrived!", 1000, 5);
 
                                DisablePlayerCheckpoint(playerid);
                                SetPlayerCheckpoint(playerid,-1958.5061,116.0761,27.6875,3.0);
                                PlayerInfo[playerid][pTut] = 1;
                                AdatMentesSQL(playerid);
                                //TogglePlayerControllable(playerid,false);
                    }
                }
        }
        return 1;
}
What's the problem? Its stop "alig emlйkszem mбr arra..." HELP pls!
Reply
#2

My guess is, do you see this?

pawn Код:
/*public ShowSubtitle(text[], seconds, ...)
{
        new arg_start = 2, playerid;
        while ((playerid = getarg(arg_start++)) < numargs()+1)
        {
                CallLocalFunction("HideSubtitle", "i", playerid);
                TextDrawSetString(SubtitleTextdraw[playerid], text);
                TextDrawShowForPlayer(playerid, SubtitleTextdraw[playerid]);
                SubtitleTimer[playerid] = SetTimerEx("HideSubtitle", seconds * 1000, 0, "i", playerid);
        }
}*/
Uncomment it, THAT meaning, remove the "/*" and the "*/". and it might work.
Reply
#3

I remove /* , */....

C:\Users\Rendszergazda\Desktop\SF-RP\gamemodes\sfrp.pwn(26370) : warning 235: public function lacks forward declaration (symbol "ShowSubtitle")
C:\Users\Rendszergazda\Desktop\SF-RP\gamemodes\sfrp.pwn(2637 : error 017: undefined symbol "SubtitleTimer"
C:\Users\Rendszergazda\Desktop\SF-RP\gamemodes\sfrp.pwn(2637 : warning 215: expression has no effect
C:\Users\Rendszergazda\Desktop\SF-RP\gamemodes\sfrp.pwn(2637 : error 001: expected token: ";", but found "]"
C:\Users\Rendszergazda\Desktop\SF-RP\gamemodes\sfrp.pwn(2637 : error 029: invalid expression, assumed zero
C:\Users\Rendszergazda\Desktop\SF-RP\gamemodes\sfrp.pwn(2637 : fatal error 107: too many error messages on one line
Reply
#4

Add those.
pawn Код:
forward ShowSubtitle(text[], seconds, ...);
new SubtitleTimer[MAX_PLAYERS];
Reply
#5

Don't Work :/ , what's problem ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)