Timer

Započeo Fr0z3n, Maj 20, 2020, 14:27:01 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Zasto kada pozovem timer i stopiram ga on idalje nastavlja da radi??
Dio skripte: [pawn]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);
}[/pawn]

Ovde ga pozivam: [pawn]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;
}[/pawn]

A ovde stopiram:

[pawn]public LoginCeka(playerid)
{
    TDLoginHide(playerid);
    if(UlogovanIgrac[playerid] != 1)
    {[/pawn]

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

Ispod LoginCeka nema koda gdje stopiraš, probaj ovo:
[pawn]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);
}[/pawn]
Citat: CheezItFollow your heart and own style.
Citat: PottusThat 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 :)

warning 209: function "TDLogin" should return a value

Citat: Fr0z3n poslato Maj 23, 2020, 15:50:09 POSLE PODNE
warning 209: function "TDLogin" should return a value
Samo ti kaže šta fali.

uradio sam return i idalje mi ostaje cak i kad se spawnam mi ostaje