Question about hosting/lag etc. Also timer issue and small things.
#1

Alright, basically I would like to clear this up.

I had an issue with Dialog opening having a delay (it still delays a little but not nearly as much). My question is...

For the purposes of a server development testing I had an account on King J servers, I purchased 2 slots.

Could for all intents and purposes opening a large dialog cause considerable lag?

When I went on localhost and hosted mysql etc locally, there is almost no delay at all.

Could someone suggest any fixes/other causes and a definitive answer?

TIMER ISSUE

Basically, my timer used as a clock like this:

21:31:45 format.

The seconds sometimes jump.

I tried using timerfix and it caused my timers to completely stop.

One other smaller question.

pawn Код:
for(new p = 0; p < MAX_PLAYERS; p++)
    {
        if(LoggedIn[p] == 1 && IsPlayerConnected(p))
        {
            if(AdminJail[p] > 0)
            {
                AdminJail[p] --;
               
                format(string, sizeof(string), "You have %d minute(s) left in Admin Jail.", AdminJail[p]);
                SendClientMessage(p, COLOUR_GREY, string);

                if(AdminJail[p] == 0)
                {
                    SendClientMessage(p, COLOUR_LIGHTBLUE, "You have been released from Admin Jail");
                    MySQL_SetInteger(PlayerSQLID[p], "AdminJail", -1, "accounts");
                    SetPlayerPos(p, -216.0915,972.2845,19.3201);
                    SetPlayerVirtualWorld(p, 0);
                    SetPlayerInterior(p, 0);
                    SetCameraBehindPlayer(p);//release.
                }
            }
        }
    }
This is under a one minute timer.

Why is that that although I make it send the client message updating the minutes if its > 0 that it still sends when it == 0. It's an annoying bug?

That would be great.
Reply
#2

Rather poor coding. If AdminJail[p] is 1 it'll still fall through. The variable is then decremented resulting in the message: "You have 0 minute(s) left in Admin Jail.".
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
Rather poor coding. If AdminJail[p] is 1 it'll still fall through. The variable is then decremented resulting in the message: "You have 0 minute(s) left in Admin Jail.".
With all due respect, this doesn't exactly aid me in resolving this. I'm not exactly an expert scripter and I'm going through a learning process; forgive me.
Reply
#4

Still unresolved.
Reply
#5

Try this code, because when the variable is set to 0, the message will show every time the timer updates, so that will keep sending the releasing message and setting your Position, also made some edit on your code.

pawn Код:
for(new p = 0; p < MAX_PLAYERS; p++)
{
    if ( LoggedIn[ p ] == 0 && !IsPlayerConnected( p ) ) continue;
   
    if ( AdminJail[ p ] >= 1 )
    {
        AdminJail[ p ] --;
       
        format( string, sizeof( string ), "You have %d minute(s) left in Admin Jail.", AdminJail[ p ] );
        SendClientMessage( p, COLOUR_GREY, string );
    }
    else if ( AdminJail[ p ] <= 0 )
    {
        SendClientMessage( p, COLOUR_LIGHTBLUE, "You have been released from Admin Jail" );
        MySQL_SetInteger( PlayerSQLID[ p ], "AdminJail", -1, "accounts" );
        SetPlayerPos( p, -216.0915,972.2845,19.3201 ), SetPlayerVirtualWorld( p, 0 ),
        SetPlayerInterior( p, 0 ), SetCameraBehindPlayer( p );
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)