SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 10/06/2019, 04:26 PM   #1
GnT
Little Clucker
 
Join Date: Oct 2017
Posts: 38
Reputation: 0
Smile Public problem

Hello everyone!

I would like to tell me if there is something wrong with this script. In error_log, appears this
Code:
[19:06:54] OnPlayerKeyStateChange (71)
and then
Code:
[19:06:57] [connection] 109.103.134.115:59094 requests connection cookie.
[19:06:58] [connection] incoming connection: IP:PORT id: 1
[19:06:59] The packet was modified, sent by id: 4, ip: IP:PORT 
[19:06:59] The packet was modified, sent by id: 4, ip: IP:PORT 
[19:06:59] The packet was modified, sent by id: 4, ip: IP:PORT
Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	print("OnPlayerKeyStateChange(2)");
	if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED) ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
	print("OnPlayerKeyStateChange(3)");
   	if(newkeys & KEY_FIRE || newkeys & KEY_AIM) {
		new weapon = GetPlayerWeapon(playerid), slot = GetWeaponSlot(weapon);
 		if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && WeaponData[playerid][slot] == false && slot != 0 && weapon != 46  && GetPlayerWeapon(playerid) != 9 && curatj[playerid] == 0) { 
            ResetPlayerWeaponsEx(playerid);
		    new gunname[25],string[128];
		    GetWeaponNameEx(weapon,gunname,sizeof(gunname));
		    format(string, sizeof(string), "AdmCmd: %s was kicked by AdmBot, reason: weapon cheats (weapon %d, %s)", GetName(playerid), GetPlayerWeapon(playerid), gunname);
		    SendClientMessageToAll(COLOR_LIGHTRED, string);
		    KickEx(playerid);
		    print("kick weapon cheats");
		    return 1;
	    }
    }
	print("OnPlayerKeyStateChange(4)");
    if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
		print("OnPlayerKeyStateChange(5)");
    	new newcar = GetClosestVehicle2(playerid, 100);
   		if(IsABoat(newcar)) {
		    if(PlayerInfo[playerid][pBoatLic] < 1) {
                if(TakingLesson[playerid] == 2) { }
                else {
			    	SendClientMessage(playerid,COLOR_GREY, "You don't have a boat license.");
			    	ClearAnimations(playerid); 
				}
				print("isaboat");
			}
		}
		print("OnPlayerKeyStateChange(6)");
		if(IsAPlane(newcar)) {
		    if(PlayerInfo[playerid][pFlyLic] < 1) {
			    if(TakingLesson[playerid] == 2) { }
			    else {
			    	SendClientMessage(playerid, COLOR_GREY, "You don't have a flying license.");
			    	ClearAnimations(playerid); 
				}
				print("isaplane");
			}
		}
		print("OnPlayerKeyStateChange(7)");
		if(GetVehicleModel(newcar) >= 400 && GetVehicleModel(newcar) <= 611) {
			if(PlayerInfo[playerid][pCarLic] < 1) {
			    if(IsABike(newcar) || IsAPlane(newcar) || GetVehicleModel(newcar) == 462) { }
			    else
			    {
					if(TakingLesson[playerid] == 1) { }
					else {
				 		SendClientMessage(playerid,COLOR_GREY, "You don't have a driving license.");
                    	ClearAnimations(playerid);
				  	}
					print("driving license");
				}
			}
		}
		print("OnPlayerKeyStateChange(8)");
		for(new x = 0; x < sizeof(VehicleInfo); x++)
		{
			if(VehicleInfo[x][vehCarID] == newcar)
			{
				if(VehicleInfo[x][vehGroup] != 0 && VehicleInfo[x][vehGroup] != 30 && VehicleInfo[x][vehGroup] != 8 && VehicleInfo[x][vehGroup] != 2 && VehicleInfo[x][vehGroup] != 3 && VehicleInfo[x][vehGroup] != 1)
				{
					if(PlayerInfo[playerid][pMember] == VehicleInfo[x][vehGroup]) { }
					else
					{
						if(AdminDuty[playerid] == 1) { }
						else
						{
							ClearAnimations(playerid);
							new strr[80];
							format(strr,sizeof(strr),"Aceasta masina poate fi condusa doar de membrii %s.",DynamicFactions[VehicleInfo[x][vehGroup]][fName]);
							SendClientMessage(playerid, COLOR_GREY, strr);
						}
					}
					print("OnPlayerKeyStateChange(9)");
				}
			}
		}
		print("OnPlayerKeyStateChange(10)");
		if(IsACopCar(newcar)) {
		    if(IsACop(playerid)) { }
		    else { ClearAnimations(playerid); SendClientMessage(playerid,COLOR_GREY, "Aceasta masina poate fi condusa doar de membrii Los Santos Police Department."); }
		}
		print("OnPlayerKeyStateChange(11)");
		if(IsAFbiCar(newcar)) {
		    if(IsACop(playerid)) { }
		    else { ClearAnimations(playerid); SendClientMessage(playerid,COLOR_GREY, "Aceasta masina poate fi condusa doar de membrii Federal Bureau of Investigations."); }
		}
		print("OnPlayerKeyStateChange(12)");
		if(IsALVPDCar(newcar)) {
		    if(IsACop(playerid)) { }
		    else { ClearAnimations(playerid); SendClientMessage(playerid,COLOR_GREY, "Aceasta masina poate fi condusa doar de membrii Las Venturas Police Department."); }
		}
		print("OnPlayerKeyStateChange(13)");
		if(IsANgCar(newcar)) {
		    if(IsACop(playerid)) { }
		    else { ClearAnimations(playerid); SendClientMessage(playerid,COLOR_GREY, "Aceasta masina poate fi condusa doar de membrii National Guard."); }
		}
		print("OnPlayerKeyStateChange(14)");
   	}
    if(IsACBUGWeapon(playerid) && RELEASED(KEY_FIRE) && newkeys != KEY_FIRE && newkeys & KEY_CROUCH) ApplyAnimation(playerid, "PED", "getup", 4.1, 0, 0, 0, 0, 0);
    print("OnPlayerKeyStateChange(15)");
  	if(newkeys & KEY_WALK) {
  		print("OnPlayerKeyStateChange(16)");
  		if(PlayerInfo[playerid][pJob] == 15) {
			new hbID = GetBeeHiveID(playerid), stringx[128], ExtratedHoney;
			if(hbID == -1) return 1;
			if(MiereRamasa[hbID] == 0 ) return SendClientMessage( playerid, COLOR_CYAN, "(Job){FFFFFF}: Acest stup nu mai are miere.");
			if(MiereColectata[playerid ] == 2 ) return SendClientMessage( playerid, COLOR_CYAN, "(Job){FFFFFF}: Trebuie sa duci mierea la depozit.");
			MiereRamasa[hbID] = 0;
			ExtratedHoney = 60 + random(70);
			Miere[playerid] += ExtratedHoney;
			format(stringx, sizeof(stringx), "(Job){FFFFFF}: Ai extras %s ml de miere din acest stup. (total: %s)", FormatNumber(ExtratedHoney), FormatNumber(Miere[playerid]));
			SCM(playerid, COLOR_CYAN, stringx);
			ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0,0,1,1,0,2500,1);
			SetTimerEx("StopHiving", 2500, false, "i", playerid);
			Update3DTextLabelText(BeeHive3DText[hbID], COLOR_WHITE, "This beehive has no honey\nRefilling in 10 seconds");
			SetTimerEx("RefillBeeHive", 1000*10, false, "d", hbID);
			if(Miere[playerid] > 999) {
			   MiereColectata[playerid ] = 2;
			   SendClientMessage(playerid, COLOR_CYAN, "(Job){FFFFFF}: Ai terminat de colectat mierea. Du-te si transporta mierea la depozit.");
			   return 1;
			}
			print("OnPlayerKeyStateChange(17)");
  		}
   	}
   	print("OnPlayerKeyStateChange(18)");
   	if(newkeys & KEY_WALK) {
   		print("OnPlayerKeyStateChange(19)");
   		if(PlayerInfo[playerid][pAdmin] >= 1) {
		  	if(Spectate[playerid] != -1) {
				TogglePlayerControllable(playerid, 1);
				TogglePlayerSpectating(playerid, 0);
				SetPlayerInterior(playerid,Unspec[playerid][sPint]);
				PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
				PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
				Unspec[playerid][sLocal] = -1;
				gTeam[playerid] = PlayerInfo[playerid][pTeam];
				SetPlayerToTeamColor(playerid);
		    	PlayerTextDrawHide(playerid, TextDrawSpec[playerid][1]);
		    	PlayerTextDrawHide(playerid, TextDrawSpec[playerid][2]);
				PlayerTextDrawHide(playerid, TextDrawSpec[playerid][3]);
		    	PlayerTextDrawHide(playerid, TextDrawSpec[playerid][4]);
				Spectate[playerid] = -1;
				SCM(playerid, COLOR_WHITE, "You have been teleported to the last known location (before spectacting).");
				print("OnPlayerKeyStateChange(20)");
			} 			
   		}
   	}
   	if(newkeys & KEY_ACTION) {
   		print("OnPlayerKeyStateChange(21)");
	  	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
	  		new veh = GetPlayerVehicleID(playerid), engine,lights,alarm,doors,bonnet,boot,objective;
	  		print("OnPlayerKeyStateChange(22)");
         	if(GetPVarInt(playerid, "Lights") == 0) {
			 	GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
			 	SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
			 	SetPVarInt(playerid, "Lights", 1);
			 	print("OnPlayerKeyStateChange(23)");
         	}
         	else if(GetPVarInt(playerid, "Lights") == 1) {
				GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
			 	SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
			 	SetPVarInt(playerid, "Lights", 0);
			 	print("OnPlayerKeyStateChange(24)");
         	}
         	if(PlayerInfo[playerid][pRaceJoined] != 0) {
            	RepairVehicle(veh);
            	SCM(playerid, COLOR_CYAN, "(Race Arena){FFFFFF}: Your vehicle was repaired succesfully.");
            	PlayerPlaySound( playerid, 1133, 0.0, 0.0, 0.0 ); 
			 	print("OnPlayerKeyStateChange(25)");                  
         	}
      	}
      	return 1;
   	}	
  	if(newkeys & KEY_ANALOG_UP) {
		print("OnPlayerKeyStateChange(26)");
      	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
      		new veh = GetPlayerVehicleID(playerid), engine,lights,alarm,doors,bonnet,boot,objective;
         	if(GetPVarInt(playerid, "Bonnet") == 0) {
			 	print("OnPlayerKeyStateChange(28)");
			 	GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
			 	SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
			 	SetPVarInt(playerid, "Bonnet", 1);
         	}
         	else if(GetPVarInt(playerid, "Bonnet") == 1) {
			 	print("OnPlayerKeyStateChange(29)");
			 	GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
			 	SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
			 	SetPVarInt(playerid, "Bonnet", 0);
         	}
      	}
      	return 1;
   	}
    if(newkeys & KEY_ANALOG_DOWN) {
		print("OnPlayerKeyStateChange(30)");
      	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
      		new veh = GetPlayerVehicleID(playerid), engine,lights,alarm,doors,bonnet,boot,objective;
         	if(GetPVarInt(playerid, "Boot") == 0) {
			 	print("OnPlayerKeyStateChange(32)");
			 	GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
			 	SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
			 	SetPVarInt(playerid, "Boot", 1);
         	}
         	else if(GetPVarInt(playerid, "Boot") == 1) {
			 	print("OnPlayerKeyStateChange(33)");
			 	GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
			 	SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
			 	SetPVarInt(playerid, "Boot", 0);
         	}
      	}
      	return 1;
   	}
   	if(newkeys & KEY_FIRE) {
		print("OnPlayerKeyStateChange(34)");
   		if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
   			new veh = GetPlayerVehicleID(playerid);
			print("OnPlayerKeyStateChange(35)");
	       	if(PlayerInfo[playerid][pAdmin] >= 5) {
			 	print("OnPlayerKeyStateChange(36)");
	           	if(SpeedBoost[playerid] == 1) {
			 		print("OnPlayerKeyStateChange(37)");
	               	new Float:vx, Float:vy, Float:vz;
	               	GetVehicleVelocity(veh, vx, vy, vz);
	               	SetVehicleVelocity(veh, vx * 1.8, vy *1.8, vz * 1.8);
	            }
	        }
	       	if(PlayerInfo[playerid][pAdmin] >= 4) {
	           	if(SpeedBoostt[playerid] == 1) {
	           		print("OnPlayerKeyStateChange(38)");
	               	new Float:vx, Float:vy, Float:vz;
	               	GetVehicleVelocity(veh, vx, vy, vz);
	               	SetVehicleVelocity(veh, vx * 1.8, vy *1.8, vz * 1.8);
	            }
	        }
         	if(PlayerInfo[playerid][pRaceJoined] != 0) {
            	new Float:angle;
            	print("OnPlayerKeyStateChange(39)");
            	GetVehicleZAngle(veh, angle);
            	SetVehicleZAngle(veh, angle);
            	SendClientMessage(playerid, COLOR_CYAN, "(Race Arena){FFFFFF}: Your vehicle has been flipped back over.");
            	PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);            
         	}
   		}
		if(!IsPlayerInAnyVehicle(playerid)) {
			print("OnPlayerKeyStateChange(40)");
			new wep = GetPlayerWeapon(playerid);
			if((wep > 0 && wep < 43) && IsPlayerInRangeOfPoint(playerid, 100,1799.9652, -1865.2068, 13.5536) && !IsACop(playerid) && GetPlayerVirtualWorld(playerid) < 1) {
	    		SetPlayerArmedWeapon(playerid,0);
				SendClientMessage(playerid, COLOR_RED, "Nu poti folosi armele in zona spawn-ului.");
				print("OnPlayerKeyStateChange(41)");
			}
   		}
   	}
   	print("OnPlayerKeyStateChange(42)");
   	if(newkeys == KEY_CTRL_BACK && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
   		print("OnPlayerKeyStateChange(43)");
		new stringy[600],strings[256],listen[18];
		if(radiotime[playerid] > 0) {
			format(strings, sizeof(strings),"You can use this command in %d seconds.",radiotime[playerid]);
			SendClientMessage(playerid, COLOR_WHITE, strings);
			return 1;
		}
		print("OnPlayerKeyStateChange(44)");
		for(new x = 0; x < 18; x++) {
			foreach(Player, i) {
				if(Listening[i] == x) listen[x]++;
			}
		}
		format(strings, sizeof(strings), "Radio station\tListeners\n{FF0000}Turn Off Radio\t\nPro FM\t%d\nRadio Bandit Romania\t%d\nRadio Taraf Romania\t%d\nRadio Hot Romania\t%d\nRadio Gangsta Dance\t%d\nRadio Gangsta Manele\t%d\n.977 Hitz\t%d\n",listen[0],listen[1],listen[2],listen[3],listen[4],listen[5],listen[6]);
		strcat(stringy, strings);
		format(strings, sizeof(strings), ".977 Mix\t%d\n.977 Alternative\t%d\nRadio BBC One UK\t%d\nDubstep.fm\t%d\nRadio Hit Romania\t%d\nRadio ClubMix Romania\t%d\nKiss FM Romania [Audio Plugin]\t%d\nRadio Zu Romania [Audio Plugin]\t%d\n",listen[7],listen[8],listen[9],listen[10],listen[11],listen[12],listen[13],listen[14]);
		strcat(stringy, strings);
		format(strings, sizeof(strings), "Radio Popular\t%d\nTrap.FM\t%d\nRadio Tequila Hip Hop\t%d",listen[15],listen[16],listen[17]);
        strcat(stringy, strings);
        radiotime[playerid] = 5;			
		ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_TABLIST_HEADERS, "Vehicle Radio", stringy, "Ok", "Cancel");
		print("OnPlayerKeyStateChange(45)");
   	}
   	print("OnPlayerKeyStateChange(46)");
   	if(newkeys == KEY_NO)
   	{
   		print("OnPlayerKeyStateChange(47)");
		new string[32], engine,lights,alarm,doors,bonnet,boot,objective;
		for(new v = 0; v < MAX_PERSONAL_VEHICLES; v++)
		{
   			if(CheckPlayerDistanceToVehicle(5.0, playerid, PlayerInfo[playerid][pCarID][v]))
			{
	 			if(PlayerInfo[playerid][pCarLock][v] == 1)
		  		{
		  			print("OnPlayerKeyStateChange(48)");
   					GetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,doors,bonnet,boot,objective);
	  	    		SetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,0,bonnet,boot,objective);
					format(string, sizeof(string), "~h~%s~n~~g~Unlocked",aVehicleNames[PlayerInfo[playerid][pCarModel][v] - 400]);
					GameTextForPlayer(playerid, string, 5000, 3);
					PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
					PlayerInfo[playerid][pCarLock][v] = 0;
					gCarLock[PlayerInfo[playerid][pCarID][v]] = 0;
					cUpdate(playerid, v, cLockx);
					return 1;
				}
				else
				{
					print("OnPlayerKeyStateChange(49)");
 					GetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,doors,bonnet,boot,objective);
	    			SetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,1,bonnet,boot,objective);
					SetVehicleParamsForPlayer(PlayerInfo[playerid][pCarID][v],playerid,0,0);
					format(string, sizeof(string), "~h~%s~n~~r~Locked",aVehicleNames[PlayerInfo[playerid][pCarModel][v] - 400]);
					GameTextForPlayer(playerid, string, 5000, 3);
					PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
					PlayerInfo[playerid][pCarLock][v] = 1;
					gCarLock[PlayerInfo[playerid][pCarID][v]] = 1;
					cUpdate(playerid, v, cLockx);
     				return 1;
				}
			}
			else if(CheckPlayerDistanceToVehicle(5.0, playerid, HireCar[playerid]))
			{
				new carid = HireCar[playerid];
				if(gCarLock[carid] == 0)
		        {
		        	print("OnPlayerKeyStateChange(50)");
			        new vehicles = GetVehicleModel(carid) - 400;
				    format(string, sizeof(string), "~h~%s~n~~r~Locked", aVehicleNames[vehicles]);
				    GameTextForPlayer(playerid, string, 5000, 3);
		  	        PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
					gCarLock[carid] = 1;
	    			GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
	      	    	SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,1,bonnet,boot,objective);
		            return 1;
			    }
				else if(gCarLock[carid] == 1)
				{
					print("OnPlayerKeyStateChange(51)");
					new vehicles = GetVehicleModel(carid) - 400;
					format(string, sizeof(string), "~h~%s~n~~g~Unlocked", aVehicleNames[vehicles]);
				    GameTextForPlayer(playerid, string, 5000, 3);
					PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
					gCarLock[carid] = 0;
	    			GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
	      	    	SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,0,bonnet,boot,objective);
		            return 1;
				}
			}
			else if(CheckPlayerDistanceToVehicle(5.0, playerid, RentCar[playerid]))
			{
				new carid = RentCar[playerid];
				if(gCarLock[carid] == 0)
		        {
		        	print("OnPlayerKeyStateChange(52)");
				    GameTextForPlayer(playerid, "~h~rentcar~n~~r~locked", 5000, 3);
		  	        PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
					gCarLock[carid] = 1;
	    			GetVehicleParamsEx(RentCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
	      	    	SetVehicleParamsEx(RentCar[playerid],engine,lights,alarm,1,bonnet,boot,objective);
		            return 1;
			    }
				else if(gCarLock[carid] == 1)
				{
					print("OnPlayerKeyStateChange(53)");
				    GameTextForPlayer(playerid, "~h~rentcar~n~~g~unlocked", 5000, 3);
					PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
					gCarLock[carid] = 0;
	    			GetVehicleParamsEx(RentCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
	      	    	SetVehicleParamsEx(RentCar[playerid],engine,lights,alarm,0,bonnet,boot,objective);
		            return 1;
				}
			}
	   	}
   	}
   	print("OnPlayerKeyStateChange(54)");
   	if(newkeys & KEY_YES) {
   		print("OnPlayerKeyStateChange(55)");
   		if(IsPlayerInRangeOfPoint(playerid, 3.0, 70.0492, -1579.7776, 7.0556)) {
   			MoveDynamicObject(usacome1, 74.1729, -1579.6355, 4.6969, 5, -1000.0, -1000.0, -1000.0);
   			SetTimer("usacome1close", 5000, false);
   			print("OnPlayerKeyStateChange(56)");
   			return 1;
   		}
   		else if(IsPlayerInRangeOfPoint(playerid, 3.0, 77.7822, -1579.4537, 7.0556)) {
    		MoveDynamicObject(usacome1, 74.1729, -1579.6355, 4.6969, 5, -1000.0, -1000.0, -1000.0);
   			SetTimer("usacome1close", 5000, false);
   			print("OnPlayerKeyStateChange(57)");
   			return 1;  			
   		}
   	}
   	if(newkeys & KEY_CROUCH) {
   		print("OnPlayerKeyStateChange(58)");
       	if(IsACop(playerid)) {
       		if(IsPlayerInRangeOfPoint(playerid, 15.0, 1588.6552, -1637.9025, 15.0358)) {
               	MoveObject(gatelspd,1592.65674, -1638.05286, 9.89110,2, -1000.0, -1000.0, -1000.0);
               	SetTimer("lspdgateclose" ,9000 ,false);
               	print("OnPlayerKeyStateChange(59)");
               	return 1;
           	}
           	else if(IsPlayerInRangeOfPoint(playerid, 15.0, 2334.8999000, 2444.3999000, 8.3000000)) {
               	MoveDynamicObject(gatelvpd,2339.3000000, 2450.5000000, 8.3000000,2, -1000.0, -1000.0, -1000.0);
               	SetTimer("lvpdgateclose" ,9000 ,false);
               	print("OnPlayerKeyStateChange(60)");
               	return 1;
           	}
           	else if(IsPlayerInRangeOfPoint(playerid, 15.0, 2295.3000000, 2507.0000000, 5.7000000)) {
               	MoveDynamicObject(gatelvpd2,2295.3000000, 2507.0000000, 5.7000000,2, -1000.0, -1000.0, -1000.0);
               	SetTimer("lvpdgateclose2" ,9000 ,false);
               	print("OnPlayerKeyStateChange(61)");
               	return 1;
           	}
           	else if(IsPlayerInRangeOfPoint(playerid, 15.0, 135.2833, 1941.3331, 21.6932)) {
               	MoveDynamicObject(gateng,122.0023, 1941.4100, 21.6932,2, -1000.0, -1000.0, -1000.0);
               	SetTimer("nggateclose" ,9000 ,false);
               	print("OnPlayerKeyStateChange(62)");
               	return 1;
           	}
           	else if(IsPlayerInRangeOfPoint(playerid, 15.0, 1544.7007, -1630.7527, 13.2983)) {
               	MoveDynamicObject(lspdbar,1544.7007, -1630.7527, 13.2983,1,0.0000, 0.0000, 90.0000);
               	SetTimer("lspdbarclose" ,9000 ,false);
               	print("OnPlayerKeyStateChange(63)");
               	return 1;
           	}
           	else if(IsPlayerInRangeOfPoint(playerid, 15.0, 2238.22021, 2450.44312, 10.58781)) {
               	MoveDynamicObject(lvpdbar,2238.22021, 2450.44312, 10.58781,1,0.0000, 0.0000, 90.0000);
               	SetTimer("lvpdbarclose" ,9000 ,false);
               	print("OnPlayerKeyStateChange(64)");
               	return 1;
           	}
	   	}
   	}
    print("OnPlayerKeyStateChange(65)");
   	if(newkeys == KEY_LOOK_BEHIND) {
   		print("OnPlayerKeyStateChange(66)");
	   	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
	   		print("OnPlayerKeyStateChange(67)");
		   	new string[128], veh = GetPlayerVehicleID(playerid), engine,lights,alarm,doors,bonnet,boot,objective;
		   	if(IsABike(veh)) return SS(playerid, COLOR_LIGHTGREEN3, "Nu poti folosi comanda /engine pentru biciclete.", "You can't do that for bikes!");
		   	print("OnPlayerKeyStateChange(68)");
		   	if(Refueling[playerid] != 0) return SendClientMessage(playerid,COLOR_WHITE,"{999999}Please wait, you refill your vehicle.");
 	       	if(vehEngine[veh] == 0) {
			   	vehEngine[veh] = 1;
               	GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
               	SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
               	new vehicle;
               	vehicle = GetVehicleModel(veh) - 400;
               	SetPVarInt(playerid, "Engine", 1);
               	if(Undercover[playerid] != 0) {
                   	format(string,sizeof(string),"* An unknown hitman starts the engine of his %s.",aVehicleNames[vehicle]);
	               	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
               	}
               	else {
	               	format(string,sizeof(string),"* %s[%d] starts the engine of his %s.",GetName(playerid),playerid,aVehicleNames[vehicle]);
	               	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			   	}
			   	print("OnPlayerKeyStateChange(69)");
    	   	}
  	  	   	else if(vehEngine[veh] == 1) {
			   	vehEngine[veh] = 0;
			   	GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  	    	   	SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
        	   	new vehicle;
        	   	vehicle = GetVehicleModel(veh) - 400;
        	   	SetPVarInt(playerid, "Engine", 0);
        	   	if(Undercover[playerid] != 0) {
                   	format(string,sizeof(string),"* An unknown hitman stops the engine of his %s.",aVehicleNames[vehicle]);
            	   	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        	   	}
        	   	else {
            	   	format(string,sizeof(string),"* %s[%d] stops the engine of his %s.",GetName(playerid),playerid,aVehicleNames[vehicle]);
            	   	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			   	}
			   	print("OnPlayerKeyStateChange(70)");
    	   	}
	   	}
   	}
   	print("OnPlayerKeyStateChange(71)");
   	if(newkeys & KEY_SPRINT) {
   		print("OnPlayerKeyStateChange(72)");
       	if(gPlayerUsingLoopingAnim[playerid] == 1) StopLoopingAnim(playerid);
       	if(Spectate[playerid] != -1) {
	       	new onlineid[MAX_PLAYERS],totalplayers,string[140];
	       	foreach(Player, i) {
	       		if(Spectate[i] != -1 || TutTime[i] > 0 || CanSpectate[i] == 0) continue;
	       		onlineid[totalplayers] = i;
	       		totalplayers++;
	       	}
	       	if(totalplayers > 0) {
		       	new specid = onlineid[random(totalplayers)];
		       	Spectate[playerid] = specid;
		       	new Float:health,giveplayer[MAX_PLAYER_NAME];
			   	GetPlayerHealth(specid, health);
			   	GetPlayerName(specid, giveplayer, sizeof(giveplayer));
			   	format(string, sizeof(string), "(%d) %s | Level: %d | Health: %.0f | AFK: %d | Duty: %d | Ping: %d | Virtual: %d | Interior: %d",specid,giveplayer,PlayerInfo[specid][pLevel],health,IsPlayerAFK[specid],OnDuty[specid],GetPlayerPing(specid), GetPlayerVirtualWorld(specid), GetPlayerInterior(specid));
			   	SCM(playerid, COLOR_WHITE, string);
		   	   	TogglePlayerSpectating(playerid, 1);
		   	   	if(IsPlayerInAnyVehicle(specid)) {
				    PlayerSpectateVehicle(playerid, GetPlayerVehicleID(specid));
					SpectateState[specid] = 2;
			   	}
			   	else {
				    PlayerSpectatePlayer(playerid, specid);
					SpectateState[specid] = 1;
			   	}
			   	PlayerTextDrawSetString(playerid, TextDrawSpec[playerid][1], "loading...");
			   	PlayerTextDrawShow(playerid, TextDrawSpec[playerid][1]);
			   	print("OnPlayerKeyStateChange(73)");
		   	}
		}
   	}
   	if(newkeys & KEY_SECONDARY_ATTACK) {
   	   	new string[128];
	   	if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
		   	if(IsPlayerConnected(playerid) && gPlayerLogged[playerid] == 1) {
			   	if(flymode[playerid] == 1) {
	                flymode[playerid] = 0;
					StopFly(playerid);
					SetPlayerHealthEx(playerid, 99);
					SendClientMessage(playerid, COLOR_DARKPINK, "Fly mode off.");
					print("OnPlayerKeyStateChange(74)");
			   	}
			   	if(BusinessRob[playerid] == 3) return SendClientMessage(playerid, COLOR_ROB, "Trebuie sa astepti 10 secunde pentru a jefui business-ul.");
			   	print("OnPlayerKeyStateChange(75)");
			   	for(new i = 1; i < sizeof(HouseInfo); i++) {
				   	if(IsPlayerInRangeOfPoint(playerid,2,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]) && GetPlayerVirtualWorld(playerid) == 0) {
					   	if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0) {
                           	if(InWar[PlayerInfo[playerid][pMember]] == 1) return SCM(playerid, COLOR_CYAN, "(War){FFFFFF}: Nu poti intra intr-o cladire in timp ce esti in war.");
						   	if(housetime[playerid] > 0) {
					           	format(string, sizeof(string),"[Anti abuz]: Nu poti intra intr-o cladire timp de %d secunde.",housetime[playerid]);
					           	SendClientMessage(playerid, COLOR_GREY, string);
					           	return 1;
						   	}
						   	SetPlayerInterior(playerid,HouseInfo[i][hInterior]);
						   	SetPlayerPosEx(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
						   	GameTextForPlayer(playerid, "~w~Welcome Home", 4000, 1);
						   	PlayerInfo[playerid][pInt] = HouseInfo[i][hInterior];
						   	PlayerInfo[playerid][pLocal] = i;
						   	SetPlayerVirtualWorld(playerid,HouseInfo[i][hVirtual]);
						   	InHouse[playerid] = i;
						   	housetime[playerid] = 13;
						   	if(strlen(housestring[InHouse[playerid]]) > 0) {
			   			       	StopAudioStreamForPlayer(playerid);
	    				       	PlayAudioStreamForPlayer(playerid, housestring[InHouse[playerid]]);
						   	}
						   	print("OnPlayerKeyStateChange(76)");
					   	}
					   	else {
						   	SendClientMessage(playerid, COLOR_GREY, "This house is locked.");
						   	if(IsACop(playerid)) {
						   		BreachID[playerid] = i;
			            		ShowPlayerDialog(playerid, DIALOG_RAMHOUSE, DIALOG_STYLE_MSGBOX, "SERVER: Housing", "This house is locked.\nAs a law enforcement officer, you can breach this door and enter. Would you like to do so?", "Yes", "No");
						   	}
						   	if(PlayerInfo[playerid][pMember] == 11) {
						   		BreachID[playerid] = i;
			            		ShowPlayerDialog(playerid, DIALOG_RAMHOUSE, DIALOG_STYLE_MSGBOX, "SERVER: Housing", "This house is locked.\nAs a hitman, you can breach this door and enter. Would you like to do so?", "Yes", "No");
						   	}
					   	}
				   	}
			   	}
			   	for(new i = 1; i < sizeof(BizzInfo); i++) {
				   	if (IsPlayerInRangeOfPoint(playerid,2,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ])) {
					   	if(BizzInfo[i][bSbiz] != 0) return 0;
					   	if(InWar[PlayerInfo[playerid][pMember]] == 1) return SCM(playerid, COLOR_CYAN, "(War){FFFFFF}: Nu poti intra intr-o cladire in timp ce esti in war.");
					   	if(biztime[playerid] > 0) {
					   		new stringx[64];
				           	format(stringx, sizeof(stringx),"[Anti abuz]: Nu poti intra intr-o cladire timp de %d secunde.",biztime[playerid]);
				           	SendClientMessage(playerid, COLOR_GREY, stringx);
				           	print("OnPlayerKeyStateChange(Anti abuz biz)");
				           	return 1;
					   	}
					   	if(GetPlayerCash(playerid) >= BizzInfo[i][bEntranceCost]) {
						   	if(BizzInfo[i][bLocked] == 1) {
							   	SendClientMessage(playerid, COLOR_GREY, "This business is locked.");
							   	print("OnPlayerKeyStateChange(Biz is locked)");
							   	if(IsACop(playerid)) {
							   		BreachID[playerid] = i;
				            		ShowPlayerDialog(playerid, DIALOG_RAMBIZ, DIALOG_STYLE_MSGBOX, "SERVER: Businesses", "This business is locked.\nAs a law enforcement officer, you can breach this door and enter. Would you like to do so?", "Yes", "No");
							   	}
							   	if(PlayerInfo[playerid][pMember] == 11) {
							   		BreachID[playerid] = i;
				            		ShowPlayerDialog(playerid, DIALOG_RAMBIZ, DIALOG_STYLE_MSGBOX, "SERVER: Businesses", "This business is locked.\nAs a hitman, you can breach this door and enter. Would you like to do so?", "Yes", "No");
							   	}
							   	return 1;
						   	}
						   	if(LastBiz[playerid] != i) {
							   	GivePlayerCash(playerid,-BizzInfo[i][bEntranceCost]);
							   	BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
							   	new stringx[15];
							   	format(stringx,sizeof(stringx),"~r~-$%d",BizzInfo[i][bEntranceCost]);
							   	GameTextForPlayer(playerid, stringx, 5000, 1);
							   	print("OnPlayerKeyStateChange(Lastbizz)");
						   	}
						   	else GameTextForPlayer(playerid, "welcome back", 5000, 1);
						   	LastBiz[playerid] = i;
						   	if(BizzInfo[i][bType] == 3) {
							   	if(strlen(barstring[i][playerid]) > 0) {
									StopAudioStreamForPlayer(playerid);
									PlayAudioStreamForPlayer(playerid, barstring[i]);
							   	}
						   	}
						   	if(BizzInfo[i][bType] == 1) {
                               	SCM(playerid,COLOR_GREEN,"Inselatoriile (tepele) nu sunt permise pe server. Pentru orice incercare de a insela un player cu bunuri/bani puteti primi ban PERMANENT.");
                               	SCM(playerid,COLOR_GREEN,"Imprumuturile de orice fel (inclusiv datoriile) se fac pe proprie raspundere. Nu ai nicio garantie ca ii vei recupera.");
                               	SCM(playerid,COLOR_GREEN,"Afacerile cu bani reali nu sunt permise. Se pedepseste cu ban 7-14 zile la prima abatere si ban permanent la urmatoarea abatere.");
					           	SCM(playerid,COLOR_WHITE,"Welcome! The commands of this business are as follows: /deposit, /withdraw, /balance, /transfer");
					           	print("OnPlayerKeyStateChange(Banca)");
						   	}
						   	else if(BizzInfo[i][bType] == 2) SCM(playerid,COLOR_WHITE,"Welcome to the gun shop! The commands of this business are as follows: /buygun");
						   	else if(BizzInfo[i][bType] == 3) SCM(playerid,COLOR_WHITE,"Welcome! The commands of this business are as follows: /buydrink");
						   	else if(BizzInfo[i][bType] == 4) SCM(playerid,COLOR_WHITE,"Welcome to the sex shop! The commands of this business are as follows: /buytoys");
						   	else if(BizzInfo[i][bType] == 5) SCM(playerid,COLOR_WHITE,"Welcome! The commands of this business are as follows: /dice");
						   	else if(BizzInfo[i][bType] == 6) {
								SCM(playerid,COLOR_WHITE,"Welcome! The commands of this business are as follows: /buy");
								if(PlayerInfo[playerid][pFishPrice] != 0) {
									ShowPlayerDialog(playerid, DIALOG_SELLFISH, DIALOG_STYLE_MSGBOX, "Sell fish", "Do you want to sell the fish you are carying?", "Yes", "No");
									print("OnPlayerKeyStateChange(Dialog fish)");
								}
						   	}
						   	else if(BizzInfo[i][bType] == 7 || BizzInfo[i][bType] == 14) {
					           	SCM(playerid,COLOR_WHITE,"Welcome! The commands of this business are as follows: /buyfood");
							   	if(AreFaina[playerid] > 0)  {
						        	new money,faina = AreFaina[playerid];
		       						if(PlayerInfo[playerid][pFarmSkill] == 1) money = 15000 + faina*1000;
									else if(PlayerInfo[playerid][pFarmSkill] == 2) money = 20000 + faina*1000;
									else if(PlayerInfo[playerid][pFarmSkill] == 3) money = 25000 + faina*1000;
									else if(PlayerInfo[playerid][pFarmSkill] == 4) money = 30000 + faina*1000;
									else if(PlayerInfo[playerid][pFarmSkill] == 5) money = 35000 + faina*1000;
									else if(PlayerInfo[playerid][pFarmSkill] >= 6) money = 40000 + faina*1000;
									PlayerInfo[playerid][pFarmTimes]++;
									PlayerInfo[playerid][pFarmRem]--;
									if(PlayerInfo[playerid][pJobBoost] > 0) money = money+money/2;
									AreFaina[playerid] = 0;
									if(GetPlayerCash(playerid) < 1000000000) {
										GivePlayerCash(playerid, money);
										Update(playerid, pCashx);
									}
									else SS(playerid, COLOR_LIGHTRED, "Nu poti detine mai multe de 999.999.999$ la tine.", "You can not hold more than 999.999.999$ to you.");
									Update(playerid, pFarmTimesx);
									Update(playerid, pFarmRemx);
									if(PlayerInfo[playerid][pFarmSkill] <= 5) {
										if(PlayerInfo[playerid][pFarmRem] <= 0) {
			    							PlayerInfo[playerid][pFarmSkill]++;
			    							if(PlayerInfo[playerid][pFarmSkill] == 2) PlayerInfo[playerid][pFarmRem] = 34;
											else if(PlayerInfo[playerid][pFarmSkill] == 3) PlayerInfo[playerid][pFarmRem] = 49;
											else if(PlayerInfo[playerid][pFarmSkill] == 4) PlayerInfo[playerid][pFarmRem] = 89;
											else if(PlayerInfo[playerid][pFarmSkill] == 5) PlayerInfo[playerid][pFarmRem] = 99;
		    								Update(playerid,pFarmSkillx);
		    								Update(playerid,pFarmRemx);
		    								new stringx[64];
			    							format(stringx,sizeof(stringx),"Felicitari! Ai acum skill %d pentru acest job!",PlayerInfo[playerid][pFarmSkill]);
			    							SendClientMessage(playerid, COLOR_YELLOW, stringx);
										}
									}
							   		if(JobActiv == 1) {
										new moneyy = 10000 + random(20000);
										GivePlayerCash(playerid, moneyy);
										format(string, sizeof(string), "(Job Bonus){FFFFFF}: Ai primit $%s in plus fata de munca depusa deoarece pe server este activ job bonus.", FormatNumber(moneyy));
										SendClientMessage(playerid, COLOR_CYAN, string);
									}
									format(string,sizeof(string),"(+) Ai vandut un sac de faina pentru $%s.", FormatNumber(money));
									SendClientMessage(playerid, COLOR_GREEN, string);
									if(PlayerInfo[playerid][pQuest2] == 5) {
										if(PlayerInfo[playerid][pQuestNeed2] > PlayerInfo[playerid][pQuestProgress2]) {
											PlayerInfo[playerid][pQuestProgress2] += faina;
											Update(playerid, pQuestProgress2x);
											if(PlayerInfo[playerid][pQuestProgress2] >= PlayerInfo[playerid][pQuestNeed2]) FinishQuest2(playerid, 5);
											else {
												new str[128];
												if(PlayerInfo[playerid][pLanguage] == 1) {
													format(str, sizeof(str),"Quest [Sell %d KG of flour] progress: %d/%d",PlayerInfo[playerid][pQuestNeed2],PlayerInfo[playerid][pQuestProgress2],PlayerInfo[playerid][pQuestNeed2]);
													SendClientMessage(playerid, COLOR_YELLOW, str);
												}
												else {
													format(str, sizeof(str),"Progres pentru misiunea [Vinde %d KG de faina]: %d/%d",PlayerInfo[playerid][pQuestNeed2],PlayerInfo[playerid][pQuestProgress2],PlayerInfo[playerid][pQuestNeed2]);
													SendClientMessage(playerid, COLOR_YELLOW, str);
												}
											}
										}
									}
									print("OnPlayerKeyStateChange(Vanzare faina)");
								}
						   	}
						   	else if(BizzInfo[i][bType] == 8) SCM(playerid,COLOR_WHITE,"Welcome! The commands of this business are as follows: /buyfightstyle");
						   	else if(BizzInfo[i][bType] == 9) SCM(playerid,COLOR_WHITE,"Welcome! The commands of this business are as follows: /buyfood");
						   	else if(BizzInfo[i][bType] == 11) SCM(playerid,COLOR_WHITE,"Welcome! The commands of this business are as follows: /clothes ($5000), /buyglasses, /buyhat ($5000)");
						   	SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
						   	SetPlayerPosEx(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
						   	PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
						   	PlayerInfo[playerid][pLocal] = i+99;
	                       	SetPlayerVirtualWorld(playerid,BizzInfo[i][bVirtual]);
						   	InBussines[playerid] = i;
						   	Update(playerid, pCashx);
						   	biztime[playerid] = 13;
						   	print("OnPlayerKeyStateChange(77)");
			               	new str1[64];
						   	mysql_format(SQL,str1,sizeof(str1),"UPDATE `bizz` SET `Till`='%d' WHERE `ID`='%d'",BizzInfo[i][bTill],i);
						   	mysql_tquery(SQL,str1,"","");
					   	}
					   	else GameTextForPlayer(playerid, "~r~~h~You dont have the cash", 5000, 1);
				   	}
			   	}
			   	// Sistem dinamic HQ
		   	   	for(new fid = 1; fid < sizeof(DynamicFactions); fid++) {
				   	if(IsPlayerInRangeOfPoint(playerid, 2, DynamicFactions[fid][fceX], DynamicFactions[fid][fceY], DynamicFactions[fid][fceZ]) && GetPlayerVirtualWorld(playerid) == 0) {
				   		if(DynamicFactions[fid][fLocked] == 1 && PlayerInfo[playerid][pMember] == fid) {
					   		SetPlayerPosEx(playerid, DynamicFactions[fid][fcX], DynamicFactions[fid][fcY], DynamicFactions[fid][fcZ]);
			                SetPlayerInterior(playerid, DynamicFactions[fid][fInterior]);
			                SetPlayerVirtualWorld(playerid, DynamicFactions[fid][fVirtual]);
			                InHQ[playerid] = fid;
			                print("OnPlayerKeyStateChange(78)");
			            }
			            else if(DynamicFactions[fid][fLocked] == 0) {
			            	SetPlayerPosEx(playerid, DynamicFactions[fid][fcX], DynamicFactions[fid][fcY], DynamicFactions[fid][fcZ]);
			                SetPlayerInterior(playerid, DynamicFactions[fid][fInterior]);
			                SetPlayerVirtualWorld(playerid, DynamicFactions[fid][fVirtual]);
			                InHQ[playerid] = fid;
			                print("OnPlayerKeyStateChange(79)");
			            }
			            else {
			            	new stringx[64];
			            	format(stringx, sizeof(stringx), "%s{FFFFFF}'s HQ is locked!", DynamicFactions[fid][fName]);
			            	SCM(playerid, COLOR_GREY, stringx);
			            	print("OnPlayerKeyStateChange(80)");
			            	if(IsACop(playerid)) {
			            		BreachID[playerid] = fid;
			            		ShowPlayerDialog(playerid, DIALOG_RAMHQ, DIALOG_STYLE_MSGBOX, "SERVER: Group HQ", "This Group HQ is locked.\nAs a law enforcement officer, you can breach this door and enter. Would you like to do so?", "Yes", "No");
			            	}
			            	if(PlayerInfo[playerid][pMember] == 11) {
			            		BreachID[playerid] = fid;
			            		ShowPlayerDialog(playerid, DIALOG_RAMHQ, DIALOG_STYLE_MSGBOX, "SERVER: Group HQ", "This Group HQ is locked.\nAs a hitman, you can breach this door and enter. Would you like to do so?", "Yes", "No");
			            	}
			            }
				   	}
			   	}
			  	for(new fid = 1; fid < sizeof(DynamicFactions); fid++) {
			   	   	if(IsPlayerInRangeOfPoint(playerid, 2, DynamicFactions[fid][fcX], DynamicFactions[fid][fcY], DynamicFactions[fid][fcZ]) && GetPlayerVirtualWorld(playerid) == DynamicFactions[fid][fVirtual]) {
				   		SetPlayerPosEx(playerid, DynamicFactions[fid][fceX], DynamicFactions[fid][fceY], DynamicFactions[fid][fceZ]);
					    SetPlayerInterior(playerid, 0);
					    PlayerInfo[playerid][pInt] = 0;
					    PlayerInfo[playerid][pLocal] = 255;
					    SetPlayerVirtualWorld(playerid, 0);
					    InHQ[playerid] = -1;
					    print("OnPlayerKeyStateChange(81)");
					    if(IsAMember(playerid)) {
					    	if(InWar[PlayerInfo[playerid][pMember]] == 1) {
					    		SetPlayerVirtualWorld(playerid, 1024);
					    	}
					    }
				   	}
			   	}
			   	for(new i = 1; i <  sizeof(HouseInfo); i++) {
			   		if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]) && HouseInfo[i][hVirtual] == GetPlayerVirtualWorld(playerid)) {
	                   	if(PlayerInfo[playerid][pSleeping] == 1) return 1;
					   	SetPlayerVirtualWorld(playerid,0);
					   	SetPlayerInterior(playerid,0);
					   	SetPlayerPosEx(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
					   	PlayerInfo[playerid][pInt] = 0;
					   	PlayerInfo[playerid][pLocal] = 255;
					   	InHouse[playerid] = -1;
					   	housetime[playerid] = 13;
					   	print("OnPlayerKeyStateChange(82)");
					   	StopAudioStreamForPlayer(playerid);
				   	}
			   	}
			   	for(new i = 1; i <  sizeof(BizzInfo); i++) {
			   		if(IsPlayerInRangeOfPoint(playerid, 2.0, BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]) && BizzInfo[i][bVirtual] == GetPlayerVirtualWorld(playerid) && BizzInfo[i][bSbiz] == 0) {
					   	SetPlayerInterior(playerid,0);
					   	PlayerInfo[playerid][pInt] = 0;
					   	SetPlayerPosEx(playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]);
					   	PlayerInfo[playerid][pLocal] = 255;
		               	SetPlayerVirtualWorld(playerid,0);
		               	InBussines[playerid] = -1;
		               	biztime[playerid] = 13;
		               	print("OnPlayerKeyStateChange(83)");
					   	StopAudioStreamForPlayer(playerid);
				   	}
			   	}
			   	if(IsPlayerInRangeOfPoint(playerid,2,1584.8812, 1797.7262, 10.8280) && PlayerInfo[playerid][pMember] == 14)  SetPlayerPosEx(playerid, 1585.8629, 1793.7830, 30.4688);
			   	else if(IsPlayerInRangeOfPoint(playerid,2,1585.8629, 1793.7830, 30.4688) && PlayerInfo[playerid][pMember] == 14) SetPlayerPosEx(playerid, 1584.8812, 1797.7262, 10.8280);
			   	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1568.5825,-1690.2802,5.8906) && IsACop(playerid))  SetPlayerPosEx(playerid,1564.8662,-1666.4962,28.3956);
			   	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1564.8662,-1666.4962,28.3956) && IsACop(playerid)) SetPlayerPosEx(playerid,1568.5825,-1690.2802,5.8906);
			   	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 2340.2810,2456.5625,14.9688)) SetPlayerPosEx(playerid,2339.3237,2461.2197,38.6837);
			   	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 2339.3237,2461.2197,38.6837)) SetPlayerPosEx(playerid,2340.2810,2456.5625,14.9688);
			   	else if(IsPlayerInRangeOfPoint(playerid,2,611.1835, -585.6877, 17.2266) && IsACop(playerid)) SetPlayerPosEx(playerid, 618.1414,-566.7900,26.1432);
			   	else if(IsPlayerInRangeOfPoint(playerid,2,618.1414,-566.7900,26.1432) && IsACop(playerid)) SetPlayerPosEx(playerid, 611.1835, -585.6877, 17.2266);
				else if(IsPlayerInRangeOfPoint(playerid, 2.0, 387.2719, -1897.2714, 7.7874)) {
					SetPlayerPosEx(playerid, 4813.5342, -4772.3730, 5.7099);
					SetPlayerVirtualWorld(playerid, 0);
					SetPlayerInterior(playerid, 0);
					PlayerInfo[playerid][pInt] = 0;
					GivePlayerCash(playerid, -10000);
					Update(playerid, pCashx);
				}
				else if(IsPlayerInRangeOfPoint(playerid, 2.0, 4767.7949, -4849.6021, 6.6624)) {
					SetPlayerPosEx(playerid, 387.2719, -1897.2714, 7.7874);
					SetPlayerVirtualWorld(playerid, 0);
					SetPlayerInterior(playerid, 0);
					PlayerInfo[playerid][pInt] = 0;
					GivePlayerCash(playerid, -10000);
					Update(playerid, pCashx);
				}
			   	else if(IsPlayerInRangeOfPoint(playerid,1,1552.5898,-1683.4698,13.5504) && Vending[playerid] == 0 && GetPlayerVirtualWorld(playerid) == 0) {
			      	if(GetPlayerCash(playerid) < 200) return SCM(playerid,COLOR_WHITE,"{FFB870}You don't have money needed.");
        			ApplyAnimation(playerid, "VENDING", "VEND_USE", 4.0, 0, 0, 0, 0, 0);
           			PlayerPlaySound(playerid, 42600, 0.0, 0.0, 0.0);
           			SetPlayerFacingAngle(playerid, 272.63);
              		GameTextForPlayer(playerid, "~r~-200$", 5000, 1);
                	GivePlayerCash(playerid, -200);
					Update(playerid,pCashx);
					dozatortime[playerid] = 10;
					Vending[playerid] = 1;
					vendi[playerid] = SetTimerEx("Vendingg", 6000, 0, "i", playerid);
					vendi2[playerid] = SetTimerEx("Vendingg2", 2300, 0, "i", playerid);
					format(string, sizeof(string), "* %s bought a drink from vending machine.", GetName(playerid));
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			   	}
			   	else if(IsPlayerInRangeOfPoint(playerid,1,2273.5654,2428.7834,10.8203) && Vending[playerid] == 0) {
					if(GetPlayerCash(playerid) < 200) return SCM(playerid,COLOR_WHITE,"{FFB870}You don't have money needed.");
        			ApplyAnimation(playerid, "VENDING", "VEND_USE", 4.0, 0, 0, 0, 0, 0);
           			PlayerPlaySound(playerid, 42600, 0.0, 0.0, 0.0);
           			SetPlayerFacingAngle(playerid, 272.63);
              		GameTextForPlayer(playerid, "~r~-200$", 5000, 1);
                	GivePlayerCash(playerid, -200);
					Update(playerid,pCashx);
					dozatortime[playerid] = 10;
					Vending[playerid] = 1;
					vendi[playerid] = SetTimerEx("Vendingg", 6000, 0, "i", playerid);
					vendi2[playerid] = SetTimerEx("Vendingg2", 2300, 0, "i", playerid);
					format(string, sizeof(string), "* %s bought a drink from vending machine.", GetName(playerid));
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			   	}
			   	else if (IsPlayerInRangeOfPoint(playerid,1,316.4404,-132.5466,1004.0625) && Vending[playerid] == 0) {
					if(GetPlayerCash(playerid) < 200) return SCM(playerid,COLOR_WHITE,"{FFB870}You don't have money needed.");
        			ApplyAnimation(playerid, "VENDING", "VEND_USE", 4.0, 0, 0, 0, 0, 0);
           			PlayerPlaySound(playerid, 42600, 0.0, 0.0, 0.0);
           			SetPlayerFacingAngle(playerid, 272.63);
              		GameTextForPlayer(playerid, "~r~-200$", 5000, 1);
                	GivePlayerCash(playerid, -200);
					Update(playerid,pCashx);
					dozatortime[playerid] = 10;
					Vending[playerid] = 1;
					vendi[playerid] = SetTimerEx("Vendingg", 6000, 0, "i", playerid);
					vendi2[playerid] = SetTimerEx("Vendingg2", 2300, 0, "i", playerid);
					format(string, sizeof(string), "* %s bought a drink from vending machine.", GetName(playerid));
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			   	}
			   	else if(IsPlayerInRangeOfPoint(playerid,2,2166.4771,-1671.7883,15.0743)) {
	               	SetPlayerInterior(playerid,5);
				   	SetPlayerPosEx(playerid,318.5867,1115.4735,1083.8828);
				   	PlayerInfo[playerid][pInt] = 5;
			   	}
			   	else if (IsPlayerInRangeOfPoint(playerid,2,242.8626,66.2978,1003.6406) && GetPlayerVirtualWorld(playerid) == 0) {
	               	if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not a cop.");
		           	SetPlayerInterior(playerid,3);
		           	SetPlayerVirtualWorld(playerid,333);
		    	   	SetPlayerPosEx(playerid,288.8405,167.7809,1007.1719);
		    	   	PlayerInfo[playerid][pInt] = 3;
		    	   	InHQ[playerid] = 1;
		       	}
			   	else if(IsPlayerInRangeOfPoint(playerid,2,1481.0999, -1771.4293, 18.7054) && GetPlayerVirtualWorld(playerid) == 0) {
			   	   	SetPlayerInterior(playerid,3);
			   	   	PlayerInfo[playerid][pInt] = 3;
			   	   	SetPlayerVirtualWorld(playerid, 0);
				   	SetPlayerPosEx(playerid, 389.69766, 173.69702, 1008.35889);
			   	}
		       	else if (IsPlayerInRangeOfPoint(playerid,2,242.8626,66.2978,1003.6406) && GetPlayerVirtualWorld(playerid) == 6) {
	               	if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not a cop.");
		           	SetPlayerInterior(playerid,3);
		           	SetPlayerVirtualWorld(playerid,343);
		    	   	SetPlayerPosEx(playerid,288.8405,167.7809,1007.1719);
		    	   	PlayerInfo[playerid][pInt] = 3;
		    	   	InHQ[playerid] = 1;
		       	}
		       	else if(IsPlayerInRangeOfPoint(playerid,2,318.5867,1115.4735,1083.8828))  {
		           	SetPlayerInterior(playerid,0);
				   	SetPlayerPosEx(playerid,2166.4771,-1671.7883,15.0743);
				   	PlayerInfo[playerid][pInt] = 0;
			   	}
			   	else if (IsPlayerInRangeOfPoint(playerid,2,288.8405,167.7809,1007.1719) && GetPlayerVirtualWorld(playerid) == 333) {
				   	SetPlayerInterior(playerid,6);
				   	SetPlayerVirtualWorld(playerid,0);
				   	SetPlayerPosEx(playerid,242.8626,66.2978,1003.6406);
				   	PlayerInfo[playerid][pInt] = 6;
				   	PlayerInfo[playerid][pLocal] = 0;
				   	InHQ[playerid] = -1;
			   	}
			   	else if(IsPlayerInRangeOfPoint(playerid,2,389.69766, 173.69702, 1008.35889) && GetPlayerInterior(playerid) == 3)  {
			   	   	SetPlayerInterior(playerid,0);
			   	   	PlayerInfo[playerid][pInt] = 0;
			   	   	PlayerInfo[playerid][pLocal] = 255;
			   	   	SetPlayerVirtualWorld(playerid, 0);
				   	SetPlayerPosEx(playerid, 1481.0999, -1771.4293, 18.7054);
			   	}
			   	else if (IsPlayerInRangeOfPoint(playerid,2,288.8405,167.7809,1007.1719) && GetPlayerVirtualWorld(playerid) == 343)  {
				   	SetPlayerInterior(playerid,6);
				   	SetPlayerVirtualWorld(playerid,6);
				   	SetPlayerPosEx(playerid,242.8626,66.2978,1003.6406);
				   	PlayerInfo[playerid][pInt] = 6;
				   	PlayerInfo[playerid][pLocal] = 0;
				   	InHQ[playerid] = -1;
			   	}
			   	else if(IsPlayerInRangeOfPoint(playerid,1,304.5868,-141.9874,1004.0625)) SetPlayerPosEx(playerid,305.7950,-141.8203,1004.0547);
			   	else if(IsPlayerInRangeOfPoint(playerid,1,298.8386,-141.9191,1004.0547)) SetPlayerPosEx(playerid,300.1631,-141.8074,1004.0625);
			   	else if(IsPlayerInRangeOfPoint(playerid,2,-1423.5153,935.8321,1036.4756)) {
				   	if(areape == 1) {
				       	SetPlayerInterior(playerid,0);
					   	SetPlayerPosEx(playerid,1510.3986,-1059.5723,25.0625);
					   	PlayerInfo[playerid][pInt] = 0;
				   	}
				   	else return SCM(playerid,COLOR_GREY, "The event arena is closed.");
			   	}
			  	else if (IsPlayerInRangeOfPoint(playerid,2,1510.3986,-1059.5723,25.0625)) {
				   	if(areape == 1) {
				       	SetPlayerInterior(playerid,15);
					   	SetPlayerPosEx(playerid,-1423.5153,935.8321,1036.4756);
					   	PlayerInfo[playerid][pInt] = 15;
				   	}
				   	else return SCM(playerid,COLOR_GREY, "The event arena is closed.");
			   	}
			   	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 650.36047, -609.29718, 15.69630) || IsPlayerInRangeOfPoint(playerid, 4.0, 317.2124, -132.4013, 1002.9965)) {
					if(GetPlayerVirtualWorld(playerid) == 0) {
					  	if(GetPlayerCash(playerid) < 100) return SCM(playerid,COLOR_WHITE,"{FFB870}You don't have money needed.");
					   	new Float:health;
					   	GetPlayerHealth(playerid,health);
					   	if(health >= 75) {
						   	SetPlayerHealthEx(playerid, 100);
						   	ApplyAnimation(playerid,"FOOD","EAT_Burger", 3.0, 0, 0, 0, 0, 0);
						   	GivePlayerCash(playerid, -100);
						   	GameTextForPlayer(playerid, "~r~-100$", 5000, 1);
						   	Update(playerid, pCashx);
					   	}
					   	else {
						   	SetPlayerHealthEx(playerid, health+25);
						   	ApplyAnimation(playerid,"FOOD","EAT_Burger", 3.0, 0, 0, 0, 0, 0);
						   	GivePlayerCash(playerid, -100);
						   	GameTextForPlayer(playerid, "~r~-100$", 5000, 1);
						   	Update(playerid, pCashx);
					   	}
					}
			    }
			    print("OnPlayerKeyStateChange(84)");
		   	}
	   	}
	   	if(NoFuel[playerid] == 1) {
		   	RemovePlayerFromVehicleEx(playerid);
           	TogglePlayerControllable(playerid, 1);
		   	NoFuel[playerid] = 0;
		   	print("OnPlayerKeyStateChange(85)");
	   	}
   	}
   	return 0;
}
I think it's a problem with this script but I do not know what it is. If you could help me.
GnT 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
Problem with public! Longover Scripting Help 4 26/12/2017 05:23 PM
Public problem TheDarkBlade Scripting Help 8 13/12/2016 05:12 PM
Problem with Public colonel-top Server Support 1 02/02/2014 01:07 PM
Problem with buy able car and public. Don_Cage Scripting Help 3 18/03/2013 05:03 PM
Public problem RatHack Help Archive 9 09/08/2011 02:38 PM


All times are GMT. The time now is 03:43 AM.


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