SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 15/05/2018, 08:23 PM   #1
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 602
Reputation: 18
Default Weather Flickering

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.
__________________

forum.nc-rp.cf
JasonRiggs is offline   Reply With Quote
Old 16/05/2018, 04:52 AM   #2
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 JasonRiggs View Post
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?
__________________
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 16/05/2018, 08:40 AM   #3
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 602
Reputation: 18
Default Re: Weather Flickering

Quote:
Originally Posted by RogueDrifter View Post
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.
__________________

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

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?
__________________
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 16/05/2018, 09:36 AM   #5
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 602
Reputation: 18
Default Re: Weather Flickering

Quote:
Originally Posted by RogueDrifter View Post
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.
__________________

forum.nc-rp.cf
JasonRiggs is offline   Reply With Quote
Old 16/05/2018, 09:53 AM   #6
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 602
Reputation: 18
Default Re: Weather Flickering

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 Code:
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.
__________________

forum.nc-rp.cf
JasonRiggs is offline   Reply With Quote
Old 16/05/2018, 10:13 AM   #7
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 JasonRiggs View Post
Great, got some shit on the logs.



PHP Code:
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.
__________________
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 16/05/2018, 11:39 AM   #8
CodeStyle175
Huge Clucker
 
CodeStyle175's Avatar
 
Join Date: Apr 2014
Posts: 304
Reputation: 18
Default Re: Weather Flickering

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 Code:
PlayerInfo[playerid][pGodmode]=gettime()+30*60//added 30-seconds for example 
check for that in command or anywhere else
PHP Code:
if(PlayerInfo[playerid][pGodmode]<gettime()){


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

Quote:
Originally Posted by CodeStyle175 View Post
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 Code:
PlayerInfo[playerid][pGodmode]=gettime()+30*60//added 30-seconds for example 
check for that in command or anywhere else
PHP Code:
if(PlayerInfo[playerid][pGodmode]<gettime()){


So do you think that only this part is causing the bug in the log? or is there anything else?
__________________

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

However, This is the full code of the function, I'm trying to find a bug but my mind is off, any help?

PHP Code:
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]--;
            }
            if(
PlayerInfo[i][pPreviewHouse] >= 0)
            {
                
PlayerInfo[i][pPreviewTime]--;

                if(
PlayerInfo[i][pPreviewTime] <= && GetPlayerInterior(i) == houseInteriors[PlayerInfo[i][pPreviewType]][intID])
                {
                    
SetPlayerPos(iHouseInfo[PlayerInfo[i][pPreviewHouse]][hIntX], HouseInfo[PlayerInfo[i][pPreviewHouse]][hIntY], HouseInfo[PlayerInfo[i][pPreviewHouse]][hIntZ]);
                    
SetPlayerFacingAngle(iHouseInfo[PlayerInfo[i][pPreviewHouse]][hIntA]);
                    
SetPlayerInterior(iHouseInfo[PlayerInfo[i][pPreviewHouse]][hInterior]);
                    
SetPlayerVirtualWorld(iHouseInfo[PlayerInfo[i][pPreviewHouse]][hWorld]);
                    
SetCameraBehindPlayer(i);

                    
PlayerInfo[i][pPreviewHouse] = -1;
                    
PlayerInfo[i][pPreviewType] = 0;
                    
PlayerInfo[i][pPreviewTime] = 0;

                    
SendClientMessage(iCOLOR_WHITE"You are no longer previewing the interior as the time period ran out.");
                }
            }

            if(
PlayerInfo[i][pLoopAnim] && !PlayerInfo[i][pToggleTextdraws]) {
                
TextDrawShowForPlayer(iAnimationTD);
            } else {
                
TextDrawHideForPlayer(iAnimationTD);
            }

            if(
GetPlayerSurfingVehicleID(i) != INVALID_PLAYER_ID && GetPlayerState(i) == PLAYER_STATE_ONFOOT && !IsSurfVehicle(GetPlayerSurfingVehicleID(i)) && !PlayerInfo[i][pAdminDuty] && GetVehicleSpeed(GetPlayerSurfingVehicleID(i)) > 40)
            {
                new
                    
Float:x,
                    
Float:y,
                    
Float:z;

                
SendProximityMessage(i20.0COLOR_PURPLE"** %s slipped off the top of the vehicle."GetPlayerRPName(i));
                
GetPlayerPos(ixyz);
                
SetPlayerPos(i1y3.0);
                
ApplyAnimation(i"PED""BIKE_fallR"4.101100);
            }
            if(
PlayerInfo[i][pShipment] >= 0)
            {
                if((
GetPlayerState(i) == PLAYER_STATE_DRIVER) && (GetVehicleModel(GetPlayerVehicleID(i)) != 414 && GetVehicleModel(GetPlayerVehicleID(i)) != 498))
                {
                    
PlayerInfo[i][pShipment] = -1;
                    
SendClientMessage(iCOLOR_GREY"Shipment cancelled. You went into another vehicle.");
                }
            }
            if(
GetPlayerSpecialAction(i) == SPECIAL_ACTION_DRINK_BEER || GetPlayerSpecialAction(i) == SPECIAL_ACTION_DRINK_WINE)
            {
                if(
GetPlayerDrunkLevel(i) > 7000)
                {
                    
Awardh(i"Party hard");
                }
            }
            if(
GetPlayerState(i) == PLAYER_STATE_DRIVER)
            {
                if(
IsNearSpeedCam(i) && PlayerInfo[i][pSpeedTicketAllowed] == 0)
                {
                    new 
speedcamID Speed_Nearest(i);
                    if(
GetVehicleSpeed(GetPlayerVehicleID(i)) > SpeedData[speedcamID][speedLimit] )
                    {
                        
SendClientMessage(iCOLOR_AQUA"**You have been spotted by a speed camera, You have been issued a fine of 1500$");
                        
AddToTaxVault(1500);
                        
GivePlayerCash(i, -1500);
                        
PlayerInfo[i][pSpeedTicketAllowed] = 1;
                    }
                }
            }        
            if(
PlayerInfo[i][pPizzas] > && GetPlayerState(i) == PLAYER_STATE_DRIVER)
            {
                if(
GetVehicleModel(GetPlayerVehicleID(i)) == 448)
                {
                    if(
PlayerInfo[i][pPizzaTime] < 90)
                    {
                        
PlayerInfo[i][pPizzaTime]++;
                    }
                }
                else
                {
                    
PlayerInfo[i][pPizzas] = 0;
                    
PlayerInfo[i][pCP] = 0;

                    
DisablePlayerCheckpoint(i);
                    
SendClientMessage(iCOLOR_GREY"Pizza delivery cancelled. You went into another vehicle.");
                }
            }
            else if (
PlayerInfo[i][pGraffiti] != -&& PlayerInfo[i][pGraffitiTime] > 0)
            {
                if (
Graffiti_Nearest(i) != PlayerInfo[i][pGraffiti])
                {
                    
PlayerInfo[i][pGraffiti] = -1;
                    
PlayerInfo[i][pGraffitiTime] = 0;
                }
                else
                {
                    
PlayerInfo[i][pGraffitiTime]--;

                    if (
PlayerInfo[i][pGraffitiTime] < 1)
                    {
                        new 
str[500];
                        
strunpack(strPlayerInfo[i][pGraffitiText]);
                        
format(GraffitiData[PlayerInfo[i][pGraffiti]][graffitiText], 64str);

                        
GraffitiData[PlayerInfo[i][pGraffiti]][graffitiColor] = PlayerInfo[i][pGraffitiColor];

                        
Graffiti_Refresh(PlayerInfo[i][pGraffiti]);
                        
Graffiti_Save(PlayerInfo[i][pGraffiti]);

                        
ClearAnimations(i1);
                        
SendProximityMessage(i30.0COLOR_PURPLE"** %s puts their can of spray paint away."GetPlayerRPName(i));

                           
PlayerInfo[i][pGraffiti] = -1;
                           
PlayerInfo[i][pGraffitiTime] = 0;
                    }
                }
            }
            if(!
PlayerInfo[i][pToggleTextdraws])
            {
                if(
PlayerInfo[i][pGPSOn])
                {
                    
PlayerTextDrawSetString(iPlayerInfo[i][pText][0], GetPlayerZoneName(i));
                }
            }
*/
            
/*if(NetStats_PacketLossPercent(i) > 20.0 && gettime() - PlayerInfo[i][pLastDesync] > 120)
            {
                GameTextForPlayer(i, "You are desynced. Please relog once you see this message.", 10000, 6);
                PlayerInfo[i][pLastDesync] = gettime();
            }*/
/*            if(PlayerInfo[i][pSpectating] != INVALID_PLAYER_ID)
            {
                if(GetPlayerInterior(i) != GetPlayerInterior(PlayerInfo[i][pSpectating])) SetPlayerInterior(i, GetPlayerInterior(PlayerInfo[i][pSpectating]));
                if(GetPlayerVirtualWorld(i) != GetPlayerVirtualWorld(PlayerInfo[i][pSpectating])) SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(PlayerInfo[i][pSpectating]));
            }
            if(PlayerInfo[i][pTutorial])
            {
                TogglePlayerControllable(i, 0);
            }
            if(PlayerInfo[i][pAwaitingClothing])
            {
                SetPlayerClothing(i);
            }
            if(PlayerInfo[i][pDraggedBy] != INVALID_PLAYER_ID)
            {
                TeleportToPlayer(i, PlayerInfo[i][pDraggedBy]);
            }
            if(PlayerInfo[i][pVIPPackage] > 0 && gettime() > PlayerInfo[i][pVIPTime])
            {
                PlayerInfo[i][pVIPPackage] = 0;
                PlayerInfo[i][pVIPTime] = 0;
                PlayerInfo[i][pSecondJob] = -1;

                mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET vippackage = 0, viptime = 0, secondjob = -1 WHERE uid = %i", PlayerInfo[i][pID]);
                mysql_tquery(connectionID, queryBuffer);

                SendClientMessage(i, COLOR_LIGHTRED, "Your VIP subscription has expired. You are no longer a VIP.");
            }
            if(PlayerInfo[i][pVIPPackage] < 2 && PlayerInfo[i][pSecondJob] != JOB_NONE)
            {
                mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET secondjob = -1 WHERE uid = %i", PlayerInfo[i][pID]);
                mysql_tquery(connectionID, queryBuffer);

                PlayerInfo[i][pSecondJob] = JOB_NONE;
                SendClientMessage(i, COLOR_LIGHTRED, "Your second job has been removed as you aren't a Gold+ VIP.");
            }
            if(PlayerInfo[i][pHHCheck])
            {
                if(PlayerInfo[i][pHHTime] > 0)
                {
                    new health = GetPlayerHealthEx(i);

                    if(health == PlayerInfo[i][pHHRounded])
                    {
                        PlayerInfo[i][pHHCount]++;
                    }

                    SetPlayerHealth(i, random(100) + 1);

                    PlayerInfo[i][pHHTime]--;
                    PlayerInfo[i][pHHRounded] = health;
                }
                else
                {
                    if(gettime() - PlayerInfo[i][pLastUpdate] >= 3)
                    {
                        SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] failed the health hack check as they tabbed.", GetPlayerRPName(i), i);
                    }
                    else if(PlayerInfo[i][pHHCount] > 0)
                    {
                        SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly health hacking with a %i percent chance.", GetPlayerRPName(i), i, PlayerInfo[i][pHHCount] * 20);
                    }
                    else
                    {
                        SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] does not appear to be health hacking.", GetPlayerRPName(i), i);
                    }

                    if(NetStats_PacketLossPercent(i) > 10.0)
                    {
                        SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is desynced and has a packet loss of %.1f percent.", GetPlayerRPName(i), i, NetStats_PacketLossPercent(i));
                    }

                    SetPlayerHealth(i, PlayerInfo[i][pHealth]);
                    PlayerInfo[i][pHHCheck] = 0;
                }
            }
            if(PlayerInfo[i][pReceivingAid] && !PlayerInfo[i][pHHCheck])
            {
                new
                    Float:health;

                GetPlayerHealth(i, health);

                if((health + 1.0) > 100.0)
                {
                    SetPlayerHealth(i, 100.0);
                    PlayerInfo[i][pReceivingAid] = 0;
                }
                else
                {
                    SetPlayerHealth(i, health + 1.0);
                }
            }
            if(PlayerInfo[i][pInjured] && IsPlayerInAnyVehicle(i) && GetVehicleModel(GetPlayerVehicleID(i)) != 416)
            {
                new
                    Float:x,
                    Float:y,
                    Float:z;
                GetPlayerPos(i, x, y, z);
                SetPlayerPos(i, x, y, z + 0.5);
                ClearAnimations(i);
            }
            if(PlayerInfo[i][pTazedTime] > 0)
            {
                PlayerInfo[i][pTazedTime]--;

                if(!PlayerInfo[i][pTazedTime])
                {
                    ClearAnimations(i, 1);

                    if(!PlayerInfo[i][pCuffed])
                    {
                        TogglePlayerControllable(i, 1);
                    }
                }
            }
            if(PlayerInfo[i][pFishTime] > 0)
            {
                PlayerInfo[i][pFishTime]--;

                if(!IsPlayerAtFishingPlace(i))
                {
                    ClearAnimations(i, 1);
                    RemovePlayerAttachedObject(i, 9);
                    PlayerInfo[i][pFishTime] = 0;
                }
                else if(PlayerInfo[i][pFishTime] <= 0 && IsPlayerAtFishingPlace(i))
                {
                      new rand = Random(1, 100);

                    if(1 <= rand <= 20)
                    {
                            SendClientMessage(i, COLOR_GREY, "You reeled in your line and caught nothing...");
                    }
                    else if(21 <= rand <= 30)
                    {
                        new amount = 50 + random(100);

                        SendClientMessageEx(i, COLOR_AQUA, "You reeled in your line and caught a used wallet with {00AA00}$%i{33CCFF} inside.", amount);
                        GivePlayerCash(i, amount);
                    }
                    else if(98 <= rand <= 99)
                    {
                        new amount = random(2000) + 1000;

                        SendClientMessageEx(i, COLOR_AQUA, "You reeled in your line and caught a rare 18th century coin valued at {00AA00}$%i{33CCFF}!", amount);
                        GivePlayerCash(i, amount);
                    }
                    else
                    {
                        new weight, level = GetJobLevel(i, JOB_FISHERMAN);

                        if(PlayerInfo[i][pUsedBait]) {
                            weight = random(40) + (level * 10);
                        } else {
                            weight = random(15) + (level * 10);
                        }

                        SendClientMessageEx(i, COLOR_AQUA, "You reeled in your line and caught a fish weighing %i kg!", weight);
                        PlayerInfo[i][pFishWeight] += weight;

                        mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fishweight = %i WHERE uid = %i", PlayerInfo[i][pFishWeight], PlayerInfo[i][pID]);
                        mysql_tquery(connectionID, queryBuffer);

                        IncreaseJobSkill(i, JOB_FISHERMAN);

                        if(PlayerInfo[i][pFishWeight] >= 1500)
                        {
                            SendClientMessage(i, COLOR_YELLOW, "You have too much fish. You can continue fishing once you sell your load.");
                        }
                    }

                    ClearAnimations(i, 1);
                    RemovePlayerAttachedObject(i, 9);
                }
            }
            if(PlayerInfo[i][pJailType] > 0)
            {
                PlayerInfo[i][pJailTime]--;

                if(PlayerInfo[i][pJailTime] <= 0)
                {
                    ResetPlayerWeaponsEx(i);

                    SendClientMessage(i, COLOR_GREY2, "Your jail sentence has expired.");
                    SetPlayerPos(i, 1544.4407, -1675.5522, 13.5584);
                    SetPlayerFacingAngle(i, 90.0000);
                    SetPlayerInterior(i, 0);
                    SetPlayerVirtualWorld(i, 0);
                    SetCameraBehindPlayer(i);

                    PlayerInfo[i][pJailType] = 0;
                    PlayerInfo[i][pJailTime] = 0;
                }
            }
            if(PlayerInfo[i][pEditType] > 0 && IsValidDynamicObject(PlayerInfo[i][pEditObject]) && !IsPlayerInRangeOfDynamicObject(i, PlayerInfo[i][pEditObject], 50.0))
            {
                if(PlayerInfo[i][pEditType] == EDIT_FURNITURE_PREVIEW)
                {
                       SendClientMessage(i, COLOR_GREY2, "You left the editing area. Furniture previewing cancelled.");
                       DestroyDynamicObject(PlayerInfo[i][pEditObject]);
                }
                else if(PlayerInfo[i][pEditType] == EDIT_FURNITURE)
                {
                       ReloadFurniture(PlayerInfo[i][pEditObject], HouseInfo[PlayerInfo[i][pFurnitureHouse]][hLabels]);
                       SendClientMessage(i, COLOR_GREY2, "You left the editing area. Editing mode has been disabled.");
                }
                else if(PlayerInfo[i][pEditType] == EDIT_LAND_OBJECT)
                {
                       ReloadLandObject(PlayerInfo[i][pEditObject], LandInfo[PlayerInfo[i][pObjectLand]][lLabels]);
                       SendClientMessage(i, COLOR_GREY2, "You left the editing area. Editing mode has been disabled.");
                }
                else if(PlayerInfo[i][pEditType] == EDIT_LAND_OBJECT_PREVIEW)
                {
                       SendClientMessage(i, COLOR_GREY2, "You left the editing area. Furniture previewing cancelled.");
                       DestroyDynamicObject(PlayerInfo[i][pEditObject]);
                }

                CancelEdit(i);

                PlayerInfo[i][pEditType] = 0;
                   PlayerInfo[i][pEditObject] = INVALID_OBJECT_ID;
            }
            if(PlayerInfo[i][pHospital] && PlayerInfo[i][pHospitalTime])
            {
                PlayerInfo[i][pHospitalTime]--;

                if(PlayerInfo[i][pHospitalTime] == 0)
                {
                    if(PlayerInfo[i][pInsurance] > 0)
                    {
                        Awardh(i, "Obamacare");
                    }

                    SetPlayerPos(i, -10.4534, 149.3639, 999.0613);
                    SetPlayerFacingAngle(i, 180.0000);
                    SetPlayerInterior(i, 1);
                    SetPlayerVirtualWorld(i, PlayerInfo[i][pHospitalType]);
                    SetCameraBehindPlayer(i);

                    if(!(GetFactionType(i) == FACTION_POLICE || GetFactionType(i) == FACTION_MEDIC))
                    {
                        GivePlayerCash(i, -500);
                        GameTextForPlayer(i, "~w~Discharged~n~~r~-$500", 5000, 1);
                    }

                    TogglePlayerControllable(i, 1);
                    SetPlayerDrunkLevel(i, 0);

                    if(PlayerInfo[i][pDelivered])
                    {
                        if(GetFactionType(i) == FACTION_POLICE || GetFactionType(i) == FACTION_MEDIC)
                            SendClientMessage(i, COLOR_DOCTOR, "You have not been billed for your stay. You also keep all of your weapons!");
                        else
                            SendClientMessage(i, COLOR_DOCTOR, "You have been billed $500 for your stay. You also keep all of your weapons!");

                        PlayerInfo[i][pDelivered] = 0;
                    }
                    else
                    {
                        if(GetFactionType(i) == FACTION_POLICE || GetFactionType(i) == FACTION_MEDIC)
                            SendClientMessage(i, COLOR_DOCTOR, "You have not been billed for your stay. Your weapons have been confiscated by staff.");
                        else
                            SendClientMessage(i, COLOR_DOCTOR, "You have been billed $500 for your stay. Your weapons have been confiscated by staff.");

                        SendClientMessage(i, COLOR_LIGHTRED, "(( You have lost 30 minutes of your memory. ))");
                    }
                    new hospital[32];
                    switch(PlayerInfo[i][pHospitalType])
                    {
                        case HOSPITAL_COUNTY: strcat(hospital, "All Saints General");
                        case HOSPITAL_ALLSAINTS: strcat(hospital, "County General");
                        case HOSPITAL_FMDHQ: strcat(hospital, "FMD HQ");
                    }
                    foreach(new x : Player)
                    {
                        if(IsLawEnforcement(x))
                        {
                            SendClientMessageEx(x, COLOR_YELLOW, "LSFMD: Wanted suspect %s[%i] was last spotted at the %s hospital!", GetPlayerRPName(i), i, hospital);
                        }
                    }
                    SetPlayerHealth(i, PlayerInfo[i][pSpawnHealth]);
                    SetScriptArmour(i, PlayerInfo[i][pSpawnArmor]);

                    PlayerInfo[i][pHospital] = 0;
                    PlayerInfo[i][pHospitalTime] = 0;
                }
                else
                {
                    GameTextForPlayer(i, "~w~Recovering...", 1500, 3);
                    SetPlayerDrunkLevel(i, 50000);
                }
            }
            if(PlayerInfo[i][pRefuel] != INVALID_VEHICLE_ID)
            {
                PlayerInfo[i][pRefuelAmount] += 2;
                vehicleFuel[PlayerInfo[i][pRefuel]]++;

                if(vehicleFuel[PlayerInfo[i][pRefuel]] >= 100 || PlayerInfo[i][pCash] < PlayerInfo[i][pRefuelAmount])
                {
                    AddPointMoney(POINT_FUEL, PlayerInfo[i][pRefuelAmount]);
                    GivePlayerCash(i, -PlayerInfo[i][pRefuelAmount]);
                    SendClientMessageEx(i, COLOR_AQUA, "You've refilled your vehicle's gas tank for {FF6347}$%i{33CCFF}.", PlayerInfo[i][pRefuelAmount]);

                    PlayerInfo[i][pRefuel] = INVALID_VEHICLE_ID;
                    PlayerInfo[i][pRefuelAmount] = 0;
                }
            }
            if(PlayerInfo[i][pMiningTime] > 0)
            {
                PlayerInfo[i][pMiningTime]--;

                if(PlayerInfo[i][pMiningTime] <= 0)
                {
                    if(IsPlayerInMiningArea(i) && GetPlayerState(i) == PLAYER_STATE_ONFOOT && !PlayerInfo[i][pTazedTime] && !PlayerInfo[i][pCuffed])
                    {
                        new number = random(10) + 1;

                        PlayerInfo[i][pCP] = CHECKPOINT_MINING;

                        SetPlayerAttachedObject(i, 9, 3929, 1, 0.242999, 0.324000, 0.012000, -17.200078, 20.699993, 9.800034, 0.579999, 0.617999, 0.676999);
                        SetPlayerSpecialAction(i, SPECIAL_ACTION_CARRY);

                        ApplyAnimation(i, "CARRY", "liftup", 4.1, 0, 0, 0, 0, 0, 1);
                        SetPlayerCheckpoint(i, 1278.0778, -1267.9661, 12.5413, 2.0);

                        if(1 <= number <= 5)
                        {
                            PlayerInfo[i][pMiningRock] = 1;
                            SendClientMessage(i, COLOR_AQUA, "You have dug up an ordinary stone. Drop it off at the marker.");
                        }
                        else if(number == 6 && !PlayerInfo[i][pRareTime])
                        {
                            SendClientMessage(i, COLOR_AQUA, "Woah, this looks oddly weird to find in the middle of a city, lets show it to the boss.");
                            PlayerInfo[i][pMiningRock] = 3;
                        }
                        else
                        {
                            PlayerInfo[i][pMiningRock] = 2;
                            SendClientMessage(i, COLOR_AQUA, "You have dug up a quality stone. Drop it off at the marker.");
                        }
                    }
                    else
                    {
                        RemovePlayerAttachedObject(i, 9);
                        ClearAnimations(i, 1);
                    }
                }
            }
            if(PlayerInfo[i][pSweeping] && GetVehicleModel(GetPlayerVehicleID(i)) == 574 && GetVehicleSpeed(GetPlayerVehicleID(i)) > 35.0 && !PlayerInfo[i][pAFK])
            {
                PlayerInfo[i][pSweepTime]--;

                if(PlayerInfo[i][pSweepTime] <= 0)
                {
                    new cost = 200 + random(50);

                    if(PlayerInfo[i][pLaborUpgrade] > 0)
                    {
                        cost += percent(cost, PlayerInfo[i][pLaborUpgrade]);
                    }

                    AddToPaycheck(i, cost);

                    format(string, sizeof(string), "~g~+$%i", cost);
                    GameTextForPlayer(i, string, 5000, 1);

                    PlayerInfo[i][pSweepEarnings] += cost;
                    PlayerInfo[i][pSweepTime] = 30;
                }
            }
            if(PlayerInfo[i][pTaxiPassenger] != INVALID_PLAYER_ID)
            {
                if((GetVehicleModel(GetPlayerVehicleID(i)) != 420 && GetVehicleModel(GetPlayerVehicleID(i)) != 438) || !IsPlayerInVehicle(PlayerInfo[i][pTaxiPassenger], GetPlayerVehicleID(i)) || PlayerInfo[i][pTaxiFare] == 0 || PlayerInfo[PlayerInfo[i][pTaxiPassenger]][pCash] < PlayerInfo[i][pTaxiBill])
                {
                    CancelTaxiRide(i);
                }
                else
                {
                    PlayerInfo[i][pTaxiTime]++;

                    if(PlayerInfo[i][pTaxiTime] >= 15)
                    {
                        PlayerInfo[i][pTaxiTime] = 0;
                        PlayerInfo[i][pTaxiBill] += PlayerInfo[i][pTaxiFare];
                    }

                    format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~g~Taxi Meter:~w~ $%i", PlayerInfo[i][pTaxiBill]);
                    GameTextForPlayer(i, string, 3000, 3);
                }
            }
            if(PlayerInfo[i][pMuted] > 0)
            {
                PlayerInfo[i][pMuted]--;

                if(PlayerInfo[i][pMuted] <= 0)
                {
                    SendClientMessage(i, COLOR_GREY, "You are no longer muted.");
                }
            }
            if(PlayerInfo[i][pCocaineTrunk] != INVALID_VEHICLE_ID)
            {
                if(!IsPlayerInRangeOfBoot(i, PlayerInfo[i][pCocaineTrunk]))
                {
                    SendClientMessage(i, COLOR_GREY, "You are no longer cracking the trunk as you left your spot.");
                    PlayerInfo[i][pCocaineTrunk] = INVALID_VEHICLE_ID;
                }
                else if(VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vLocked])
                {
                    SendClientMessage(i, COLOR_GREY, "You are no longer cracking the trunk as the vehicle is now locked.");
                    PlayerInfo[i][pCocaineTrunk] = INVALID_VEHICLE_ID;
                }
                else
                {
                    PlayerInfo[i][pCocaineTime]--;

                    if(PlayerInfo[i][pCocaineTime] <= 0)
                    {
                        new count;

                        for(new x = 0; x < 5; x ++)
                        {
                            if(VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vWeapons][x] != 0)
                            {
                                count++;
                            }
                        }

                        if(count == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vCocaine] == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vMeth] == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vWeed] == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vPainkillers] == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vMaterials] == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vCash] == 0)
                        {
                            SendProximityMessage(i, 20.0, COLOR_PURPLE, "** %s cracks open the trunk of the %s and finds nothing.", GetPlayerRPName(i), GetVehicleName(PlayerInfo[i][pCocaineTrunk]));
                        }
                        else
                        {
                            PlayerInfo[i][pCocaineFrom] = PlayerInfo[i][pCocaineTrunk];
                            ShowDialogToPlayer(i, DIALOG_CRACKTRUNK);
                        }

                        switch(GetJobLevel(i, JOB_THIEF))
                        {
                            case 1: PlayerInfo[i][pCocaineCooldown] = 720;
                            case 2: PlayerInfo[i][pCocaineCooldown] = 600;
                            case 3: PlayerInfo[i][pCocaineCooldown] = 420;
                            case 4: PlayerInfo[i][pCocaineCooldown] = 300;
                            case 5: PlayerInfo[i][pCocaineCooldown] = 180;
                        }

                        IncreaseJobSkill(i, JOB_THIEF);
                        PlayerInfo[i][pCocaineTrunk] = INVALID_VEHICLE_ID;
                    }
                    else
                    {
                        format(string, sizeof(string), "~w~Cracking trunk... ~r~%i", PlayerInfo[i][pCocaineTime]);
                        GameTextForPlayer(i, string, 2000, 3);
                    }
                }
            }
            if(PlayerInfo[i][pLootTime] > 0)
            {
                PlayerInfo[i][pLootTime]--;

                if(IsPlayerInBankRobbery(i) && PlayerInfo[i][pLootTime] <= 0)
                {
                    new amount = random(500) + 500;

                    ClearAnimations(i, 1);

                    PlayerInfo[i][pRobCash] += amount;
                    PlayerInfo[i][pCP] = CHECKPOINT_ROBBERY;
                    PlayerInfo[i][pLastLoad] = gettime();

                    format(string, sizeof(string), "~g~+$%i", amount);
                    GameTextForPlayer(i, string, 5000, 1);

                    SendClientMessageEx(i, COLOR_AQUA, "You have looted {00AA00}$%i{33CCFF} and now have $%i. You can keep looting or deliver the cash to the {FF6347}marker{33CCFF}.", amount, PlayerInfo[i][pRobCash]);
                    SetPlayerCheckpoint(i, 1429.9939, 1066.9581, 9.8938, 3.0);
                }
                else if((PlayerInfo[i][pRobbingBiz] >= 0 && PlayerInfo[i][pRobbingBiz] == GetInsideBusiness(i)) && PlayerInfo[i][pLootTime] <= 0)
                {
                    new amount = random(300) + 100;

                    ClearAnimations(i, 1);

                    PlayerInfo[i][pRobCash] += amount;
                    PlayerInfo[i][pCP] = CHECKPOINT_ROBBERY;
                    PlayerInfo[i][pLastLoad] = gettime();

                    format(string, sizeof(string), "~g~+$%i", amount);
                    GameTextForPlayer(i, string, 5000, 1);

                    SendClientMessageEx(i, COLOR_AQUA, "You have looted {00AA00}$%i{33CCFF} and now have $%i. You can keep looting or deliver the cash to the {FF6347}marker{33CCFF} (/stoprobbery).", amount, PlayerInfo[i][pRobCash]);
                    SetPlayerCheckpoint(i, 1429.9939, 1066.9581, 9.8938, 3.0);
                    if(PlayerInfo[i][pRobCash] < 10000)
                    {
                        ApplyAnimation(i, "BOMBER", "BOM_Plant_Loop", 4.1, 1, 0, 0, 0, 0, 1);
                        GameTextForPlayer(i, "~w~Looting business vault...", 5000, 3);
                        PlayerInfo[i][pLootTime] = 5;
                    }
                    else
                    {
                        callcmd::stoprobbery(i, "/1");
                    }
                }
            }
            if(PlayerInfo[i][pHunted] > 0)
            {
                foreach(new x : Player)
                {
                    if(PlayerInfo[x][pLogged] && GetPlayerInterior(x) == GetPlayerInterior(i) && PlayerInfo[i][pHunted] > 0)
                    {
                        SetPlayerMarkerForPlayer(x, i, COLOR_RETIRED);
                    }
                }
            }
            if(PlayerInfo[i][pFindTime] > 0)
            {
                PlayerInfo[i][pFindTime]--;

                if(PlayerInfo[i][pFindTime] == 0)
                {
                    SetPlayerMarkerForPlayer(i, PlayerInfo[i][pFindPlayer], GetPlayerColor(PlayerInfo[i][pFindPlayer]));
                    PlayerInfo[i][pFindPlayer] = INVALID_PLAYER_ID;
                }
            }
            if((PlayerInfo[i][pToggleMusic]) || (PlayerInfo[i][pBoomboxListen] != INVALID_PLAYER_ID && GetNearbyBoombox(i) != PlayerInfo[i][pBoomboxListen]))
            {
                PlayerInfo[i][pBoomboxListen] = INVALID_PLAYER_ID;

                if(PlayerInfo[i][pStreamType] == MUSIC_BOOMBOX)
                {
                    StopAudioStreamForPlayer(i);
                    PlayerInfo[i][pStreamType] = MUSIC_NONE;
                }
            }
            if((!PlayerInfo[i][pToggleMusic]) && ((boomboxid = GetNearbyBoombox(i)) != INVALID_PLAYER_ID && PlayerInfo[i][pBoomboxListen] != boomboxid))
            {
                PlayerInfo[i][pBoomboxListen] = boomboxid;

                if(PlayerInfo[i][pStreamType] == MUSIC_NONE)
                {
                    PlayAudioStreamForPlayer(i, PlayerInfo[boomboxid][pBoomboxURL]);
                    PlayerInfo[i][pStreamType] = MUSIC_BOOMBOX;
                }
            }
            if(PlayerInfo[i][pPickPlant] != INVALID_PLAYER_ID)
            {
                PlayerInfo[i][pPickTime]--;

                if(PlayerInfo[i][pPickTime] <= 0)
                {
                    new planterid = PlayerInfo[i][pPickPlant];

                    if(!IsPlayerConnected(planterid) || !PlayerInfo[planterid][pLogged] || !PlayerInfo[planterid][pWeedPlanted])
                    {
                        SendClientMessage(i, COLOR_GREY, "This plant is no longer available to pick.");
                    }
                    else if(!IsPlayerInRangeOfPoint(i, 3.0, PlayerInfo[planterid][pWeedX], PlayerInfo[planterid][pWeedY], PlayerInfo[planterid][pWeedZ]))
                    {
                        SendClientMessage(i, COLOR_GREY, "Picking failed. You left the area of the plant.");
                    }
                    else if(GetPlayerSpecialAction(i) != SPECIAL_ACTION_DUCK)
                    {
                        SendClientMessage(i, COLOR_GREY, "Picking failed. You must stay crouched when picking a plant.");
                    }
                    else
                    {
                        PlayerInfo[i][pWeed] += PlayerInfo[planterid][pWeedGrams];

                        mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[i][pWeed], PlayerInfo[i][pID]);
                        mysql_tquery(connectionID, queryBuffer);

                        SendClientMessageEx(i, COLOR_AQUA, "You have harvested %i grams of weed from this plant.", PlayerInfo[planterid][pWeedGrams]);
                        DestroyWeedPlant(planterid);
                    }

                    PlayerInfo[i][pPickPlant] = INVALID_PLAYER_ID;
                    PlayerInfo[i][pPickTime] = 0;
                }
            }
            if(PlayerInfo[i][pCookMeth] > 0)
            {
                PlayerInfo[i][pCookTime]--;

                if(PlayerInfo[i][pCookTime] <= 0)
                {
                    if(!IsPlayerInRangeOfPoint(i, 5.0, 1.2179, 2.8095, 999.4284))
                    {
                        SendClientMessage(i, COLOR_GREY, "Cooking failed. You have left the cooking spot.");
                        ResetCooking(i);
                    }
                    else if(PlayerInfo[i][pEphedrine] <= 0)
                    {
                        SendClientMessage(i, COLOR_GREY, "Cooking failed. You have ran out of ephedrine.");
                        ResetCooking(i);
                    }
                    else if(PlayerInfo[i][pMeth] + 2 > GetPlayerCapacity(i, CAPACITY_METH))
                    {
                        SendClientMessage(i, COLOR_GREY, "Cooking failed. You have ran out of inventory space for meth.");
                        ResetCooking(i);
                    }
                    else
                    {
                        GameTextForPlayer(i, "~g~+2~w~ grams of meth", 3000, 3);

                        PlayerInfo[i][pEphedrine] -= 1;
                        PlayerInfo[i][pMeth] += 2;
                        PlayerInfo[i][pCookGrams] += 2;

                        if((PlayerInfo[i][pCookGrams] % 4) == 0)
                        {
                            PlayerInfo[i][pMuriaticAcid]--;
                        }

                        mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET ephedrine = %i, meth = %i, muriaticacid = %i WHERE uid = %i", PlayerInfo[i][pEphedrine], PlayerInfo[i][pMeth], PlayerInfo[i][pMuriaticAcid], PlayerInfo[i][pID]);
                        mysql_tquery(connectionID, queryBuffer);

                        if(!PlayerInfo[i][pEphedrine])
                        {
                            SendClientMessageEx(i, COLOR_LIGHTRED, "You ran out of ephedrine therefore ending your cookoff. You made %i grams of meth from %i grams of ephedrine.", PlayerInfo[i][pCookGrams], PlayerInfo[i][pCookGrams] / 2);
                            ResetCooking(i);
                        }
                        else if(!PlayerInfo[i][pMuriaticAcid])
                        {
                            SendClientMessageEx(i, COLOR_LIGHTRED, "You ran out of muriatic acid therefore ending your cookoff. You made %i grams of meth from %i grams of ephedrine.", PlayerInfo[i][pCookGrams], PlayerInfo[i][pCookGrams] / 2);
                            ResetCooking(i);
                        }
                        else if(PlayerInfo[i][pMeth] >= GetPlayerCapacity(i, CAPACITY_METH))
                        {
                            SendClientMessageEx(i, COLOR_LIGHTRED, "You ran out of inventory space for meth therefore ending your cookoff. You made %i grams of meth from %i grams of ephedrine.", PlayerInfo[i][pCookGrams], PlayerInfo[i][pCookGrams] / 2);
                            ResetCooking(i);
                        }
                        else
                        {
                            PlayerInfo[i][pCookTime] = 15;
                        }
                    }
                }
            }
            if(PlayerInfo[i][pDrugsUsed] >= 4)
            {
                PlayerInfo[i][pDrugsTime]--;

                if(PlayerInfo[i][pDrugsTime] <= 0)
                {
                    SendClientMessage(i, COLOR_GREY, "You are no longer stoned.");
                    SetPlayerWeather(i, gWeather);

                    SetPlayerTime(i, gWorldTime, 0);
                    SetPlayerDrunkLevel(i, 500);

                    PlayerInfo[i][pDrugsUsed] = 0;
                    PlayerInfo[i][pDrugsTime] = 0;
                }
                else
                {
                    SetPlayerWeather(i, -66);
                    SetPlayerTime(i, 12, 0);
                    SetPlayerDrunkLevel(i, 40000);
                }
            }
            if(PlayerInfo[i][pCapturingPoint] >= 0)
            {
                PlayerInfo[i][pCaptureTime]--;

                if(PlayerInfo[i][pCaptureTime] <= 0)
                {
                    new Float:x, Float:y, Float:z;

                    GetPlayerPos(i, x, y, z);

                    if(PointInfo[PlayerInfo[i][pCapturingPoint]][pTime] == 0 && PlayerInfo[i][pPointX] == x && PlayerInfo[i][pPointY] == y && PlayerInfo[i][pPointZ] == z)
                    {
                        SendClientMessageToAllEx(COLOR_YELLOW, "Point wars: %s attempted to capture %s for %s. It will be theirs in 15 minutes.", GetPlayerRPName(i), PointInfo[PlayerInfo[i][pCapturingPoint]][pName], GangInfo[PlayerInfo[i][pGang]][gName]);

                        PointInfo[PlayerInfo[i][pCapturingPoint]][pCaptureTime] = 15;
                        PointInfo[PlayerInfo[i][pCapturingPoint]][pCapturer] = i;
                    }
                    else
                    {
                        SendClientMessage(i, COLOR_GREY, "You moved from your position and therefore failed to capture.");
                    }

                    PlayerInfo[i][pCapturingPoint] = -1;
                    PlayerInfo[i][pCaptureTime] = 0;
                }

            }
            if(PlayerInfo[i][pPoisonTime] > 0)
            {
                new
                    Float:health;
                GetPlayerHealth(i, health);
                SetPlayerHealth(i, health - 3.0 < 1.0 ? 1.0 : health - 3.0);
                PlayerInfo[i][pPoisonTime]--;
            }

            AnticheatCheck(i);

            //GetPlayerHealth(i, PlayerInfo[i][pHealth]);

            if(PlayerInfo[i][pGang] >= 0 && !PlayerInfo[i][pBandana])
            {
                new id;

                if((id = GetNearbyTurf(i)) >= 0 && TurfInfo[id][tTime] == 0 && TurfInfo[id][tCapturer] != INVALID_PLAYER_ID)
                {
                    if(PlayerInfo[i][pTagType] == TAG_VIP)
                    {
                        SetPlayerSpecialTag(i, TAG_NONE);
                        SendClientMessage(i, COLOR_YELLOW, "Your VIP tag was automatically disabled as you've entered an active turf area.");
                    }
                    PlayerInfo[i][pBandana] = 1;
                    SendClientMessage(i, COLOR_WHITE, "Your bandana was enabled automatically as you entered a turf in an active war.");
                    SetPlayerColor(i, GangInfo[PlayerInfo[i][pGang]][gColor] & ~0xff);
                }
                if((id = GetNearbyPoint(i, 30.0)) >= 0 && PointInfo[id][pTime] == 0 && PointInfo[id][pCapturer] != INVALID_PLAYER_ID)
                {
                       if(PlayerInfo[i][pTagType] == TAG_VIP)
                    {
                        SetPlayerSpecialTag(i, TAG_NONE);
                        SendClientMessage(i, COLOR_YELLOW, "Your VIP tag was automatically disabled as you've entered an active point area.");
                    }
                    PlayerInfo[i][pBandana] = 1;
                    SendClientMessage(i, COLOR_WHITE, "Your bandana was enabled automatically as you are in range of an active point.");
                }
            }

            if(!PlayerInfo[i][pBackup] && !IsPlayerBeingFound(i))
            {
                // Yeah, this is indeed a mess. But it works. Cleaning this section is on my list.
                if(PlayerInfo[i][pJoinedEvent] && EventInfo[eType] == 2) {
                    SetPlayerColor(i, (PlayerInfo[i][pEventTeam] == RED_TEAM) ? (0xFF000000) : (0x0000FF00));
                } else if(PlayerInfo[i][pPaintball] == 2) {
                    SetPlayerColor(i, (PlayerInfo[i][pPaintballTeam] == 1) ? (0x33CCFF00) : (0xFFFF9900));
                } else if(PlayerInfo[i][pJailType] == 2) {
                    SetPlayerColor(i, 0xAD7A2100);
                } else if(PlayerInfo[i][pFaction] >= 0 && PlayerInfo[i][pDuty] && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_HITMAN) {
                    SetPlayerColor(i, FactionInfo[PlayerInfo[i][pFaction]][fColor] & ~0xff);
                //} else if(PlayerInfo[i][pFaction] >= 0 && PlayerInfo[i][pDuty] == 0 && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_HITMAN && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_POLICE && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_MEDIC) {
                    //SetPlayerColor(i, FactionInfo[PlayerInfo[i][pFaction]][fColor] & ~0xff);
                } else if(PlayerInfo[i][pGang] >= 0 && PlayerInfo[i][pBandana]) {
                    SetPlayerColor(i, GangInfo[PlayerInfo[i][pGang]][gColor] & ~0xff);
                } else if(PlayerHasJob(i, JOB_TAXIDRIVER) && PlayerInfo[i][pTaxiFare] > 0) {
                    SetPlayerColor(i, 0xF5DEB300);
                } else if(PlayerInfo[i][pVIPPackage] > 0 && PlayerInfo[i][pVIPColor]) {
                    SetPlayerColor(i, 0xFF00FF00);
                //} else if(PlayerInfo[i][pAdmin] > 0 && PlayerInfo[i][pAdminDuty]) {
                    //SetPlayerColor(i, 0xAA333300); // 0xFFD70000
                } else {
                    SetPlayerColor(i, 0xFFFFFF00);
                }
            }
        }
    }

    for(new i = 0; i < MAX_ACTORS; i ++)
    {
        if(IsValidActor(i))
        {
            new
                Float:x,
                Float:y,
                Float:z;
            GetActorPos(i, x, y, z);
            SetActorPos(i, x, y, z);
        }
    }

    format(string, sizeof(string), "Raw ephedrine\nStock: %i\nPrice: $1,000/gram\n/buydrug ephedrine [amount]", gEphedrineStock);
    UpdateDynamic3DTextLabelText(gEphedrineStockText, COLOR_YELLOW, string);
    format(string, sizeof(string), "Marijuana seeds\nStock: %i\nPrice: $500/seed\n/buydrug seeds [amount]", gSeedsStock);
    UpdateDynamic3DTextLabelText(gSeedsStockText, COLOR_YELLOW, string);
    format(string, sizeof(string), "Cocaine\nStock: %i\nPrice: $750/gram\n/buydrug cocaine [amount]", gCocaineStock);
    UpdateDynamic3DTextLabelText(gCocaineText, COLOR_YELLOW, string);

    if(Iter_Count(Player) > gPlayerRecord)
    {
        gPlayerRecord = Iter_Count(Player);
        gRecordDate = GetDate();
        SaveServerInfo();
    }
}*/ 
__________________

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 08:54 PM.


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