SA-MP Forums Archive
Weather Flickering - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Weather Flickering (/showthread.php?tid=653887)



Weather Flickering - JasonRiggs - 15.05.2018

Hey,

So this might look kinda weird, It's my first time to see such a bug tho.. The weather is like blinking or flickering, for example if the weather is night, the sky flashes, gets light then dark in a part of the second, continuously.. So I don't know what is the cause of that, When i restart the server from the control panel it is fixed, but IG continues.


Re: Weather Flickering - RogueDrifter - 16.05.2018

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
Hey,

So this might look kinda weird, It's my first time to see such a bug tho.. The weather is like blinking or flickering, for example if the weather is night, the sky flashes, gets light then dark in a part of the second, continuously.. So I don't know what is the cause of that, When i restart the server from the control panel it is fixed, but IG continues.
Some weather ids are bugged i'll confirm that, what is ur weather id?


Re: Weather Flickering - JasonRiggs - 16.05.2018

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Some weather ids are bugged i'll confirm that, what is ur weather id?
It appears in the SA-MP client as "7", So let's say it's 7, while on the server start in the gamemode it is random between "12""13""15""18" i guess..

EDIT: I tried changing the weather to every single number from 1 to 20, But the flickering continues, like: Shadows appearing and disappearing, sky converts its brightness from light to dark continuously and so fast.


Re: Weather Flickering - RogueDrifter - 16.05.2018

That is very weird, these weather ids didnt bug for me the ones that did were 200+

However, maybeeee its a bug in your code? something making the server heavy perhaps?


Re: Weather Flickering - JasonRiggs - 16.05.2018

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
That is very weird, these weather ids didnt bug for me the ones that did were 200+

However, maybeeee its a bug in your code? something making the server heavy perhaps?
Something like what?? What can cause something like that, Imma also check the logs for anything like that.


Re: Weather Flickering - JasonRiggs - 16.05.2018

Great, got some shit on the logs.

Quote:

[11:43:19] [debug] #0 00089cd8 in public SecondTimer () from asd.amx
[11:43:19] [debug] Run time error 4: "Array index out of bounds"
[11:43:19] [debug] Attempted to read/write array element at negative index -1
[11:43:19] [debug] AMX backtrace:
[11:43:19] [debug] #0 00089cd8 in public SecondTimer () from asd.amx
[11:43:19] [debug] Run time error 4: "Array index out of bounds"
[11:43:19] [debug] Attempted to read/write array element at negative index -1
[11:43:19] [debug] AMX backtrace:
[11:43:19] [debug] #0 00089cd8 in public SecondTimer () from asd.amx
[11:43:20] [debug] Run time error 4: "Array index out of bounds"
[11:43:20] [debug] Attempted to read/write array element at negative index -1
[11:43:20] [debug] AMX backtrace:
[11:43:20] [debug] #0 00089cd8 in public SecondTimer () from asd.amx
[11:43:20] [debug] Run time error 4: "Array index out of bounds"
[11:43:20] [debug] Attempted to read/write array element at negative index -1
[11:43:20] [debug] AMX backtrace:
[11:43:20] [debug] #0 00089cd8 in public SecondTimer () from asd.amx
[11:43:20] [debug] Run time error 4: "Array index out of bounds"
[11:43:20] [debug] Attempted to read/write array element at negative index -1
[11:43:20] [debug] AMX backtrace:
[11:43:20] [debug] #0 00089cd8 in public SecondTimer () from asd.amx
[11:43:20] [debug] Run time error 4: "Array index out of bounds"
[11:43:20] [debug] Attempted to read/write array element at negative index -1
[11:43:20] [debug] AMX backtrace:
[11:43:20] [debug] #0 00089cd8 in public SecondTimer () from asd.amx
[11:43:20] [debug] Run time error 4: "Array index out of bounds"
[11:43:20] [debug] Attempted to read/write array element at negative index -1
[11:43:20] [debug] AMX backtrace:
[11:43:20] [debug] #0 00089cd8 in public SecondTimer () from asd.amx

PHP код:
forward SecondTimer();
public 
SecondTimer()
{
    new 
hourminutesecondboomboxidstring[128];

    
gettime(hourminutesecond);

    if((
gGMX) && mysql_unprocessed_queries(connectionID) == 0)
    {
        
SendRconCommand("gmx");
    }

    foreach(new 
Player)
    {
          
SetPlayerTime(ihourminute);

        if(
PlayerInfo[i][pLogged] && !PlayerInfo[i][pKicked])
        {
              
AFKCheck(i);
            
//NOPCheck(i);
            
if(PlayerInfo[i][pSpamTime] > 0)
            {
                
PlayerInfo[i][pSpamTime]--;
            }
            if(
PlayerInfo[i][pVehicleCount] > 0)
            {
                
PlayerInfo[i][pVehicleCount]--;
            }
            if(
PlayerInfo[i][pMechanicCall] > 0)
            {
                
PlayerInfo[i][pMechanicCall]--;
            }
            if(
PlayerInfo[i][pTaxiCall] > 0)
            {
                
PlayerInfo[i][pTaxiCall]--;
            }
            if(
PlayerInfo[i][pEmergencyCall] > 0)
            {
                
PlayerInfo[i][pEmergencyCall]--;
            }
            if(
PlayerInfo[i][pCourierCooldown] > 0)
            {
                
PlayerInfo[i][pCourierCooldown]--;
            }
               if(
PlayerInfo[i][pPizzaCooldown] > 0)
            {
                   
PlayerInfo[i][pPizzaCooldown]--;
            }
            if(
PlayerInfo[i][pDetectiveCooldown] > 0)
            {
                   
PlayerInfo[i][pDetectiveCooldown]--;
            }
            if(
PlayerInfo[i][pThiefCooldown] > 0)
            {
                   
PlayerInfo[i][pThiefCooldown]--;
            }
            if(
PlayerInfo[i][pCocaineCooldown] > 0)
            {
                   
PlayerInfo[i][pCocaineCooldown]--;
            }
            if(
PlayerInfo[i][pACFired] > 0)
            {
                
PlayerInfo[i][pACFired]--;
            }
            if(
PlayerInfo[i][pRapidFire] > 0)
            {
                
PlayerInfo[i][pRapidFire]--;
            }
            if(
PlayerInfo[i][pGodmode] > 0)
            {
                
PlayerInfo[i][pGodmode]--;
            } 
There is more of lines in this function but If I sent all you will just get lazy to read them all, although these are the newest edited ones, I just found out that they get less so quickly, So I don't know what to do with them.


Re: Weather Flickering - RogueDrifter - 16.05.2018

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
Great, got some shit on the logs.



PHP код:
forward SecondTimer();
public 
SecondTimer()
{
    new 
hourminutesecondboomboxidstring[128];

    
gettime(hourminutesecond);

    if((
gGMX) && mysql_unprocessed_queries(connectionID) == 0)
    {
        
SendRconCommand("gmx");
    }

    foreach(new 
Player)
    {
          
SetPlayerTime(ihourminute);

        if(
PlayerInfo[i][pLogged] && !PlayerInfo[i][pKicked])
        {
              
AFKCheck(i);
            
//NOPCheck(i);
            
if(PlayerInfo[i][pSpamTime] > 0)
            {
                
PlayerInfo[i][pSpamTime]--;
            }
            if(
PlayerInfo[i][pVehicleCount] > 0)
            {
                
PlayerInfo[i][pVehicleCount]--;
            }
            if(
PlayerInfo[i][pMechanicCall] > 0)
            {
                
PlayerInfo[i][pMechanicCall]--;
            }
            if(
PlayerInfo[i][pTaxiCall] > 0)
            {
                
PlayerInfo[i][pTaxiCall]--;
            }
            if(
PlayerInfo[i][pEmergencyCall] > 0)
            {
                
PlayerInfo[i][pEmergencyCall]--;
            }
            if(
PlayerInfo[i][pCourierCooldown] > 0)
            {
                
PlayerInfo[i][pCourierCooldown]--;
            }
               if(
PlayerInfo[i][pPizzaCooldown] > 0)
            {
                   
PlayerInfo[i][pPizzaCooldown]--;
            }
            if(
PlayerInfo[i][pDetectiveCooldown] > 0)
            {
                   
PlayerInfo[i][pDetectiveCooldown]--;
            }
            if(
PlayerInfo[i][pThiefCooldown] > 0)
            {
                   
PlayerInfo[i][pThiefCooldown]--;
            }
            if(
PlayerInfo[i][pCocaineCooldown] > 0)
            {
                   
PlayerInfo[i][pCocaineCooldown]--;
            }
            if(
PlayerInfo[i][pACFired] > 0)
            {
                
PlayerInfo[i][pACFired]--;
            }
            if(
PlayerInfo[i][pRapidFire] > 0)
            {
                
PlayerInfo[i][pRapidFire]--;
            }
            if(
PlayerInfo[i][pGodmode] > 0)
            {
                
PlayerInfo[i][pGodmode]--;
            } 
There is more of lines in this function but If I sent all you will just get lazy to read them all, although these are the newest edited ones, I just found out that they get less so quickly, So I don't know what to do with them.
Lets just make sure we know where the problem is coming from,

Take out all of the code (copy it somewhere else) from that function and restart the server to see if the problem presists.


Re: Weather Flickering - CodeStyle175 - 16.05.2018

fuck no don't make countdowns such way its just so wasteful to do that way.
there is really simple solution for that.
for example
PHP код:
PlayerInfo[playerid][pGodmode]=gettime()+30*60//added 30-seconds for example 
check for that in command or anywhere else
PHP код:
if(PlayerInfo[playerid][pGodmode]<gettime()){




Re: Weather Flickering - RogueDrifter - 17.05.2018

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Lets just make sure we know where the problem is coming from,

Take out all of the code (copy it somewhere else) from that function and restart the server to see if the problem presists.
..............


Re: Weather Flickering - JasonRiggs - 17.05.2018

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
..............
Whatever, The problem didn't continue, I now want to know what are the problems in here??

PHP код:
forward SecondTimer();
public 
SecondTimer()
{
    new 
hourminuteboomboxidstring[128];
    
gettime(hourminute);
    if((
gGMX) && mysql_unprocessed_queries(connectionID) == 0)
    {
        
SendRconCommand("gmx");
    }
    foreach(new 
Player)
    {
          
SetPlayerTime(ihourminute);
        if(
PlayerInfo[i][pLogged] && !PlayerInfo[i][pKicked])
        {
              
AFKCheck(i);
            
//NOPCheck(i);
            
if(PlayerInfo[i][pSpamTime] > 0)
            {
                
PlayerInfo[i][pSpamTime]--;
            }
            if(
PlayerInfo[i][pVehicleCount] > 0)
            {
                
PlayerInfo[i][pVehicleCount]--;
            }
            if(
PlayerInfo[i][pMechanicCall] > 0)
            {
                
PlayerInfo[i][pMechanicCall]--;
            }
            if(
PlayerInfo[i][pTaxiCall] > 0)
            {
                
PlayerInfo[i][pTaxiCall]--;
            }
            if(
PlayerInfo[i][pEmergencyCall] > 0)
            {
                
PlayerInfo[i][pEmergencyCall]--;
            }
            if(
PlayerInfo[i][pCourierCooldown] > 0)
            {
                
PlayerInfo[i][pCourierCooldown]--;
            }
               if(
PlayerInfo[i][pPizzaCooldown] > 0)
            {
                   
PlayerInfo[i][pPizzaCooldown]--;
            }
            if(
PlayerInfo[i][pDetectiveCooldown] > 0)
            {
                   
PlayerInfo[i][pDetectiveCooldown]--;
            }
            if(
PlayerInfo[i][pThiefCooldown] > 0)
            {
                   
PlayerInfo[i][pThiefCooldown]--;
            }
            if(
PlayerInfo[i][pCocaineCooldown] > 0)
            {
                   
PlayerInfo[i][pCocaineCooldown]--;
            }
            if(
PlayerInfo[i][pACFired] > 0)
            {
                
PlayerInfo[i][pACFired]--;
            }
            if(
PlayerInfo[i][pRapidFire] > 0)
            {
                
PlayerInfo[i][pRapidFire]--;
            }
            if(
PlayerInfo[i][pGodmode] > 0)
            {
                
PlayerInfo[i][pGodmode]--;
            } 
Also here..

PHP код:
AFKCheck(playerid)
{
    new
        
Float:x,
        
Float:y,
        
Float:z,
        
Float:cx,
        
Float:cy,
        
Float:cz;
    
GetPlayerPos(playeridxyz);
    
GetPlayerCameraPos(playeridcxcycz);
    if(
PlayerInfo[playerid][pAFKPos][0] == && PlayerInfo[playerid][pAFKPos][1] == && PlayerInfo[playerid][pAFKPos][2] == && PlayerInfo[playerid][pAFKPos][3] == cx && PlayerInfo[playerid][pAFKPos][4] == cy && PlayerInfo[playerid][pAFKPos][5] == cz)
    {
        
PlayerInfo[playerid][pAFKTime]++;
        if(!
PlayerInfo[playerid][pAFK] && PlayerInfo[playerid][pAFKTime] >= 60)
        {
            
SendClientMessage(playeridCOLOR_LIGHTORANGE"** You are now marked as {00AA00}Away from keyboard{F7A763} as you haven't moved in one minute.");
            
//SendClientMessage(i, COLOR_LIGHTRED, "SERVER: You have been marked as AFK as you haven't moved in one minute.");
            
PlayerInfo[playerid][pAFK] = 1;
        }
    }
    else
    {
        if(
PlayerInfo[playerid][pAFK])
        {
            if(
PlayerInfo[playerid][pAFKTime] < 120) {
                
//SendClientMessageEx(i, COLOR_LIGHTORANGE, "** You are no longer marked as Away from Keyboard after %i seconds.", PlayerInfo[playerid][pAFKTime]);
                
SendClientMessageEx(playeridCOLOR_LIGHTRED"SERVER: You are no longer marked as AFK after %i seconds."PlayerInfo[playerid][pAFKTime]);
            } else if(
PlayerInfo[playerid][pAFKTime] >= 120) {
                
//SendClientMessageEx(i, COLOR_LIGHTORANGE, "** You are no longer marked as Away from Keyboard after %i minutes.", PlayerInfo[playerid][pAFKTime] / 60);
                
SendClientMessageEx(playeridCOLOR_LIGHTRED"SERVER: You are no longer marked as AFK after %i minutes."PlayerInfo[playerid][pAFKTime] / 60);
            }
            
PlayerInfo[playerid][pAFK] = 0;
        }
        
PlayerInfo[playerid][pAFKTime] = 0;
    }
    
PlayerInfo[playerid][pAFKPos][0] = x;
    
PlayerInfo[playerid][pAFKPos][1] = y;
    
PlayerInfo[playerid][pAFKPos][2] = z;
    
PlayerInfo[playerid][pAFKPos][3] = cx;
    
PlayerInfo[playerid][pAFKPos][4] = cy;
    
PlayerInfo[playerid][pAFKPos][5] = cz;