A timer (with y_timers) is freezing the compiler...
#1

EDIT: As it turns out, y_timers won't handle anything more than three passed variables. Not sure why this is, probably due to the the way ****** wrote SetTimerEx(). I'm using YSI 3.0, so it might of been fixed in 4.0 (don't quote me on that, though). Nevertheless, I figured it out and fixed my problem. I'll leave this here if someone else discovers this.



Yeah so not sure what the hell is wrong, never had this problem before. Have lots of timers already in the mode and haven't had a problem like this before. I've commented the contents of the whole timer out and literally just left this but it still freezes the compiler. I tried using a "task" and a "ptask" and that works, but that's not what I want for this.

They say two eyes are better than one- perhaps you see something I don't? Lemme' know!

pawn Код:
timer timerCallPhone[3000](playerid, callerPhoneID, target, targetPhoneID, step)
{
    if(target == INVALID_PLAYER_ID)
    {
        stop playerPhones[playerid][phoneCallTimer][callerPhoneID];
        resetPhoneVariables(playerid);
        resetPhoneVariables(target);
       
        return SendClientMessage(playerid, COLOR_LIGHTRED, "(( The person you are calling has disconnected. ))");
    }

    switch(step)
    {
        case 0 .. 8:
        {
            //playerPhones[playerid][phoneCallTimer][callerPhoneID] = defer timerCallPhone(playerid, callerPhoneID, target, targetPhoneID, (step+1));
            SendNearbyMessagef(target, COLOR_ME, "* %s's phone rings.", CheckPlayerName(target));
            SendClientMessage(playerid, COLOR_YELLOW, "* "#COL_WHITE"Ringing...");
        }
        default:
        {
            SetPVarInt(playerid, "USED_PHONE_ID", callerPhoneID);
            SetPVarInt(playerid, "CALLED_PHONE_ID", targetPhoneID);
            playerPhones[playerid][phoneStatus][phoneID] = CALL_STATUS_VOICEMAIL;
       
            SendClientMessagef(playerid, COLOR_YELLOW, "* "#COL_WHITE"You have reached the voicemail box of "#COL_LBLUE"%s"#COL_WHITE"."), playerPhones[target][phoneCallerID][targetPhoneID]);
            SendClientMessage(playerid, COLOR_YELLOW, "* "#COL_WHITE"If you would like to leave a voicemail, please speak now. If not, please hang up!");
           
            resetPhoneVariables(target);
        }
    }
    return 1;
}
This doesn't even work:

pawn Код:
timer timerCallPhone[3000](playerid, callerPhoneID, target, targetPhoneID, step)
{
   
}
Reply
#2

(not meaning to double post here)

Solved. Read EDIT on main thread.
Reply
#3

It's because lines cannot be longer than 512 characters. You should use pawn compiler patch by Zeex https://github.com/Zeex/pawn

In the fact you can use short variable names like
Код:
timerCallPhone[3000](p, cpid, t, tpid, s)
Reply
#4

The reason is because the timer keyword is in fact a define that gets replaced with something a bit long.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)