PARTNERI:
-UPOZORENJE-

Samo registrovani članovi mogu da vide/koriste forum u celini.
Prijavite se ili registrujte nalog na Balkan SA-MP forumu.


Autor Tema: [Pomoc] Timer  (Pročitano 82 puta)

0 članova i 1 gost pregledaju ovu temu.

Van mreže Fr0z3n

Timer
« poslato: Maj 20, 2020, 14:27:01 posle podne »
Problem(error/warning): Zasto kada pozovem timer i stopiram ga on idalje nastavlja da radi??
Dio skripte:
Pawno Code: [Izaberi]
timer TDLogin[ 2200 ]( playerid, option )
{
    switch( option )
    {
        case 0: TextDrawShowForPlayer(playerid, LogReg_gTD[0]);
        case 1: TextDrawShowForPlayer(playerid, LogReg_gTD[1]);
        case 2: TextDrawShowForPlayer(playerid, LogReg_gTD[2]);
        case 3: TextDrawShowForPlayer(playerid, LogReg_gTD[3]);
        case 4: TextDrawShowForPlayer(playerid, LogReg_gTD[4]);
        case 5: TextDrawShowForPlayer(playerid, LogReg_gTD[5]);
        case 6: TextDrawShowForPlayer(playerid, LogReg_gTD[6]);
        case 7: TextDrawShowForPlayer(playerid, LogReg_gTD[7]);
        case 8: TextDrawShowForPlayer(playerid, LogReg_gTD[8]);
    }
    if( option+1 > 8 ) stop TDLogin(playerid, -1);
    defer TDLogin(playerid, option+1);
}

Ovde ga pozivam:
Pawno Code: [Izaberi]
public OnPlayerRequestClass(playerid, classid)
{
    lz_SetPlayerPos(playerid, 2057.441406, 1291.667358, 15.748653);
    PlayerPlaySound(playerid, 1069, 0.0, 0.0, 0.0);
    GetPlayerPos(playerid,X,Y,Z);
    Streamer_UpdateEx(playerid,X,Y,Z);
    SetTimerEx("LoginCeka", 22000, false, "i", playerid);
    defer TDLogin(playerid, 0);
    ClearChatbox(playerid, 20);
    SCM(playerid, -1, "{00CED1}====================================");
    SCM(playerid, -1, "");
    SCM(playerid, -1, "{00CED1}    HARD LIFE ROLEPLAY COMMUNITY");
    SCM(playerid, -1, "");
    SCM(playerid, -1, "{00CED1}====================================");
    stop TDLogin(playerid, -1);
    return true;
}

A ovde stopiram:

Pawno Code: [Izaberi]
public LoginCeka(playerid)
{
    TDLoginHide(playerid);
    if(UlogovanIgrac[playerid] != 1)
    {

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
Kod:
//
Slika/video ingame problema(obavezno ako je ingame problem): //
Skriper of "MatrixCommunity"
 

Van mreže Shadow.

Odg: Timer
« Odgovor #1 poslato: Maj 20, 2020, 17:39:58 posle podne »
Ispod LoginCeka nema koda gdje stopiraš, probaj ovo:
Pawno Code: [Izaberi]
timer TDLogin[ 2200 ]( playerid, option )
{
    switch( option )
    {
        case 0: TextDrawShowForPlayer(playerid, LogReg_gTD[0]);
        case 1: TextDrawShowForPlayer(playerid, LogReg_gTD[1]);
        case 2: TextDrawShowForPlayer(playerid, LogReg_gTD[2]);
        case 3: TextDrawShowForPlayer(playerid, LogReg_gTD[3]);
        case 4: TextDrawShowForPlayer(playerid, LogReg_gTD[4]);
        case 5: TextDrawShowForPlayer(playerid, LogReg_gTD[5]);
        case 6: TextDrawShowForPlayer(playerid, LogReg_gTD[6]);
        case 7: TextDrawShowForPlayer(playerid, LogReg_gTD[7]);
        case 8: TextDrawShowForPlayer(playerid, LogReg_gTD[8]);
    }
    if( option+1 > 8 ) { stop TDLogin(playerid, -1); return ( true ); }
    defer TDLogin(playerid, option+1);
}
Citat: CheezIt
Follow your heart and own style.
Citat: Pottus
That is perfectly fine, I'm just pointing out where you made mistakes what does hearing "good job" get you? Absolutely nothing. You need to hear the problems otherwise you'll keep making the same mistakes :)
 

Van mreže Fr0z3n

Odg: Timer
« Odgovor #2 poslato: Maj 23, 2020, 15:50:09 posle podne »
warning 209: function "TDLogin" should return a value
Skriper of "MatrixCommunity"
 

Van mreže Darkic

Odg: Timer
« Odgovor #3 poslato: Maj 23, 2020, 15:54:23 posle podne »
warning 209: function "TDLogin" should return a value
Samo ti kaže šta fali.
 

Van mreže Fr0z3n

Odg: Timer
« Odgovor #4 poslato: Maj 23, 2020, 15:57:04 posle podne »
uradio sam return i idalje mi ostaje cak i kad se spawnam mi ostaje
Skriper of "MatrixCommunity"