Player ID 0 bug. (when using a CMD)
#1

Hello, I have a quite big bug in my server.

I got a CMD called "varasta", when you are in the bank, it freezes you for 10 seconds and after the timer finishes it's supposed to unfreeze you & give you the random cash you stole. But when I am ID 1, and I do the CMD, then..
The CMD works fine, but the lines inside the timer, which unfreezes you and gives the cash, goes to the ID 0.

I do /varasta, the CMD freezes me, but the money and unfreeze line goes to ID 0. So I stay frozen inside the bank. Timers are bugged somehow.

pawn Код:
CMD:varasta(playerid, params[])
{
    new vworld;
    vworld = GetPlayerVirtualWorld(playerid);
    if(vworld == 1)
    {
        if(PlayerInfo[playerid][pRob] != 0) return SendClientMessage(playerid, C_GREY, "SERVER: Rццvida saab iga 5 minuti tagant, oota!");
        {
            if(!IsPlayerInRangeOfPoint(playerid, 10.0, 2312.6365,-8.4543,26.7422)) return SendClientMessage(playerid, C_RED, "SERVER: Sa oled panga lauast liiga kaugel (mine keskelepoole)!");
            {
                TogglePlayerControllable(playerid, false);
                GameTextForPlayer(playerid,"~r~PANGAST VARASTAMINE:~g~ Hetkel varastad pangast, oota 10 sekundit kuni raha on kotti laotud!",10000,5);
                SendClientMessageToAll(C_WHITE, "**************************** AVALIK TEADAANNE *****************************");
                SendClientMessageToAll(C_BLUE, "Palomino Creeki panka rццvitakse, дrge piirkonda suunduge!");
                SetTimerEx("Vabasta", 10000, false, "i", 0);
                SetTimerEx("Uuesti", 1000*60*5, false, "i", 0);
                PlayerInfo[playerid][pRob] = 1;
            }
        }
    }
    return 1;
}

public Vabasta(playerid)
{
    new string[64];
    new raha = 3000 + random(10000);
    format(string, sizeof(string), "TEADE: Rццvimine хnnestus, saagiks oli %d SAK!", raha);
    GivePlayerMoney(playerid, raha);
    TogglePlayerControllable(playerid, true);
    SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 2);
    SendClientMessage(playerid, C_ORANGE, string);
    SendClientMessage(playerid, C_GREEN, "TEADE: Pхgene kiirelt, pealtnдgijad teavitasid politseid!");
    SendClientMessage(playerid, C_RED, "SERVER: Uuesti saad rццvida 5 minuti pдrast.");
}

public Uuesti(playerid)
{
    PlayerInfo[playerid][pRob] = 0;
}
Reply
#2

SetTimerEx("Vabasta", 10000, false, "i", 0);
SetTimerEx("Uuesti", 1000*60*5, false, "i", 0);
The parameter for both those functions is 0, change it to playerid.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)