SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/05/2018, 12:32 PM   #11
CodeStyle175
Huge Clucker
 
CodeStyle175's Avatar
 
Join Date: Apr 2014
Posts: 310
Reputation: 18
Default Re: Weather Flickering

for example speedcamID if player isnt near speedcam it will return -1 and its put in array and array doesn't have -1 slot, so add check for -1 where number is used in array.
CodeStyle175 is offline   Reply With Quote
Old 16/05/2018, 01:11 PM   #12
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 604
Reputation: 18
Default Re: Weather Flickering

Now the server crashed for a reason which I don't know, Here are the logs..

Quote:
[14:37:58] [debug] Server crashed due to an unknown error
[14:37:58] [debug] Native backtrace:
[14:37:58] [debug] #0 f73bb180 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so
[14:37:58] [debug] #1 f73b3064 in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7C ontextE () from plugins/crashdetect.so
[14:37:58] [debug] #2 f73b3d64 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7Cont extE () from plugins/crashdetect.so
[14:37:58] [debug] #3 f73b5cdb in _ZN11CrashDetect7OnCrashERKN2os7ContextE () from plugins/crashdetect.so
[14:37:58] [debug] #4 f73ba4d5 in ?? () from plugins/crashdetect.so
[14:37:58] [debug] #5 f771ad50 in __kernel_rt_sigreturn () from linux-gate.so.1
[14:37:58] [debug] #6 f771ad70 in __kernel_vsyscall () from linux-gate.so.1
[14:37:58] [debug] #7 f7412367 in gsignal () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[14:37:58] [debug] #8 f7413a23 in abort () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[14:37:58] [debug] #9 f7640a25 in _ZN9__gnu_cxx27__verbose_terminate_handlerEv () from /usr/lib/i386-linux-gnu/libstdc++.so.6
[14:37:58] [debug] #10 f763e733 in ?? () from /usr/lib/i386-linux-gnu/libstdc++.so.6
[14:37:58] [debug] #11 f763e7ad in ?? () from /usr/lib/i386-linux-gnu/libstdc++.so.6
[14:37:58] [debug] #12 f763eace in __cxa_rethrow () from /usr/lib/i386-linux-gnu/libstdc++.so.6
[14:37:58] [debug] #13 f5f243ff in _ZNSt8__detail9_Map_baseIhSt4pairIKhNSt7__cxx1112b asic_stringIcSt11char_traitsIcESaIcEEEESaIS9_ENS_1 0_Select1stESt8equal_toIhESt4hashIhENS_18_Mod_rang e_hashingENS_20_Default_ranged_hashENS_20_Prime_re hash_policyENS_17_Hashtable_traitsILb0ELb0ELb1EEEL b1EEixEOh () from plugins/YSF.so
[14:37:58] [debug] #14 f5f2275c in ?? () from plugins/YSF.so
[14:37:58] [debug] #15 f7317052 in sampgdk_SetPlayerObjectMaterialText () from plugins/streamer.so
[14:37:58] [debug] #16 f736def7 in _ZN8Streamer13streamObjectsER6Playerb () from plugins/streamer.so
[14:37:58] [debug] #17 f7371889 in _ZN8Streamer24performPlayerChunkUpdateER6Playerb () from plugins/streamer.so
[14:37:58] [debug] #18 f7376404 in _ZN8Streamer20startAutomaticUpdateEv () from plugins/streamer.so
[14:37:58] [debug] #19 f73341d5 in ProcessTick () from plugins/streamer.so
[14:37:58] [debug] #20 080d1ce2 in ?? () from ./samp03svr
[14:37:58] [debug] #21 080aef6c in ?? () from ./samp03svr
[14:37:58] [debug] #22 080aa13a in ?? () from ./samp03svr
[14:37:58] [debug] #23 f73fda63 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[14:37:58] [debug] Registers:
[14:37:58] [debug] EAX: 00000000 EBX: 000048d1 ECX: 000048d1 EDX: 00000006
[14:37:58] [debug] ESI: f76a8dc2 EDI: f758d000 EBP: ffbcec48 ESP: ffbceac4
[14:37:58] [debug] EIP: f771ad70 EFLAGS: 00000296
[14:37:58] [debug] Stack:
[14:37:58] [debug] ESP+00000000: ffbcec48 00000006 000048d1 f7412367
[14:37:58] [debug] ESP+00000020: ffbceaf4 00000000 f73e3220 00000005
[14:37:58] [debug] ESP+00000040: 00000000 00000000 00000000 00000000
[14:37:58] [debug] ESP+00000060: 00000000 00000000 00000000 00000000
[14:37:58] [debug] ESP+00000080: 00000000 00000000 00000000 00000000
[14:37:58] [debug] ESP+000000a0: 00000000 00000000 00000000 00000000
[14:37:58] [debug] ESP+000000c0: f773e000 f76e6000 00000005 ffbcebf0
[14:37:58] [debug] ESP+000000e0: 00000005 00000000 f7453c55 f758d960
[14:37:58] [debug] ESP+00000100: f75f9af8 f758d960 f744e8bc f758d960
[14:37:58] [debug] ESP+00000120: f76de000 f76a8dc2 081a18ec ffbcec48
[14:37:58] [debug] ESP+00000140: f76de000 081a18ec f7640a25 00000001
[14:37:58] [debug] ESP+00000160: f772ee99 ffbcec44 00000000 f76088b8
[14:37:58] [debug] ESP+00000180: 474e5543 f220b078 f763e733 f220b078
[14:37:58] [debug] ESP+000001a0: f77316e0 f763e775 f763e7a4 f220b098
[14:37:58] [debug] ESP+000001c0: f763ce56 f763ea79 f6040658 10a42a08
[14:37:58] [debug] ESP+000001e0: 00000000 f6040658 f5f233ff 00000203
[14:37:58] [debug] ESP+00000200: f6040658 097dff84 f6040658 00000001
[14:37:58] [debug] ESP+00000220: ffbced2d ffbced78 f5f226a8 09b98680
[14:37:58] [debug] ESP+00000240: 00780101 ffbced38 00000203 00000000
[14:37:58] [debug] ESP+00000260: 00000006 00004c1a 02030021 ffbced38
[14:37:58] [debug] ESP+00000280: 00003e3e ffbced50 00000008 65786946
[14:37:58] [debug] ESP+000002a0: 0c6a6404 f5f2254e f739b3c0 f5f22540
[14:37:58] [debug] ESP+000002c0: ffbcedc4 ffbcedf4 0c6a63e4 00000000
[14:37:58] [debug] ESP+000002e0: ffffffff 00000000 00000001 00000000
[14:37:58] [debug] ESP+00000300: 0000002c 00000006 00000203 00000000
[14:37:58] [debug] ESP+00000320: 00000001 ffffffff 00000000 00000001
[14:37:58] [debug] ESP+00000340: 00001807 ffbcef48 f736def7 00000006
[14:37:58] [debug] ESP+00000360: 0c6a6404 00000001 00000001 ffffffff
[14:37:58] [debug] ESP+00000380: f763ce56 f76de000 f76a3ec8 0decddb8
[14:37:58] [debug] ESP+000003a0: f738b562 f7382d9d 0cb7e400 0decddb8
[14:37:58] [debug] ESP+000003c0: 00000210 01000051 097db1c8 017deac0
[14:37:58] [debug] ESP+000003e0: 00000002 00000203 00000001 142c12c0
[14:37:58] [debug] Loaded modules:
[14:37:58] [debug] 00000000 - 00187dc3 samp03svr
[14:37:58] [debug] f771a000 - f771ae96 linux-gate.so.1
[14:37:58] [debug] f7703000 - f770581b /lib/i386-linux-gnu/i686/cmov/libdl.so.2
[14:37:58] [debug] f76e7000 - f7701d2b /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
[14:37:58] [debug] f75f4000 - f76edcda /usr/lib/i386-linux-gnu/libstdc++.so.6
[14:37:58] [debug] f75ae000 - f75f2b43 /lib/i386-linux-gnu/i686/cmov/libm.so.6
[14:37:58] [debug] f7591000 - f75ad3c4 /lib/i386-linux-gnu/libgcc_s.so.1
[14:37:58] [debug] f73e4000 - f759922f /lib/i386-linux-gnu/i686/cmov/libc.so.6
[14:37:58] [debug] f771d000 - f773dd6c /lib/ld-linux.so.2
[14:37:58] [debug] f739d000 - f73dfac4 plugins/crashdetect.so
[14:37:58] [debug] f72df000 - f739d39a plugins/streamer.so
[14:37:58] [debug] f770e000 - f771509f /lib/i386-linux-gnu/i686/cmov/librt.so.1
[14:37:58] [debug] f72cf000 - f72de1d4 plugins/sscanf.so
[14:37:58] [debug] f6f2c000 - f72d4257 plugins/mysql_static.so
[14:37:58] [debug] f650f000 - f651a3ef /lib/i386-linux-gnu/i686/cmov/libnss_files.so.2
[14:37:58] [debug] f611c000 - f6204435 plugins/pawncmd.so
[14:37:58] [debug] f60b7000 - f611be6e plugins/regex.so
[14:37:58] [debug] f6093000 - f60b604f plugins/SKY.so
[14:37:58] [debug] f5e5c000 - f6099854 plugins/YSF.so
[14:37:58] [debug] f6522000 - f652a7c4 plugins/Whirlpool.so
[14:37:58] [debug] f770a000 - f770bf70 plugins/nativechecker.so
[14:37:58] [debug] f6508000 - f650c97b /lib/i386-linux-gnu/i686/cmov/libnss_dns.so.2
[14:37:58] [debug] f19d7000 - f19ef2fb /lib/i386-linux-gnu/i686/cmov/libresolv.so.2
However, After thinking for a while, I found out that the last part I've edited in the script is this..

PHP Code:
AFKCheck(playerid)
{
    new
        
Float:x,
        
Float:y,
        
Float:z,
        
Float:cx,
        
Float:cy,
        
Float:cz;
    new 
oldtime gettime();
    
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] = gettime() - oldtime;

        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(playerid, 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(playerid, 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 {
                
//SendClientMessageEx(playerid, 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;

I'm trying to make that if the player is in the same place we add to his AFK enum every second a "1", IDK what's happening tho..
__________________

forum.nc-rp.cf
JasonRiggs is offline   Reply With Quote
Old 16/05/2018, 07:31 PM   #13
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 604
Reputation: 18
Default Re: Weather Flickering

Any help?
__________________

forum.nc-rp.cf
JasonRiggs is offline   Reply With Quote
Old 17/05/2018, 11:22 AM   #14
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 604
Reputation: 18
Default Re: Weather Flickering

Do I really have to bump the thread so someone will answer??
__________________

forum.nc-rp.cf
JasonRiggs is offline   Reply With Quote
Old 17/05/2018, 12:05 PM   #15
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,472
Reputation: 291
Default Re: Weather Flickering

Quote:
Originally Posted by RogueDrifter View Post
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.
..............
__________________
Code:
I'm available to script stuff for cash PM me here or on discord @ Andy[RDZ]#0040
[Tutorial]:Anti-cheat guide ||Mini-game 101||VC/LC maps install||
Array index out of bounds


[Github]:Link [Pastebin]:Link [Forum]:Link [Server]:Link [Discord]:Link




RogueDrifter is offline   Reply With Quote
Old 17/05/2018, 12:23 PM   #16
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 604
Reputation: 18
Default Re: Weather Flickering

Quote:
Originally Posted by RogueDrifter View Post
..............
Whatever, The problem didn't continue, I now want to know what are the problems in here??

PHP Code:
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 Code:
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;


__________________

forum.nc-rp.cf

Last edited by JasonRiggs; 17/05/2018 at 12:53 PM.
JasonRiggs is offline   Reply With Quote
Old 17/05/2018, 06:15 PM   #17
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 604
Reputation: 18
Default Re: Weather Flickering

Anyone?
__________________

forum.nc-rp.cf
JasonRiggs is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] MWeather - Improved and unique weather functions - Including weather zones and Real World Weather - alpha/test/preview Mauzen Includes 83 19/03/2017 01:15 PM
[FilterScript] Automatic random weather with weather news by De4dpOol. De4dpOol Filterscripts 8 19/04/2015 11:35 AM
Toys flickering Mr.Cruze Client Support 1 22/12/2014 05:52 AM
Flickering when I tab SKAzini Client Support 1 24/02/2014 11:26 PM
AttachCameraToObject flickering milanosie Scripting Help 10 27/05/2012 12:18 PM


All times are GMT. The time now is 12:40 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.