Help foreach Player [It not update]
#1

Код:
public globalPlayerLoop() {
	pingTick++;
	if(pingTick >= 120) {
	    if(mysql_ping() == -1) {
			mysql_reconnect(); // After 120 seconds (2 minutes), we need to ensure the connection is still alive. MySQL sometimes plays up and forces the connection to timeout.
		}
		pingTick = 0;
	}

	if(adTick >= 1)
		adTick--;
	/* --------------------- WORLD TIME --------------------- */

/*	gettime(gTime[0], gTime[1], gTime[2]);

	if(gTime[1] >= 59 && gTime[2] >= 59) {

		weatherVariables[1] += random(3) + 1; // Weather changes aren't regular.

		//SetWorldTime(gTime[0]); // Set the world time to keep the worldtime variable updated (and ensure it syncs instantly for connecting players).

		if(weatherVariables[1] >= MAX_WEATHER_POINTS) {
			weatherVariables[0] = validWeatherIDs[random(sizeof(validWeatherIDs))];
			foreach(new i: Player) {
				if(!GetPlayerInterior(i)) {
					SetPlayerWeather(i, weatherVariables[0]);
				}
				else SetPlayerWeather(i, INTERIOR_WEATHER_ID);
			}
			weatherVariables[1] = 0;
		}
	}*/

	foreach(new x: Player)
	{
			//--------------------
	  		PlayerInfo[x][pConnectedSeconds] += 1;
		//if(gTime[2] >= 59) syncPlayerTime(x);
	    //if(PlayerInfo[x][pStatus] == 1) {

			if(IsPlayerESC[x] <= 0)
			{
				IsPlayerESC[x] = 0;
				Esctime[x] += 1;
				format(szMessage, sizeof(szMessage), "*ЛВШґЄСиЗ¤ГТЗ* (%d ЗФ№Т·Х)", Esctime[x]);
				SetPlayerChatBubble(x,szMessage,0x6E6E6EFF,30.0,1500);
			}
			IsPlayerESC[x]--;
			PlayerInfo[x][pSeconds]++;
		    // Fuel
		    new vehicleid = GetPlayerVehicleID(x);
		    if(GetPlayerState(x) == PLAYER_STATE_DRIVER && Fuel[vehicleid] <= 0)
		    {
		        if(Bicycle(vehicleid)) return 1;
		    	new engine, lights, alarm, doors, bonnet, boot, objective;
				GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
				if(engine == VEHICLE_PARAMS_ON)
				{
					SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
				    format(szMessage, sizeof(szMessage), "* ѕТЛ№РўН§ %s ЛВШґЕ§а№ЧиН§ЁТЎдБиБХЎкТ«аЛЕЧНАТВ㹶ѧ", RPN(x));
					nearByMessage(x, COLOR_PURPLE, szMessage);
				}
		    }
			if(TaxiTime[x] > 0)
			{//Taxi driver and passenger only
			    if(TaxiTime[x] >= 16)
				{
					TaxiTime[x] = 1;
	      			TaxiCost[x] += 10;
				}
			    TaxiTime[x] += 1;
			    format(szMessage, sizeof(szMessage), "%d",TaxiTime[x]);
				PlayerTextDrawSetString(x, taxiTimeTD[x], szMessage);

			    format(szMessage, sizeof(szMessage), "$%d",TaxiCost[x]);
				PlayerTextDrawSetString(x, taxicostTD[x], szMessage);

			}
  			if(Sle[x] == 1)
   			{
				SleTime[x] += 10;
				PlayerInfo[x][pEnergy] = SleTime[x];
				SetProgressBarValue(x,EnergyBar[x], PlayerInfo[x][pEnergy]);
				UpdateProgressBar(x,EnergyBar[x]);
				if(!IsPlayerInAnyVehicle(x))
				{
     				ApplyAnimation(x,"CRACK","crckidle2",4.0,0,0,0,1,0);
				}
   			    if(SleTime[x] >= 500)
   			    {
   			    	if(IsPlayerInAnyVehicle(x))
					{
	   			    	Sle[x] = 0;
	   			    	SleTime[x] = 0;
	   			    	SendClientMessage(x, COLOR_YELLOW, "¤Ші№Н№аµзБНФиБбЕйЗ");
	   			    	PlayerInfo[x][pEnergy] = 500;
	                    GameTextForPlayer(x,"~y~Success...", 5000, 3);
					}
					else
					{
	   			    	Sle[x] = 0;
	   			    	SleTime[x] = 0;
	   			    	SendClientMessage(x, COLOR_YELLOW, "¤Ші№Н№аµзБНФиБбЕйЗ");
	   			    	PlayerInfo[x][pEnergy] = 500;
	   			    	TogglePlayerControllable(x, 1);
	                    GameTextForPlayer(x,"~y~Success...", 5000, 3);
	                    SetTimerEx("CAnim",500, false, "i", x);
                    }
   			    }
   			    else if(SleTime[x] >= 450)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~~b~iiiiiiiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 450;
				}
   			    else if(SleTime[x] >= 400)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~i~b~iiiiiiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 400;
				}
   			    else if(SleTime[x] >= 350)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~ii~b~iiiiiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 350;
				}
   			    else if(SleTime[x] >= 300)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iii~b~iiiiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 300;
				}
   			    else if(SleTime[x] >= 250)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iiii~b~iiiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 250;
				}
   			    else if(SleTime[x] >= 200)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iiiii~b~iiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 200;
				}
   			    else if(SleTime[x] >= 150)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iiiiii~b~iii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 150;
				}
   			    else if(SleTime[x] >= 100)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iiiiiii~b~ii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 100;
				}
   			    else if(SleTime[x] >= 50)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iiiiiiii~b~i", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 50;
				}
   			}

			if(GetPlayerVirtualWorld(x) == GetPlayerVirtualWorld(x)-BUSINESS_VIRTUAL_WORLD)
			{
			    new
			        businessID = GetPlayerVirtualWorld(x)-BUSINESS_VIRTUAL_WORLD;


				switch(businessVariables[businessID][bType])
				{
					case 1: PlayerTextDrawSetString(x,SDPlace[x],  "24/7");
					case 3: PlayerTextDrawSetString(x,SDPlace[x],  "Bar");
					case 4: PlayerTextDrawSetString(x,SDPlace[x],  "Sex Shop");
					case 7: PlayerTextDrawSetString(x,SDPlace[x],  "Restaurant");
				}
			}
			else
			{
				new area[35];
				GetPlayer2DZone(x, area, sizeof(area));
		        format(szMessage,sizeof(szMessage),"%s",area);
		        PlayerTextDrawSetString(x,SDPlace[x], szMessage);
			}
		 	if(DelayWeaponHack[x] > 0)
			{
				DelayWeaponHack[x]--;
   				if(DelayWeaponHack[x] < 0) DelayWeaponHack[x] = 0;
			}
		 	if(AttackTime[x] > 0)
			{
				AttackTime[x]--;
   				if(AttackTime[x] < 0) AttackTime[x] = 0;
			}
		 	if(DelayMECHANIC[x] > 0)
			{
				DelayMECHANIC[x]--;
   				if(DelayMECHANIC[x] < 0) DelayMECHANIC[x] = 0;
			}
		 	if(HoldDL[x] > 0)
			{
				HoldDL[x]--;
   				if(HoldDL[x] < 0) HoldDL[x] = 0;
			}

		/*	if(PlayerInfo[x][pEnergy] < 500)
			{
				PlayerInfo[x][pEnergy]++;
			}
*/
			if(EatingPizza[x] > 0)
			{
			    PlayerInfo[x][pHungry] += random(20);

				SetProgressBarValue(x,HungryBar[x], PlayerInfo[x][pHungry]);
				UpdateProgressBar(x,HungryBar[x]);

				new Float:health;

				GetPlayerHealth(x,health);
				if(health >= 100) SetSafePlayerHealth(x,100.0);
				else SetSafePlayerHealth(x,health+1);

			    if(PlayerInfo[x][pHungry] >= 1000)
			    {

			    	PlayerInfo[x][pHungry] = 1000;

			    }
			}

			if(GetPlayerSkin(x) == 0) {
			SetPlayerSkin(x, PlayerInfo[x][pBuySkin]);
			PlayerInfo[x][pSkin] = PlayerInfo[x][pBuySkin];
			}
			if(PlayerInfo[x][pMuted] >= 1) {
			    PlayerInfo[x][pMuted]--; // We don't need two variables for muting - just use -1 to permamute (admin mute) and a positive var for a temp mute.

			    if(PlayerInfo[x][pMuted] == 0) {
			        SendClientMessage(x, COLOR_GREY, "К¶Т№Ргєй¤ШіЛТВд»вґВНСµв№БСµФ");
			    }
			}


			if(PlayerInfo[x][pAdminLevel] > 0) {
				if(GetPVarInt(x, "pAdminPINConfirmed") >= 1)
				    SetPVarInt(x, "pAdminPINConfirmed", GetPVarInt(x, "pAdminPINConfirmed")-1);
			}

			if(PlayerInfo[x][pPhoneCall] != -1) {

				PlayerInfo[x][pPhoneCredit]--;

				if(PlayerInfo[x][pPhoneCredit] == 60) {
					SendClientMessage(x, COLOR_HOTORANGE, "а¤ГґФµ¤ШігЎЕйЛБґбЕйЗ¤§аЛЕЧН 60 ЗФ№Т·Х");
				}

				else if(PlayerInfo[x][pPhoneCredit] < 1) {
					SendClientMessage(x, COLOR_WHITE, "а§Ф№г№в·ГИСѕ·мўН§¤ШіЛБґбЕйЗд»·Хи 24/7 аѕЧиНаѕФиБа¤ГґФµ");

					if(GetPlayerSpecialAction(x) == SPECIAL_ACTION_USECELLPHONE) {
						SetPlayerSpecialAction(x, SPECIAL_ACTION_STOPUSECELLPHONE);
						if(!IsPlayerAttachedObjectSlotUsed(x, CARRYSLOT) && CarrySome[x] == 0) SetPlayerAttachedObject(x, CARRYSLOT, 330, 6);
						//if(IsPlayerAttachedObjectSlotUsed(playerid, CARRYSLOT) && CarrySome[playerid] == 0) RemovePlayerAttachedObject(playerid, CARRYSLOT);
					}
					if(PlayerInfo[x][pPhoneCall] != -1 && PlayerInfo[x][pPhoneCall] < MAX_PLAYERS) {

						SendClientMessage(PlayerInfo[x][pPhoneCall], COLOR_WHITE, "КТВЛЕШґ (а¤ГґФµЛБґ)");

						if(GetPlayerSpecialAction(PlayerInfo[x][pPhoneCall]) == SPECIAL_ACTION_USECELLPHONE) {
							SetPlayerSpecialAction(PlayerInfo[x][pPhoneCall], SPECIAL_ACTION_STOPUSECELLPHONE);
							if(IsPlayerAttachedObjectSlotUsed(x, CARRYSLOT) && CarrySome[x] == 0) RemovePlayerAttachedObject(x, CARRYSLOT);
						}
						PlayerInfo[PlayerInfo[x][pPhoneCall]][pPhoneCall] = -1;
					}
					PlayerInfo[x][pPhoneCall] = -1;
				}
			}
			if(InTag[x] == 0 && PlayerInfo[x][pSTag] > 0)
			{
				new tagmr[256];
			    switch(PlayerInfo[x][pSTag])
			    {
			        case 1:
			        {
			        	if(!strcmp(PlayerInfo[x][pTag1], "(null)", true))
						{
							InTag[x] = 0;
							PlayerInfo[x][pSTag] = 0;
							return 1;
						}
						strmid(tagmr, PlayerInfo[x][pTag1], 0, strlen(PlayerInfo[x][pTag1]), 255);
						format(szMessage, sizeof(szMessage), "{%s}%s", PlayerInfo[x][pCTag1],tagmr);
						TagDD[x] = Create3DTextLabel(szMessage, 0xFFFFFFFF, 0.0, 0.0, 0.0, 50.0, 0, 1);
						Attach3DTextLabelToPlayer(TagDD[x], x, 0.0, 0.0, 0.5);
						InTag[x] = 1;
			        }
			        case 2:
			        {
			        	if(!strcmp(PlayerInfo[x][pTag2], "(null)", true))
						{
							InTag[x] = 0;
							PlayerInfo[x][pSTag] = 0;
							return 1;
						}
						strmid(tagmr, PlayerInfo[x][pTag2], 0, strlen(PlayerInfo[x][pTag2]), 255);
						format(szMessage, sizeof(szMessage), "{%s}%s", PlayerInfo[x][pCTag2],tagmr);
						TagDD[x] = Create3DTextLabel(szMessage, 0xFFFFFFFF, 0.0, 0.0, 0.0, 50.0, 0, 1);
						Attach3DTextLabelToPlayer(TagDD[x], x, 0.0, 0.0, 0.5);
						InTag[x] = 1;
			        }
			        case 3:
			        {
			        	if(!strcmp(PlayerInfo[x][pTag3], "(null)", true))
						{
							InTag[x] = 0;
							PlayerInfo[x][pSTag] = 0;
							return 1;
						}
						strmid(tagmr, PlayerInfo[x][pTag3], 0, strlen(PlayerInfo[x][pTag3]), 255);
						format(szMessage, sizeof(szMessage), "{%s}%s", PlayerInfo[x][pCTag3],tagmr);
						TagDD[x] = Create3DTextLabel(szMessage, 0xFFFFFFFF, 0.0, 0.0, 0.0, 50.0, 0, 1);
						Attach3DTextLabelToPlayer(TagDD[x], x, 0.0, 0.0, 0.5);
						InTag[x] = 1;
			        }
			        case 4:
			        {
						if(PlayerInfo[x][pVIP] == 1)
						{
							format(tagmr, sizeof(tagmr), "{A4A4A4}Silver Member");
						}
						else if(PlayerInfo[x][pVIP] == 2)
						{
							format(tagmr, sizeof(tagmr), "{F7FE2E}Gold Member");
						}
						else if(PlayerInfo[x][pVIP] == 3)
						{
							format(tagmr, sizeof(tagmr), "{0080FF}Platinum Member");
						}
						else if(PlayerInfo[x][pVIP] == 4)
						{
							format(tagmr, sizeof(tagmr), "{FA58D0}Premium Member");
						}
						else
						{
							InTag[x] = 0;
							PlayerInfo[x][pSTag] = 0;
							return 1;
						}
						InTag[x] = 1;
						TagDD[x] = Create3DTextLabel(tagmr, 0xFFFFFFFF, 0.0, 0.0, 0.0, 50.0, 0, 1);
						Attach3DTextLabelToPlayer(TagDD[x], x, 0.0, 0.0, 0.5);
                    }
				}
			}

			if(PlayerInfo[x][pSpectating] != INVALID_PLAYER_ID) { // OnPlayerInteriorChange doesn't work properly when spectating.
				if(GetPlayerInterior(x) != GetPlayerInterior(PlayerInfo[x][pSpectating])){
					SetPlayerInterior(x, GetPlayerInterior(PlayerInfo[x][pSpectating]));
				}
				if(GetPlayerVirtualWorld(x) != GetPlayerVirtualWorld(PlayerInfo[x][pSpectating])){
					SetPlayerVirtualWorld(x, GetPlayerVirtualWorld(PlayerInfo[x][pSpectating]));
				}
			}
            if(PlayerInfo[x][pBackup] != -1) {
                if(IsPlayerConnectedEx(PlayerInfo[x][pBackup])) {
                    GetPlayerPos(PlayerInfo[x][pBackup], PlayerInfo[PlayerInfo[x][pBackup]][pPos][0], PlayerInfo[PlayerInfo[x][pBackup]][pPos][1], PlayerInfo[PlayerInfo[x][pBackup]][pPos][2]);
                    SetPlayerCheckpoint(x, PlayerInfo[PlayerInfo[x][pBackup]][pPos][0], PlayerInfo[PlayerInfo[x][pBackup]][pPos][1], PlayerInfo[PlayerInfo[x][pBackup]][pPos][2], 10.0);
                }
                else {
                    PlayerInfo[x][pBackup] = -1;
					PlayerInfo[x][pCheckpoint] = 0;

                    SendClientMessage(x, COLOR_GREY, "јЩйаЕи№·ХиўНЎУЕС§аКГФБдґйµСґўТґЁТЎа«ФїаЗНГм");
                    DisablePlayerCheckpoint(x);
                }
            }
			if(PlayerInfo[x][pDrag] != -1) { // Considering how slow SetSafePlayerPos works in practice, using a 1000ms timer in lieu of OnPlayerUpdate (the old script) is a better idea.
				if(IsPlayerConnectedEx(PlayerInfo[x][pDrag])) {
					switch(GetPlayerState(PlayerInfo[x][pDrag])) { // If they're not on foot, they're not gonna be dragging anything...
						case 1: { // on foot
							GetPlayerPos(PlayerInfo[x][pDrag], PlayerInfo[x][pPos][0], PlayerInfo[x][pPos][1], PlayerInfo[x][pPos][2]);
							SetSafePlayerPos(x, PlayerInfo[x][pPos][0], PlayerInfo[x][pPos][1], PlayerInfo[x][pPos][2]);

							SetPlayerVirtualWorld(x, GetPlayerVirtualWorld(PlayerInfo[x][pDrag]));
							SetPlayerInterior(x, GetPlayerInterior(PlayerInfo[x][pDrag]));
						}
						case 2, 3: {
							SendClientMessage(PlayerInfo[x][pDrag], COLOR_GREY, "¤ШідБиКТБТГ¶ўЦй№Г¶дґйЛТЎЎУЕС§ЕТЎг¤ГєТ§¤№ (гЄй /detain)");
							RemovePlayerFromVehicleEx(PlayerInfo[x][pDrag]);
						}
						case 7: { // Death
							SendClientMessage(x, COLOR_WHITE, "јЩйаЕ蹤№·Хи¤ШіЕТЎаКХВЄХЗФµбЕйЗ");
							PlayerInfo[x][pDrag] = -1;
						}
					}
				}
				else {

					SendClientMessage(x, COLOR_WHITE, "јЩйаЕ蹤№·Хи¤ШіЕТЎµСґўТґЎСєа«ФїаЗНГм");
					PlayerInfo[x][pDrag] = -1; // Kills off any disconnections.
				}
			}
			if(PlayerDrunk[x] >= 10)
			{
			    PlayerDrunkTime[x] += 1;
			    if(PlayerDrunkTime[x] == 8)
			    {
					new Drunk = GetPlayerDrunkLevel(x);
					Drunk += 5000;
			        SetPlayerDrunkLevel(x,Drunk);
			        PlayerDrunkTime[x] = 0;
			        new Float:angle;
					GetPlayerFacingAngle(x, angle);
					if(IsPlayerInAnyVehicle(x))
					{
					    if(GetPlayerState(x) == 2)
					    {
					    	SetVehicleZAngle(GetPlayerVehicleID(x), angle + 25);
						}
					}
					else
					{
					    ApplyAnimation(x,"PED", "WALK_DRUNK",4.0,0,1,0,0,0);
					}
			    }
			}
			if(PlayerInfo[x][pMatrunTime] >= 1) {
				PlayerInfo[x][pMatrunTime]++;
			}

	        if(PlayerInfo[x][pJobDelay] >= 1) {
	   	    	PlayerInfo[x][pJobDelay]--;
				if(PlayerInfo[x][pJobDelay] == 0) SendClientMessage(x, COLOR_WHITE, "аЗЕТвЛЕґўН§НТЄХѕўН§¤ШіЛБґЕ§бЕйЗ");
	        }

	        if(PlayerInfo[x][pNewbieTimeout] > 0) {
	            PlayerInfo[x][pNewbieTimeout]--;
	            if(PlayerInfo[x][pNewbieTimeout] == 0) SendClientMessage(x, COLOR_WHITE, "¤ШіКТБТГ¶гЄйЄиН§·Т§ Newbie дґйНХЎ¤ГСй§");
	        }

			if(PlayerInfo[x][pHackWarnings] >= 1 && IsPlayerESC[x] == 3) {
				PlayerInfo[x][pHackWarnTime]++;

				if(PlayerInfo[x][pHackWarnTime] >= 10) {
					PlayerInfo[x][pHackWarnings] = 0;
					PlayerInfo[x][pHackWarnTime] = 0;
				}
			}
			if(PlayerInfo[x][pDropCarTimeout] >= 1) {
                PlayerInfo[x][pDropCarTimeout]--;
                if(PlayerInfo[x][pDropCarTimeout] == 1) {
                    PlayerInfo[x][pDropCarTimeout] = 0;
                    SendClientMessage(x, COLOR_WHITE, "¤ШіКТБТГ¶ґГН»Г¶дґйНХЎ¤ГСй§");
				}
			}

			if(GetPVarInt(x, "tutTime") > 0) {
			    SetPVarInt(x, "tutTime", GetPVarInt(x, "tutTime")-1);
			    if(GetPVarInt(x, "tutTime") == 0) {
			        TextDrawHideForPlayer(x, textdrawVariables[8]);
			        TextDrawShowForPlayer(x, textdrawVariables[7]);
			    }
			}
			if(PlayerInfo[x][pHospitalized] >= 2) {
				GetPlayerHealth(x, PlayerInfo[x][pHealth]);
			    if(PlayerInfo[x][pVIP])
			    {
					switch(PlayerInfo[x][pVIP])
					{
					    case 1:
					    {
			                SetSafePlayerHealth(x, PlayerInfo[x][pHealth]+10);
					    }
					    case 2:
					    {
			                SetSafePlayerHealth(x, PlayerInfo[x][pHealth]+12);
					    }
					    case 3:
					    {
			                SetSafePlayerHealth(x, PlayerInfo[x][pHealth]+14);
					    }
					    case 4:
					    {
			                SetSafePlayerHealth(x, PlayerInfo[x][pHealth]+16);
					    }
	                }
                }
                SetSafePlayerHealth(x, PlayerInfo[x][pHealth]+7.5);
                if(PlayerInfo[x][pDie] > 0)
                {
            		PlayerInfo[x][pDie] = 0;
                }
				PlayerInfo[x][pHospitalized]++;


                if(PlayerInfo[x][pHealth]+10 >= 100) {

					switch(PlayerInfo[x][pVIP])
					{
						case 1:
						{
				            SetSafePlayerHealth(x, 65);
						}
						case 2:
						{
				            SetSafePlayerHealth(x, 75);
						}
						case 3:
						{
				          	SetSafePlayerHealth(x, 85);
						}
						case 4:
						{
				    		SetSafePlayerHealth(x, 100);
						}
						default:
						{
							SetSafePlayerHealth(x, 50);
						}
		         	}
                    PlayerInfo[x][pHospitalized] = 0;

                    switch(GetPVarInt(x, "hosp")) {
                   	 	case 1: {
	                        PlayerInfo[x][pPos][0] = 1172.359985;
							PlayerInfo[x][pPos][1] = -1323.313110;
							PlayerInfo[x][pPos][2] = 15.402919;
							PlayerInfo[x][pHealth] = 75;
							PlayerInfo[x][pArmour] = 0;
							PlayerInfo[x][pVirtualWorld] = 0;
							PlayerInfo[x][pInterior] = 0;
	                        SetSpawnInfo(x, 0, PlayerInfo[x][pSkin], 1172.359985, -1323.313110, 15.402919, 0, 0, 0, 0, 0, 0, 0);
	                        SpawnPlayer(x);
	                        SendClientMessage(x, COLOR_LIGHTRED, "¤ШідґйННЎЁТЎвГ§ѕВТєТЕ");
	                        format(szMessage, sizeof(szMessage), "бЕРаКХВа§Ф№ %d$ КУЛГСє·ХиѕСЎбЕРНТЗШёўН§¤Ші¶ЩЎВЦґ", 10*PlayerInfo[x][pLevel]);
	                        SendClientMessage(x, COLOR_LIGHTRED, szMessage);
	                        PlayerInfo[x][pMoney] -= 10*PlayerInfo[x][pLevel];
	                        //validResetPlayerWeapons(x);
	                        DeletePVar(x, "hosp");
                        }
                        case 2: {
	                        PlayerInfo[x][pPos][0] = 2034.196166;
							PlayerInfo[x][pPos][1] = -1402.591430;
							PlayerInfo[x][pPos][2] = 17.295030;
							PlayerInfo[x][pHealth] = 75;
							PlayerInfo[x][pArmour] = 0;
							PlayerInfo[x][pVirtualWorld] = 0;
							PlayerInfo[x][pInterior] = 0;
	                        SetSpawnInfo(x, 0, PlayerInfo[x][pSkin], 2034.196166, -1402.591430, 17.295030, 0, 0, 0, 0, 0, 0, 0);
	                        SpawnPlayer(x);
	                        SendClientMessage(x, COLOR_LIGHTRED, "¤ШідґйННЎЁТЎвГ§ѕВТєТЕ");
	                        format(szMessage, sizeof(szMessage), "бЕРаКХВа§Ф№ %d$ КУЛГСє·ХиѕСЎбЕРНТЗШёўН§¤Ші¶ЩЎВЦґ", 10*PlayerInfo[x][pLevel]);
	                        SendClientMessage(x, COLOR_LIGHTRED, szMessage);
	                        PlayerInfo[x][pMoney] -= 10*PlayerInfo[x][pLevel];
	                        //validResetPlayerWeapons(x);
	                        SetSafePlayerPos(x, 2034.196166, -1402.591430, 17.295030);
	                        DeletePVar(x, "hosp");
                        }
                    }
				}
			}
	}
	foreach(new x: Player)
	{
			if(PlayerInfo[x][pSkinSet] >= 1) {
			    PlayerInfo[x][pSkinSet]++;
			    if(PlayerInfo[x][pSkinSet] == 3 && GetPlayerSkin(x) != PlayerInfo[x][pSkin]) {
					SetPlayerSkin(x, PlayerInfo[x][pSkin]); // Set the skin first.
				}
				if(PlayerInfo[x][pSkinSet] == 4) {
                    //giveSaveWP(x); // Then give the player their weapons. Seems like a SA-MP bug? Pain in the arse might I add!
                    PlayerInfo[x][pSkinSet] = 0;
					TogglePlayerControllable(x, true);
				}
			}

			if(PlayerInfo[x][pFreezeTime] != 0) {
				TogglePlayerControllable(x, 0);
				if(PlayerInfo[x][pFreezeType] == 5)
					ApplyAnimation(x, "FAT", "IDLE_TIRED", 4.1, 1, 1, 1, 1, 0, 1);

				if(PlayerInfo[x][pFreezeTime] > 0) {
					PlayerInfo[x][pFreezeTime]--;
					if(PlayerInfo[x][pFreezeTime] == 0) {
						if(PlayerInfo[x][pFreezeType] == 5) {
							SetPlayerDrunkLevel(x, 0);
							ClearAnimations(x);
						}
						PlayerInfo[x][pFreezeType] = 0;
						TogglePlayerControllable(x, true);
					}
				}

			}

			if(PlayerInfo[x][pPrisonID] > 0) {
			    if(PlayerInfo[x][pPrisonUse] >= 0)
				{
                	PlayerInfo[x][pPrisonTime]--;
				}
                switch(PlayerInfo[x][pPrisonID]) {
					case 1: {
						format(szMessage, sizeof(szMessage), "~n~~n~~n~~n~~n~~n~~n~ ~r~Prisoned!~n~~w~%d seconds (%d minutes) left", PlayerInfo[x][pPrisonTime], PlayerInfo[x][pPrisonTime]/60);
					}
					case 2, 3: { // We're going to be using 3 for IC jail, so... yeah
						format(szMessage, sizeof(szMessage), "~n~~n~~n~~n~~n~~n~~n~ ~r~Jailed!~n~~w~%d seconds (%d minutes) left", PlayerInfo[x][pPrisonTime], PlayerInfo[x][pPrisonTime]/60);
					}
				}

				GameTextForPlayer(x, szMessage, 2000, 3); // Always specify the game text time longer than the intended time; it always fades out before it should, causing an annoying flash.

                if(PlayerInfo[x][pPrisonTime] == 1 && PlayerInfo[x][pPrisonID] >= 1) {
                    PlayerInfo[x][pPrisonID] = 0;
                    SetPlayerWantedLevel(x, 0);
                    PlayerInfo[x][pPrisonTime] = 0;
                    if(PlayerInfo[x][pPrisonUse] >= 0)
                    {
					   	format(szMessage, sizeof(szMessage), "ЛйН§ўС§·Хи %d (ЗиТ§)\n(ЕзН¤)", PlayerInfo[x][pPrisonUse]);
						UpdateDynamic3DTextLabelText(JailInfo[PlayerInfo[x][pPrisonUse]][jaLabelID], COLOR_YELLOW, szMessage);
                        JailInfo[PlayerInfo[x][pPrisonUse]][jaLock] = 1;
                    	format(JailInfo[PlayerInfo[x][pPrisonUse]][jaOwner], MAX_PLAYER_NAME, "Nobody");
                      	PlayerInfo[x][pPrisonUse] = -1;
					}
					SendClientMessage(x, COLOR_WHITE, "аЗЕТ¤ШіЛБґбЕйЗ! ¤Ші¶ЩЎ»ЕиНВµСЗННЎЁТЎ¤ШЎ/аГЧН№ЁУ");
					SetSafePlayerPos(x, 1543.1656,-1675.5603,13.5559);
					SetPlayerVirtualWorld(x, 0);
					SetPlayerInterior(x, 0);
					SetPlayerSkin(x, PlayerInfo[x][pBuySkin]);
				}
			}

			if(PlayerInfo[x][pSpamCount] >= 1)
				PlayerInfo[x][pSpamCount]--;

			if(PlayerInfo[x][pSpamCount] >= 5 && PlayerInfo[x][pAdminLevel] == 0) {
			    PlayerInfo[x][pMuted] = 10;
			    PlayerInfo[x][pSpamCount] = 0;
			    SendClientMessage(x, COLOR_GREY, "¤Ші¶ЩЎгєйвґВНСµв№БСµФа№ЧиН§ЁТЎ·УЎТГ Spam бЕРЁР¶ЩЎВЎаЕФЎг№ 10 ЗФ№Т·Х");
			}

		    if(PlayerInfo[x][pSeconds] >= 3600) {

		        PlayerInfo[x][pSeconds] = 0;
		        PlayerInfo[x][pPlayingHours]++;
		        PlayerInfo[x][pExp] ++;

		        new
		            BankInterest,
		            RandPay = ((PlayerInfo[x][pPlayingHours]*PlayerInfo[x][pPlayingHours]/20)) * PlayerInfo[x][pLevel]/2,
					TotalPay = BankInterest + RandPay;


				switch(PlayerInfo[x][pVIP])
				{
					case 1:
					{
			            BankInterest = PlayerInfo[x][pBankMoney] / 950;
					}
					case 2:
					{
			            BankInterest = PlayerInfo[x][pBankMoney] / 900;
					}
					case 3:
					{
			          	BankInterest = PlayerInfo[x][pBankMoney] / 850;
					}
					case 4:
					{
			    		BankInterest = PlayerInfo[x][pBankMoney] / 800;
					}
					default:
					{
						BankInterest = PlayerInfo[x][pBankMoney] / 1000;
					}
	         	}

				new nxtlevel = PlayerInfo[x][pLevel]+1;
				new expamount = nxtlevel*4;


				if(PlayerInfo[x][pBankMoney]+PlayerInfo[x][pMoney] > -5000000) {
		            SendClientMessage(x, COLOR_TEAL, "----------------------------------------------------------------------------");
					SendClientMessage(x, COLOR_WHITE, "¶Ц§аЗЕТ paycheck ўН§¤ШібЕйЗ; д»·Хиё№Т¤ТГаѕЧиНаєФЎа§Ф№ўН§¤Ші");
					PlayerInfo[x][pBankMoney] += TotalPay;
                    new taxamount = ((TotalPay/100) * assetVariables[1][aAssetValue]);
                    if(taxamount > 1) {
                        PlayerInfo[x][pBankMoney] -= taxamount;
                        groupVariables[GOVERNMENT_GROUP_ID][gSafe][0] += taxamount;
                        saveGroup(GOVERNMENT_GROUP_ID);
                    }
					format(szMessage, sizeof(szMessage), "Paycheck: $%d | ВНґа§Ф№г№ё№Т¤ТГ: $%d | ґНЎаєХйВё№Т¤ТГ: $%d | АТЙХ: $%d (%d а»НГма«з№µм) | ГЗБа§Ф№·Хидґй: $%d", RandPay, PlayerInfo[x][pBankMoney], BankInterest, taxamount, assetVariables[1][aAssetValue], TotalPay-taxamount);
		            SendClientMessage(x, COLOR_GREY, szMessage);
		            SendClientMessage(x, COLOR_TEAL, "----------------------------------------------------------------------------");

		            savePlayerData(x);

					if(PlayerInfo[x][pExp] >= expamount)
					{
						format(szMessage, sizeof(szMessage), "   ¤ШіБХ¤иТ»ГРКєЎТГім %d/%d бЕйЗКТБТГ¶ /buylevel аѕЧиНаѕФиБаЕаЗЕўН§¤Ші",PlayerInfo[x][pExp],expamount);
						SendClientMessage(x, COLOR_GREY, szMessage);
					}
					if(RentCarKey[x] > 0 && doesVehicleExist(RentCarKey[x]))
					{
					    if(PlayerInfo[x][pMoney] < 35)
					    {
					        DestroyVehicle(RentCarKey[x]);
					        RentCarKey[x] = -1;
					        RentCarLock[x] = 0;
					    }
					    else
					    {
					    	PlayerInfo[x][pMoney] -= 35;
					    	SendClientMessage(x, COLOR_LIGHTBLUE, "¤Ші¶ЩЎаГХВєаЎзє¤иТаЄиТ Taxi 35$");

					    }
					}
					if(PlayerInfo[x][pVIP] > 0)
					{
						PlayerInfo[x][pCoin]++;
						format(szMessage,sizeof(szMessage),"¤ШідґйГСєаЛГХВ*⤹ +1 ⤹㹻ѨЁШєС№¤ЧН %d",PlayerInfo[x][pCoin]);
						SendClientMessage(x, COLOR_LIGHTBLUE, szMessage);
					}

				}
				else {
				    SendClientMessage(x, COLOR_WHITE, "¤ШіаЕи№дБи№Т№ѕН·ХиЁРдґйГСє Paycheck");
				}
		    }

		    if(GetPlayerMoney(x) != PlayerInfo[x][pMoney]) {
				ResetPlayerMoney(x);
				GivePlayerMoney(x, PlayerInfo[x][pMoney]);
			}
	   // }
	}

	return true;
}
Some playaer is not update in loop
Reply
#2

Change: SetTimer("globalPlayerLoop", 1000, -1); to SetTimer("globalPlayerLoop", 1000, 1);
Reply
#3

Thank a lot bro
Reply
#4

Urmmm Not work !!
Reply
#5

Well, perhaps if you didn't delete your post so that other people having the same problem could fix it, then maybe we could see the issue.

In short: Do not delete or edit your post if it gets solved...
Reply
#6

Here

Код:
public globalPlayerLoop() {
	pingTick++;
	if(pingTick >= 120) {
	    if(mysql_ping() == -1) {
			mysql_reconnect(); // After 120 seconds (2 minutes), we need to ensure the connection is still alive. MySQL sometimes plays up and forces the connection to timeout.
		}
		pingTick = 0;
	}

	if(adTick >= 1)
		adTick--;
	/* --------------------- WORLD TIME --------------------- */

/*	gettime(gTime[0], gTime[1], gTime[2]);

	if(gTime[1] >= 59 && gTime[2] >= 59) {

		weatherVariables[1] += random(3) + 1; // Weather changes aren't regular.

		//SetWorldTime(gTime[0]); // Set the world time to keep the worldtime variable updated (and ensure it syncs instantly for connecting players).

		if(weatherVariables[1] >= MAX_WEATHER_POINTS) {
			weatherVariables[0] = validWeatherIDs[random(sizeof(validWeatherIDs))];
			foreach(new i: Player) {
				if(!GetPlayerInterior(i)) {
					SetPlayerWeather(i, weatherVariables[0]);
				}
				else SetPlayerWeather(i, INTERIOR_WEATHER_ID);
			}
			weatherVariables[1] = 0;
		}
	}*/

	foreach(new x: Player)
	{
			//--------------------
	  		PlayerInfo[x][pConnectedSeconds] += 1;
		//if(gTime[2] >= 59) syncPlayerTime(x);
	    //if(PlayerInfo[x][pStatus] == 1) {

			if(IsPlayerESC[x] <= 0)
			{
				IsPlayerESC[x] = 0;
				Esctime[x] += 1;
				format(szMessage, sizeof(szMessage), "*ЛВШґЄСиЗ¤ГТЗ* (%d ЗФ№Т·Х)", Esctime[x]);
				SetPlayerChatBubble(x,szMessage,0x6E6E6EFF,30.0,1500);
			}
			IsPlayerESC[x]--;
			PlayerInfo[x][pSeconds]++;
		    // Fuel
		    new vehicleid = GetPlayerVehicleID(x);
		    if(GetPlayerState(x) == PLAYER_STATE_DRIVER && Fuel[vehicleid] <= 0)
		    {
		        if(Bicycle(vehicleid)) return 1;
		    	new engine, lights, alarm, doors, bonnet, boot, objective;
				GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
				if(engine == VEHICLE_PARAMS_ON)
				{
					SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
				    format(szMessage, sizeof(szMessage), "* ѕТЛ№РўН§ %s ЛВШґЕ§а№ЧиН§ЁТЎдБиБХЎкТ«аЛЕЧНАТВ㹶ѧ", RPN(x));
					nearByMessage(x, COLOR_PURPLE, szMessage);
				}
		    }
			if(TaxiTime[x] > 0)
			{//Taxi driver and passenger only
			    if(TaxiTime[x] >= 16)
				{
					TaxiTime[x] = 1;
	      			TaxiCost[x] += 10;
				}
			    TaxiTime[x] += 1;
			    format(szMessage, sizeof(szMessage), "%d",TaxiTime[x]);
				PlayerTextDrawSetString(x, taxiTimeTD[x], szMessage);

			    format(szMessage, sizeof(szMessage), "$%d",TaxiCost[x]);
				PlayerTextDrawSetString(x, taxicostTD[x], szMessage);

			}
  			if(Sle[x] == 1)
   			{
				SleTime[x] += 10;
				PlayerInfo[x][pEnergy] = SleTime[x];
				SetProgressBarValue(x,EnergyBar[x], PlayerInfo[x][pEnergy]);
				UpdateProgressBar(x,EnergyBar[x]);
				if(!IsPlayerInAnyVehicle(x))
				{
     				ApplyAnimation(x,"CRACK","crckidle2",4.0,0,0,0,1,0);
				}
   			    if(SleTime[x] >= 500)
   			    {
   			    	if(IsPlayerInAnyVehicle(x))
					{
	   			    	Sle[x] = 0;
	   			    	SleTime[x] = 0;
	   			    	SendClientMessage(x, COLOR_YELLOW, "¤Ші№Н№аµзБНФиБбЕйЗ");
	   			    	PlayerInfo[x][pEnergy] = 500;
	                    GameTextForPlayer(x,"~y~Success...", 5000, 3);
					}
					else
					{
	   			    	Sle[x] = 0;
	   			    	SleTime[x] = 0;
	   			    	SendClientMessage(x, COLOR_YELLOW, "¤Ші№Н№аµзБНФиБбЕйЗ");
	   			    	PlayerInfo[x][pEnergy] = 500;
	   			    	TogglePlayerControllable(x, 1);
	                    GameTextForPlayer(x,"~y~Success...", 5000, 3);
	                    SetTimerEx("CAnim",500, false, "i", x);
                    }
   			    }
   			    else if(SleTime[x] >= 450)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~~b~iiiiiiiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 450;
				}
   			    else if(SleTime[x] >= 400)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~i~b~iiiiiiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 400;
				}
   			    else if(SleTime[x] >= 350)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~ii~b~iiiiiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 350;
				}
   			    else if(SleTime[x] >= 300)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iii~b~iiiiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 300;
				}
   			    else if(SleTime[x] >= 250)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iiii~b~iiiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 250;
				}
   			    else if(SleTime[x] >= 200)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iiiii~b~iiii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 200;
				}
   			    else if(SleTime[x] >= 150)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iiiiii~b~iii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 150;
				}
   			    else if(SleTime[x] >= 100)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iiiiiii~b~ii", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 100;
				}
   			    else if(SleTime[x] >= 50)
   			    {
   			    	GameTextForPlayer(x,"~g~S~r~l~y~e~r~e~y~p~n~iiiiiiii~b~i", 5000, 3);
   			    	PlayerInfo[x][pEnergy] = 50;
				}
   			}

			if(GetPlayerVirtualWorld(x) == GetPlayerVirtualWorld(x)-BUSINESS_VIRTUAL_WORLD)
			{
			    new
			        businessID = GetPlayerVirtualWorld(x)-BUSINESS_VIRTUAL_WORLD;


				switch(businessVariables[businessID][bType])
				{
					case 1: PlayerTextDrawSetString(x,SDPlace[x],  "24/7");
					case 3: PlayerTextDrawSetString(x,SDPlace[x],  "Bar");
					case 4: PlayerTextDrawSetString(x,SDPlace[x],  "Sex Shop");
					case 7: PlayerTextDrawSetString(x,SDPlace[x],  "Restaurant");
				}
			}
			else
			{
				new area[35];
				GetPlayer2DZone(x, area, sizeof(area));
		        format(szMessage,sizeof(szMessage),"%s",area);
		        PlayerTextDrawSetString(x,SDPlace[x], szMessage);
			}
		 	if(DelayWeaponHack[x] > 0)
			{
				DelayWeaponHack[x]--;
   				if(DelayWeaponHack[x] < 0) DelayWeaponHack[x] = 0;
			}
		 	if(AttackTime[x] > 0)
			{
				AttackTime[x]--;
   				if(AttackTime[x] < 0) AttackTime[x] = 0;
			}
		 	if(DelayMECHANIC[x] > 0)
			{
				DelayMECHANIC[x]--;
   				if(DelayMECHANIC[x] < 0) DelayMECHANIC[x] = 0;
			}
		 	if(HoldDL[x] > 0)
			{
				HoldDL[x]--;
   				if(HoldDL[x] < 0) HoldDL[x] = 0;
			}

		/*	if(PlayerInfo[x][pEnergy] < 500)
			{
				PlayerInfo[x][pEnergy]++;
			}
*/
			if(EatingPizza[x] > 0)
			{
			    PlayerInfo[x][pHungry] += random(20);

				SetProgressBarValue(x,HungryBar[x], PlayerInfo[x][pHungry]);
				UpdateProgressBar(x,HungryBar[x]);

				new Float:health;

				GetPlayerHealth(x,health);
				if(health >= 100) SetSafePlayerHealth(x,100.0);
				else SetSafePlayerHealth(x,health+1);

			    if(PlayerInfo[x][pHungry] >= 1000)
			    {

			    	PlayerInfo[x][pHungry] = 1000;

			    }
			}

			if(GetPlayerSkin(x) == 0) {
			SetPlayerSkin(x, PlayerInfo[x][pBuySkin]);
			PlayerInfo[x][pSkin] = PlayerInfo[x][pBuySkin];
			}
			if(PlayerInfo[x][pMuted] >= 1) {
			    PlayerInfo[x][pMuted]--; // We don't need two variables for muting - just use -1 to permamute (admin mute) and a positive var for a temp mute.

			    if(PlayerInfo[x][pMuted] == 0) {
			        SendClientMessage(x, COLOR_GREY, "К¶Т№Ргєй¤ШіЛТВд»вґВНСµв№БСµФ");
			    }
			}


			if(PlayerInfo[x][pAdminLevel] > 0) {
				if(GetPVarInt(x, "pAdminPINConfirmed") >= 1)
				    SetPVarInt(x, "pAdminPINConfirmed", GetPVarInt(x, "pAdminPINConfirmed")-1);
			}

			if(PlayerInfo[x][pPhoneCall] != -1) {

				PlayerInfo[x][pPhoneCredit]--;

				if(PlayerInfo[x][pPhoneCredit] == 60) {
					SendClientMessage(x, COLOR_HOTORANGE, "а¤ГґФµ¤ШігЎЕйЛБґбЕйЗ¤§аЛЕЧН 60 ЗФ№Т·Х");
				}

				else if(PlayerInfo[x][pPhoneCredit] < 1) {
					SendClientMessage(x, COLOR_WHITE, "а§Ф№г№в·ГИСѕ·мўН§¤ШіЛБґбЕйЗд»·Хи 24/7 аѕЧиНаѕФиБа¤ГґФµ");

					if(GetPlayerSpecialAction(x) == SPECIAL_ACTION_USECELLPHONE) {
						SetPlayerSpecialAction(x, SPECIAL_ACTION_STOPUSECELLPHONE);
						if(!IsPlayerAttachedObjectSlotUsed(x, CARRYSLOT) && CarrySome[x] == 0) SetPlayerAttachedObject(x, CARRYSLOT, 330, 6);
						//if(IsPlayerAttachedObjectSlotUsed(playerid, CARRYSLOT) && CarrySome[playerid] == 0) RemovePlayerAttachedObject(playerid, CARRYSLOT);
					}
					if(PlayerInfo[x][pPhoneCall] != -1 && PlayerInfo[x][pPhoneCall] < MAX_PLAYERS) {

						SendClientMessage(PlayerInfo[x][pPhoneCall], COLOR_WHITE, "КТВЛЕШґ (а¤ГґФµЛБґ)");

						if(GetPlayerSpecialAction(PlayerInfo[x][pPhoneCall]) == SPECIAL_ACTION_USECELLPHONE) {
							SetPlayerSpecialAction(PlayerInfo[x][pPhoneCall], SPECIAL_ACTION_STOPUSECELLPHONE);
							if(IsPlayerAttachedObjectSlotUsed(x, CARRYSLOT) && CarrySome[x] == 0) RemovePlayerAttachedObject(x, CARRYSLOT);
						}
						PlayerInfo[PlayerInfo[x][pPhoneCall]][pPhoneCall] = -1;
					}
					PlayerInfo[x][pPhoneCall] = -1;
				}
			}
			if(InTag[x] == 0 && PlayerInfo[x][pSTag] > 0)
			{
				new tagmr[256];
			    switch(PlayerInfo[x][pSTag])
			    {
			        case 1:
			        {
			        	if(!strcmp(PlayerInfo[x][pTag1], "(null)", true))
						{
							InTag[x] = 0;
							PlayerInfo[x][pSTag] = 0;
							return 1;
						}
						strmid(tagmr, PlayerInfo[x][pTag1], 0, strlen(PlayerInfo[x][pTag1]), 255);
						format(szMessage, sizeof(szMessage), "{%s}%s", PlayerInfo[x][pCTag1],tagmr);
						TagDD[x] = Create3DTextLabel(szMessage, 0xFFFFFFFF, 0.0, 0.0, 0.0, 50.0, 0, 1);
						Attach3DTextLabelToPlayer(TagDD[x], x, 0.0, 0.0, 0.5);
						InTag[x] = 1;
			        }
			        case 2:
			        {
			        	if(!strcmp(PlayerInfo[x][pTag2], "(null)", true))
						{
							InTag[x] = 0;
							PlayerInfo[x][pSTag] = 0;
							return 1;
						}
						strmid(tagmr, PlayerInfo[x][pTag2], 0, strlen(PlayerInfo[x][pTag2]), 255);
						format(szMessage, sizeof(szMessage), "{%s}%s", PlayerInfo[x][pCTag2],tagmr);
						TagDD[x] = Create3DTextLabel(szMessage, 0xFFFFFFFF, 0.0, 0.0, 0.0, 50.0, 0, 1);
						Attach3DTextLabelToPlayer(TagDD[x], x, 0.0, 0.0, 0.5);
						InTag[x] = 1;
			        }
			        case 3:
			        {
			        	if(!strcmp(PlayerInfo[x][pTag3], "(null)", true))
						{
							InTag[x] = 0;
							PlayerInfo[x][pSTag] = 0;
							return 1;
						}
						strmid(tagmr, PlayerInfo[x][pTag3], 0, strlen(PlayerInfo[x][pTag3]), 255);
						format(szMessage, sizeof(szMessage), "{%s}%s", PlayerInfo[x][pCTag3],tagmr);
						TagDD[x] = Create3DTextLabel(szMessage, 0xFFFFFFFF, 0.0, 0.0, 0.0, 50.0, 0, 1);
						Attach3DTextLabelToPlayer(TagDD[x], x, 0.0, 0.0, 0.5);
						InTag[x] = 1;
			        }
			        case 4:
			        {
						if(PlayerInfo[x][pVIP] == 1)
						{
							format(tagmr, sizeof(tagmr), "{A4A4A4}Silver Member");
						}
						else if(PlayerInfo[x][pVIP] == 2)
						{
							format(tagmr, sizeof(tagmr), "{F7FE2E}Gold Member");
						}
						else if(PlayerInfo[x][pVIP] == 3)
						{
							format(tagmr, sizeof(tagmr), "{0080FF}Platinum Member");
						}
						else if(PlayerInfo[x][pVIP] == 4)
						{
							format(tagmr, sizeof(tagmr), "{FA58D0}Premium Member");
						}
						else
						{
							InTag[x] = 0;
							PlayerInfo[x][pSTag] = 0;
							return 1;
						}
						InTag[x] = 1;
						TagDD[x] = Create3DTextLabel(tagmr, 0xFFFFFFFF, 0.0, 0.0, 0.0, 50.0, 0, 1);
						Attach3DTextLabelToPlayer(TagDD[x], x, 0.0, 0.0, 0.5);
                    }
				}
			}

			if(PlayerInfo[x][pSpectating] != INVALID_PLAYER_ID) { // OnPlayerInteriorChange doesn't work properly when spectating.
				if(GetPlayerInterior(x) != GetPlayerInterior(PlayerInfo[x][pSpectating])){
					SetPlayerInterior(x, GetPlayerInterior(PlayerInfo[x][pSpectating]));
				}
				if(GetPlayerVirtualWorld(x) != GetPlayerVirtualWorld(PlayerInfo[x][pSpectating])){
					SetPlayerVirtualWorld(x, GetPlayerVirtualWorld(PlayerInfo[x][pSpectating]));
				}
			}
            if(PlayerInfo[x][pBackup] != -1) {
                if(IsPlayerConnectedEx(PlayerInfo[x][pBackup])) {
                    GetPlayerPos(PlayerInfo[x][pBackup], PlayerInfo[PlayerInfo[x][pBackup]][pPos][0], PlayerInfo[PlayerInfo[x][pBackup]][pPos][1], PlayerInfo[PlayerInfo[x][pBackup]][pPos][2]);
                    SetPlayerCheckpoint(x, PlayerInfo[PlayerInfo[x][pBackup]][pPos][0], PlayerInfo[PlayerInfo[x][pBackup]][pPos][1], PlayerInfo[PlayerInfo[x][pBackup]][pPos][2], 10.0);
                }
                else {
                    PlayerInfo[x][pBackup] = -1;
					PlayerInfo[x][pCheckpoint] = 0;

                    SendClientMessage(x, COLOR_GREY, "јЩйаЕи№·ХиўНЎУЕС§аКГФБдґйµСґўТґЁТЎа«ФїаЗНГм");
                    DisablePlayerCheckpoint(x);
                }
            }
			if(PlayerInfo[x][pDrag] != -1) { // Considering how slow SetSafePlayerPos works in practice, using a 1000ms timer in lieu of OnPlayerUpdate (the old script) is a better idea.
				if(IsPlayerConnectedEx(PlayerInfo[x][pDrag])) {
					switch(GetPlayerState(PlayerInfo[x][pDrag])) { // If they're not on foot, they're not gonna be dragging anything...
						case 1: { // on foot
							GetPlayerPos(PlayerInfo[x][pDrag], PlayerInfo[x][pPos][0], PlayerInfo[x][pPos][1], PlayerInfo[x][pPos][2]);
							SetSafePlayerPos(x, PlayerInfo[x][pPos][0], PlayerInfo[x][pPos][1], PlayerInfo[x][pPos][2]);

							SetPlayerVirtualWorld(x, GetPlayerVirtualWorld(PlayerInfo[x][pDrag]));
							SetPlayerInterior(x, GetPlayerInterior(PlayerInfo[x][pDrag]));
						}
						case 2, 3: {
							SendClientMessage(PlayerInfo[x][pDrag], COLOR_GREY, "¤ШідБиКТБТГ¶ўЦй№Г¶дґйЛТЎЎУЕС§ЕТЎг¤ГєТ§¤№ (гЄй /detain)");
							RemovePlayerFromVehicleEx(PlayerInfo[x][pDrag]);
						}
						case 7: { // Death
							SendClientMessage(x, COLOR_WHITE, "јЩйаЕ蹤№·Хи¤ШіЕТЎаКХВЄХЗФµбЕйЗ");
							PlayerInfo[x][pDrag] = -1;
						}
					}
				}
				else {

					SendClientMessage(x, COLOR_WHITE, "јЩйаЕ蹤№·Хи¤ШіЕТЎµСґўТґЎСєа«ФїаЗНГм");
					PlayerInfo[x][pDrag] = -1; // Kills off any disconnections.
				}
			}
			if(PlayerDrunk[x] >= 10)
			{
			    PlayerDrunkTime[x] += 1;
			    if(PlayerDrunkTime[x] == 8)
			    {
					new Drunk = GetPlayerDrunkLevel(x);
					Drunk += 5000;
			        SetPlayerDrunkLevel(x,Drunk);
			        PlayerDrunkTime[x] = 0;
			        new Float:angle;
					GetPlayerFacingAngle(x, angle);
					if(IsPlayerInAnyVehicle(x))
					{
					    if(GetPlayerState(x) == 2)
					    {
					    	SetVehicleZAngle(GetPlayerVehicleID(x), angle + 25);
						}
					}
					else
					{
					    ApplyAnimation(x,"PED", "WALK_DRUNK",4.0,0,1,0,0,0);
					}
			    }
			}
			if(PlayerInfo[x][pMatrunTime] >= 1) {
				PlayerInfo[x][pMatrunTime]++;
			}

	        if(PlayerInfo[x][pJobDelay] >= 1) {
	   	    	PlayerInfo[x][pJobDelay]--;
				if(PlayerInfo[x][pJobDelay] == 0) SendClientMessage(x, COLOR_WHITE, "аЗЕТвЛЕґўН§НТЄХѕўН§¤ШіЛБґЕ§бЕйЗ");
	        }

	        if(PlayerInfo[x][pNewbieTimeout] > 0) {
	            PlayerInfo[x][pNewbieTimeout]--;
	            if(PlayerInfo[x][pNewbieTimeout] == 0) SendClientMessage(x, COLOR_WHITE, "¤ШіКТБТГ¶гЄйЄиН§·Т§ Newbie дґйНХЎ¤ГСй§");
	        }

			if(PlayerInfo[x][pHackWarnings] >= 1 && IsPlayerESC[x] == 3) {
				PlayerInfo[x][pHackWarnTime]++;

				if(PlayerInfo[x][pHackWarnTime] >= 10) {
					PlayerInfo[x][pHackWarnings] = 0;
					PlayerInfo[x][pHackWarnTime] = 0;
				}
			}
			if(PlayerInfo[x][pDropCarTimeout] >= 1) {
                PlayerInfo[x][pDropCarTimeout]--;
                if(PlayerInfo[x][pDropCarTimeout] == 1) {
                    PlayerInfo[x][pDropCarTimeout] = 0;
                    SendClientMessage(x, COLOR_WHITE, "¤ШіКТБТГ¶ґГН»Г¶дґйНХЎ¤ГСй§");
				}
			}

			if(GetPVarInt(x, "tutTime") > 0) {
			    SetPVarInt(x, "tutTime", GetPVarInt(x, "tutTime")-1);
			    if(GetPVarInt(x, "tutTime") == 0) {
			        TextDrawHideForPlayer(x, textdrawVariables[8]);
			        TextDrawShowForPlayer(x, textdrawVariables[7]);
			    }
			}
			if(PlayerInfo[x][pHospitalized] >= 2) {
				GetPlayerHealth(x, PlayerInfo[x][pHealth]);
			    if(PlayerInfo[x][pVIP])
			    {
					switch(PlayerInfo[x][pVIP])
					{
					    case 1:
					    {
			                SetSafePlayerHealth(x, PlayerInfo[x][pHealth]+10);
					    }
					    case 2:
					    {
			                SetSafePlayerHealth(x, PlayerInfo[x][pHealth]+12);
					    }
					    case 3:
					    {
			                SetSafePlayerHealth(x, PlayerInfo[x][pHealth]+14);
					    }
					    case 4:
					    {
			                SetSafePlayerHealth(x, PlayerInfo[x][pHealth]+16);
					    }
	                }
                }
                SetSafePlayerHealth(x, PlayerInfo[x][pHealth]+7.5);
                if(PlayerInfo[x][pDie] > 0)
                {
            		PlayerInfo[x][pDie] = 0;
                }
				PlayerInfo[x][pHospitalized]++;


                if(PlayerInfo[x][pHealth]+10 >= 100) {

					switch(PlayerInfo[x][pVIP])
					{
						case 1:
						{
				            SetSafePlayerHealth(x, 65);
						}
						case 2:
						{
				            SetSafePlayerHealth(x, 75);
						}
						case 3:
						{
				          	SetSafePlayerHealth(x, 85);
						}
						case 4:
						{
				    		SetSafePlayerHealth(x, 100);
						}
						default:
						{
							SetSafePlayerHealth(x, 50);
						}
		         	}
                    PlayerInfo[x][pHospitalized] = 0;

                    switch(GetPVarInt(x, "hosp")) {
                   	 	case 1: {
	                        PlayerInfo[x][pPos][0] = 1172.359985;
							PlayerInfo[x][pPos][1] = -1323.313110;
							PlayerInfo[x][pPos][2] = 15.402919;
							PlayerInfo[x][pHealth] = 75;
							PlayerInfo[x][pArmour] = 0;
							PlayerInfo[x][pVirtualWorld] = 0;
							PlayerInfo[x][pInterior] = 0;
	                        SetSpawnInfo(x, 0, PlayerInfo[x][pSkin], 1172.359985, -1323.313110, 15.402919, 0, 0, 0, 0, 0, 0, 0);
	                        SpawnPlayer(x);
	                        SendClientMessage(x, COLOR_LIGHTRED, "¤ШідґйННЎЁТЎвГ§ѕВТєТЕ");
	                        format(szMessage, sizeof(szMessage), "бЕРаКХВа§Ф№ %d$ КУЛГСє·ХиѕСЎбЕРНТЗШёўН§¤Ші¶ЩЎВЦґ", 10*PlayerInfo[x][pLevel]);
	                        SendClientMessage(x, COLOR_LIGHTRED, szMessage);
	                        PlayerInfo[x][pMoney] -= 10*PlayerInfo[x][pLevel];
	                        //validResetPlayerWeapons(x);
	                        DeletePVar(x, "hosp");
                        }
                        case 2: {
	                        PlayerInfo[x][pPos][0] = 2034.196166;
							PlayerInfo[x][pPos][1] = -1402.591430;
							PlayerInfo[x][pPos][2] = 17.295030;
							PlayerInfo[x][pHealth] = 75;
							PlayerInfo[x][pArmour] = 0;
							PlayerInfo[x][pVirtualWorld] = 0;
							PlayerInfo[x][pInterior] = 0;
	                        SetSpawnInfo(x, 0, PlayerInfo[x][pSkin], 2034.196166, -1402.591430, 17.295030, 0, 0, 0, 0, 0, 0, 0);
	                        SpawnPlayer(x);
	                        SendClientMessage(x, COLOR_LIGHTRED, "¤ШідґйННЎЁТЎвГ§ѕВТєТЕ");
	                        format(szMessage, sizeof(szMessage), "бЕРаКХВа§Ф№ %d$ КУЛГСє·ХиѕСЎбЕРНТЗШёўН§¤Ші¶ЩЎВЦґ", 10*PlayerInfo[x][pLevel]);
	                        SendClientMessage(x, COLOR_LIGHTRED, szMessage);
	                        PlayerInfo[x][pMoney] -= 10*PlayerInfo[x][pLevel];
	                        //validResetPlayerWeapons(x);
	                        SetSafePlayerPos(x, 2034.196166, -1402.591430, 17.295030);
	                        DeletePVar(x, "hosp");
                        }
                    }
				}
			}
	}
	foreach(new x: Player)
	{
			if(PlayerInfo[x][pSkinSet] >= 1) {
			    PlayerInfo[x][pSkinSet]++;
			    if(PlayerInfo[x][pSkinSet] == 3 && GetPlayerSkin(x) != PlayerInfo[x][pSkin]) {
					SetPlayerSkin(x, PlayerInfo[x][pSkin]); // Set the skin first.
				}
				if(PlayerInfo[x][pSkinSet] == 4) {
                    //giveSaveWP(x); // Then give the player their weapons. Seems like a SA-MP bug? Pain in the arse might I add!
                    PlayerInfo[x][pSkinSet] = 0;
					TogglePlayerControllable(x, true);
				}
			}

			if(PlayerInfo[x][pFreezeTime] != 0) {
				TogglePlayerControllable(x, 0);
				if(PlayerInfo[x][pFreezeType] == 5)
					ApplyAnimation(x, "FAT", "IDLE_TIRED", 4.1, 1, 1, 1, 1, 0, 1);

				if(PlayerInfo[x][pFreezeTime] > 0) {
					PlayerInfo[x][pFreezeTime]--;
					if(PlayerInfo[x][pFreezeTime] == 0) {
						if(PlayerInfo[x][pFreezeType] == 5) {
							SetPlayerDrunkLevel(x, 0);
							ClearAnimations(x);
						}
						PlayerInfo[x][pFreezeType] = 0;
						TogglePlayerControllable(x, true);
					}
				}

			}

			if(PlayerInfo[x][pPrisonID] > 0) {
			    if(PlayerInfo[x][pPrisonUse] >= 0)
				{
                	PlayerInfo[x][pPrisonTime]--;
				}
                switch(PlayerInfo[x][pPrisonID]) {
					case 1: {
						format(szMessage, sizeof(szMessage), "~n~~n~~n~~n~~n~~n~~n~ ~r~Prisoned!~n~~w~%d seconds (%d minutes) left", PlayerInfo[x][pPrisonTime], PlayerInfo[x][pPrisonTime]/60);
					}
					case 2, 3: { // We're going to be using 3 for IC jail, so... yeah
						format(szMessage, sizeof(szMessage), "~n~~n~~n~~n~~n~~n~~n~ ~r~Jailed!~n~~w~%d seconds (%d minutes) left", PlayerInfo[x][pPrisonTime], PlayerInfo[x][pPrisonTime]/60);
					}
				}

				GameTextForPlayer(x, szMessage, 2000, 3); // Always specify the game text time longer than the intended time; it always fades out before it should, causing an annoying flash.

                if(PlayerInfo[x][pPrisonTime] == 1 && PlayerInfo[x][pPrisonID] >= 1) {
                    PlayerInfo[x][pPrisonID] = 0;
                    SetPlayerWantedLevel(x, 0);
                    PlayerInfo[x][pPrisonTime] = 0;
                    if(PlayerInfo[x][pPrisonUse] >= 0)
                    {
					   	format(szMessage, sizeof(szMessage), "ЛйН§ўС§·Хи %d (ЗиТ§)\n(ЕзН¤)", PlayerInfo[x][pPrisonUse]);
						UpdateDynamic3DTextLabelText(JailInfo[PlayerInfo[x][pPrisonUse]][jaLabelID], COLOR_YELLOW, szMessage);
                        JailInfo[PlayerInfo[x][pPrisonUse]][jaLock] = 1;
                    	format(JailInfo[PlayerInfo[x][pPrisonUse]][jaOwner], MAX_PLAYER_NAME, "Nobody");
                      	PlayerInfo[x][pPrisonUse] = -1;
					}
					SendClientMessage(x, COLOR_WHITE, "аЗЕТ¤ШіЛБґбЕйЗ! ¤Ші¶ЩЎ»ЕиНВµСЗННЎЁТЎ¤ШЎ/аГЧН№ЁУ");
					SetSafePlayerPos(x, 1543.1656,-1675.5603,13.5559);
					SetPlayerVirtualWorld(x, 0);
					SetPlayerInterior(x, 0);
					SetPlayerSkin(x, PlayerInfo[x][pBuySkin]);
				}
			}

			if(PlayerInfo[x][pSpamCount] >= 1)
				PlayerInfo[x][pSpamCount]--;

			if(PlayerInfo[x][pSpamCount] >= 5 && PlayerInfo[x][pAdminLevel] == 0) {
			    PlayerInfo[x][pMuted] = 10;
			    PlayerInfo[x][pSpamCount] = 0;
			    SendClientMessage(x, COLOR_GREY, "¤Ші¶ЩЎгєйвґВНСµв№БСµФа№ЧиН§ЁТЎ·УЎТГ Spam бЕРЁР¶ЩЎВЎаЕФЎг№ 10 ЗФ№Т·Х");
			}

		    if(PlayerInfo[x][pSeconds] >= 3600) {

		        PlayerInfo[x][pSeconds] = 0;
		        PlayerInfo[x][pPlayingHours]++;
		        PlayerInfo[x][pExp] ++;

		        new
		            BankInterest,
		            RandPay = ((PlayerInfo[x][pPlayingHours]*PlayerInfo[x][pPlayingHours]/20)) * PlayerInfo[x][pLevel]/2,
					TotalPay = BankInterest + RandPay;


				switch(PlayerInfo[x][pVIP])
				{
					case 1:
					{
			            BankInterest = PlayerInfo[x][pBankMoney] / 950;
					}
					case 2:
					{
			            BankInterest = PlayerInfo[x][pBankMoney] / 900;
					}
					case 3:
					{
			          	BankInterest = PlayerInfo[x][pBankMoney] / 850;
					}
					case 4:
					{
			    		BankInterest = PlayerInfo[x][pBankMoney] / 800;
					}
					default:
					{
						BankInterest = PlayerInfo[x][pBankMoney] / 1000;
					}
	         	}

				new nxtlevel = PlayerInfo[x][pLevel]+1;
				new expamount = nxtlevel*4;


				if(PlayerInfo[x][pBankMoney]+PlayerInfo[x][pMoney] > -5000000) {
		            SendClientMessage(x, COLOR_TEAL, "----------------------------------------------------------------------------");
					SendClientMessage(x, COLOR_WHITE, "¶Ц§аЗЕТ paycheck ўН§¤ШібЕйЗ; д»·Хиё№Т¤ТГаѕЧиНаєФЎа§Ф№ўН§¤Ші");
					PlayerInfo[x][pBankMoney] += TotalPay;
                    new taxamount = ((TotalPay/100) * assetVariables[1][aAssetValue]);
                    if(taxamount > 1) {
                        PlayerInfo[x][pBankMoney] -= taxamount;
                        groupVariables[GOVERNMENT_GROUP_ID][gSafe][0] += taxamount;
                        saveGroup(GOVERNMENT_GROUP_ID);
                    }
					format(szMessage, sizeof(szMessage), "Paycheck: $%d | ВНґа§Ф№г№ё№Т¤ТГ: $%d | ґНЎаєХйВё№Т¤ТГ: $%d | АТЙХ: $%d (%d а»НГма«з№µм) | ГЗБа§Ф№·Хидґй: $%d", RandPay, PlayerInfo[x][pBankMoney], BankInterest, taxamount, assetVariables[1][aAssetValue], TotalPay-taxamount);
		            SendClientMessage(x, COLOR_GREY, szMessage);
		            SendClientMessage(x, COLOR_TEAL, "----------------------------------------------------------------------------");

		            savePlayerData(x);

					if(PlayerInfo[x][pExp] >= expamount)
					{
						format(szMessage, sizeof(szMessage), "   ¤ШіБХ¤иТ»ГРКєЎТГім %d/%d бЕйЗКТБТГ¶ /buylevel аѕЧиНаѕФиБаЕаЗЕўН§¤Ші",PlayerInfo[x][pExp],expamount);
						SendClientMessage(x, COLOR_GREY, szMessage);
					}
					if(RentCarKey[x] > 0 && doesVehicleExist(RentCarKey[x]))
					{
					    if(PlayerInfo[x][pMoney] < 35)
					    {
					        DestroyVehicle(RentCarKey[x]);
					        RentCarKey[x] = -1;
					        RentCarLock[x] = 0;
					    }
					    else
					    {
					    	PlayerInfo[x][pMoney] -= 35;
					    	SendClientMessage(x, COLOR_LIGHTBLUE, "¤Ші¶ЩЎаГХВєаЎзє¤иТаЄиТ Taxi 35$");

					    }
					}
					if(PlayerInfo[x][pVIP] > 0)
					{
						PlayerInfo[x][pCoin]++;
						format(szMessage,sizeof(szMessage),"¤ШідґйГСєаЛГХВ*⤹ +1 ⤹㹻ѨЁШєС№¤ЧН %d",PlayerInfo[x][pCoin]);
						SendClientMessage(x, COLOR_LIGHTBLUE, szMessage);
					}

				}
				else {
				    SendClientMessage(x, COLOR_WHITE, "¤ШіаЕи№дБи№Т№ѕН·ХиЁРдґйГСє Paycheck");
				}
		    }

		    if(GetPlayerMoney(x) != PlayerInfo[x][pMoney]) {
				ResetPlayerMoney(x);
				GivePlayerMoney(x, PlayerInfo[x][pMoney]);
			}
	   // }
	}

	return true;
}
Reply
#7

T T I'm tried
Reply
#8

Plss help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)