Jump to content

Maruchan

Recommended Posts

Mi problema sucede que en mi servidor cada vez que se refrescan los puntos de loot el servidor se cae y genera error de network trouble. Me han dicho que lo idéal sería dividir el tiempo de ejecución por horarios para evitar que el server colapse pero habría que reescribir el código pero está fuera de mis conocimientos, ¿alguna ayuda por favor?.

 

timetorefresh = math.random(2700000,3600000)

local itemTable = {
	  farm = {

  --- HERRAMIENTAS Y UTILIDADES ---
	 
	 --{"Dinero", 2086,0.8,90,6},  -- Donde 2086 es la ID de cualquier objeto no utilizado, 6 es la probabilidad de aparición, cuanto mayor es el número, mayor es la posibilidad.
     {"Madera",1463,0.4,0,13},
     {"Pasto",874,0.5,0,12},
     {"Caja de cerillas",328,0.4,90,8},
     {"Tienda de campaña militar",1279,1,0,0.5},
     {"Bidón de gasolina vacío",1650,1,0,10},
     {"Latas vacías",2673,0.5,0,12},
     {"Mapa",1277,0.8,90,6},
     {"GPS",2976,0.15,0,2},	
     {"Rueda",1073,1,0,2},
     {"Depósito",1008,1,0.8,2},
     {"Estereo",1790,1,0.8,2},	 
	 {"Trampa para oso",1762,1,0,5},
	 {"Abre latas",1666,1,0,5},		
--------------------------------------

  --- ALIMENTOS Y BEBIDAS ---
     
	 {"Kiwi",2133,1,0,0.2},  
     {"Naranja",2199,1,0,0.3},
     {"Dew",2236,1,0,0.3},  
     {"Pepsi",2164,1,0,0.3},	 
     {"Cantimplora de agua llena",2683,1,0,6},
     {"Lata de spaghetti (cerrada)",2770,1,0,6},
     {"Lata de spaghetti (abierta)",2770,1,0,0},	
     {"Frijoles al horno (cerrada)",2601,1,0,6},
     {"Frijoles al horno (abierta)",2601,1,0,0},	
     {"Hamburguesa",2768,1,0,6},
     {"Coca Cola",2647,1,0,0.2},
--------------------------------------	

  --- MOCHILAS DEL SERVER --- 
     
	 {"Mochila Coyote",1575,1,0,0.5}, 
     {"Mochila Dry Bag roja",1542,1,0,2.2},
     {"Mochila Sposn",1669,1,0,2.5},
     {"Mochila Hunting",1919,1,0,2.5},	
     ---{"Mochila Improvisada inicial",2221,1,0,3.5},
     {"Mochila de Asalto negra",1891,1,0,3.5},  
--------------------------------------

  --- ARMAS DEL SERVER ---
    
     {"Cuchillo",335,1,90,4},
     {"Revólver",348,1,90,0.2},
     {"G17",346,1,90,4},
     {"Analgésico",2709,3,0,3.5},
     {"M14 AIM",357,1,90,0.3},
     {"Remington 870",349,1,90,0.3},
--------------------------------------

  --- TRAJE CAMUFLAJE ---	
     {"Traje mujer soldado",1213,2,0,0.3},	
     {"Traje chica superviviente",1213,2,0,0.3},
--------------------------------------

  --- MEDICINAS ---  
  
	 {"Vendaje",1578,0.5,0,4},
     {"Morfina",1579,1,0,4},
	 },
	 residential = {
 --- ARMADURA - CASCO - MASCARA ---  

	 {"Casco táctico",1915,1,0,0.5},
	 {"Casco de soldador",1914,1,0,0.5},	 
	 {"Casco de bombero",2704,1,0,0.2},
	 {"Casco de motoquero",1861,1,0,0.5},
	 {"Casco de motociclista",1941,1,0,0.3},	 
	 {"Máscara de gas militar",1903,1,0,0.6},
	 {"Máscara de gas civil",1902,1,0,0.6},	
	 {"Barbijo",1901,1,0,0.6},		 
	 {"Máscara wolf",1900,1,0,1},
	 {"Máscara dallas",2705,1,0,1.3},	
	 {"Chaleco de policia",1879,1,0,0.5},
	 {"Chaleco fuerzas especiales",1920,1,0,0.2},
	 {"Chaleco táctico",1877,1,0,0.1},
	 {"Chaleco militar",1853,1,0,0.2},	
	 {"Chaleco antidisturbios",2105,1,0,0.1},
	 {"Chaleco ejercito rojo",2106,1,0,0.2},	 
--------------------------------------

  --- HERRAMIENTAS Y UTILIDADES ---	
	
	--{"Dinero", 2086,0.8,90,6}, 
     {"Caja de cerillas",328,0.4,90,5},
     {"Madera",1463,0.4,0,5},
     {"Bidón de gasolina vacío",1650,1,0,9},
     {"Bengala roja",324,1,90,9},	 		 
     {"Rueda",1073,1,0,1},
     {"Estereo",1790,1,0.8,2},		 
     {"Depósito",1008,0.8,0,1},
     {"Mapa",1277,0.8,90,10},
     {"GPS",2976,0.15,0,3},
     {"Latas vacías",2673,0.5,0,12},
     {"Pasto",874,0.5,0,12},
     {"Reloj",2710,1,0,3},
	 {"Estabilizador antiradiación",2387,0.3,0,0.1},	
	 {"Contador geiger",2386,0.3,0,0.1}, 	 
     {"Alambrada",933,0.25,0,1},
	 {"Brújula",1241,1,0,1.00},
	 {"Trampa para oso",1762,1,0,5},
	 {"Abre latas",1666,1,0,4},		
--------------------------------------

  --- ALIMENTOS Y BEBIDAS ---
 
     {"Pizza",1582,1,0,7},
     {"Coca Cola",2647,1,0,0.1},
     {"Leche",2856,1,0,7},
     {"Lata de spaghetti (cerrada)",2770,1,0,7},
     {"Lata de spaghetti (abierta)",2770,1,0,0},	
     {"Frijoles al horno (cerrada)",2601,1,0,7},
     {"Frijoles al horno (abierta)",2601,1,0,0},	
     {"Hamburguesa",2768,1,0,7},
     {"Dew",2236,1,0,0.3},  
     {"Pepsi",2164,1,0,0.3},	 
 --------------------------------------

  --- MEDICINAS ---
  
     {"Analgésico",2709,3,0,7},
     {"Morfina",1579,1,0,2},
     {"Bolsa térmica",1576,5,0,6},	
	 {"Antidoto",1509,2.1,0,1},	
 --------------------------------------

  --- ARMAS DEL SERVER ---
  
     {"M9 SD",347,1,90,1.9},
     {"Remington 870",349,1,90,0.1},
     {"PDW",352,1,90,1},
     {"Cuchillo",335,1,90,3},
     {"Hacha",339,1,90,1},
     {"Granada",342,1,0,0.01},
     {"Bomba de humo",343,1,0,0.5},	 
     {"Revólver",348,1,90,0.4},
     {"SPAZ-12 combat shotgun",351,1,90,0.4},
     {"MP5A5",353,1,90,0.4},
     {"M14 AIM",357,1,90,0.3},
     {"Guitarra",333,1,90,3},
     {"Bate",336,1,90,3},
     {"Pala",337,1,90,3},
     {"G17",346,1,90,1.5},

 --------------------------------------

  --- MOCHILAS DEL SERVER ---
     
	 {"Mochila Hunting",1919,1,0,2.5},	
     {"Mochila Sposn",1669,1,0,1.5},
     {"Mochila Dry Bag roja",1542,1,0,1.2},
     {"Mochila Taloon naranja",1667,1,0,4},
     {"Mochila Alice",1950,1,0,1.5},
     ---{"Mochila Improvisada inicial",2221,1,0,1.5},
     {"Mochila de Asalto negra",1891,1,0,3.5},  
 --------------------------------------

  --- TRAJE CAMUFLAJE ---	
	
     {"Traje mujer soldado 2",1213,2,0,0.3},	
     {"Traje fuerzas especiales",1213,2,0,0.3},		
	 {"Traje militar terrorista",1213,2,0,0.3},	 
     },
	 
      military = {
  
 --------------------------------------
 
  --- ARMADURA - CASCO - MASCARA ---
 	 --{"Dinero", 2086,0.8,90,6},   
 
	 {"Casco táctico",1915,1,0,0.5},
	 {"Casco de soldador",1914,1,0,0.5},	 
	 {"Casco de bombero",2704,1,0,0.2},
	 {"Casco de motoquero",1861,1,0,0.5},
	 {"Casco de motociclista",1941,1,0,0.3},	 
	 {"Máscara de gas militar",1903,1,0,0.6},	 
	 {"Máscara de gas civil",1902,1,0,0.6},	 
	 {"Barbijo",1901,1,0,0.6},		 
	 {"Máscara wolf",1900,1,0,1},
	 {"Máscara dallas",2705,1,0,1.3},	
	 {"Chaleco de policia",1879,1,0,0.5},
	 {"Chaleco fuerzas especiales",1920,1,0,0.2},
	 {"Chaleco táctico",1877,1,0,0.1},
	 {"Chaleco militar",1853,1,0,0.2},	
	 {"Chaleco antidisturbios",2105,1,0,0.1},
	 {"Chaleco ejercito rojo",2106,1,0,0.2},		 
--------------------------------------

  --- HERRAMIENTAS Y UTILIDADES ---	
  
     {"Caja de cerillas",328,0.4,90,2},
     {"Bidón de gasolina vacío",1650,1,0,4},
     {"Bengala amarilla",324,1,90,9},	
     {"Bengala azul",324,1,90,9},	
     {"Prismáticos",369,1,0,4},
     {"Rueda",1073,1,0,2},
     {"Estereo",1790,1,0.8,2},		 
     {"Depósito",1008,0.8,0,2},	
     {"Visión nocturna",368,1,90,1},	
     {"Reloj",2710,1,0,4},
     {"Bolsa térmica",1576,5,0,3},
     {"Alambrada",933,0.25,0,1},	
     {"Latas vacías",2673,0.5,0,12},
     {"Pasto",874,0.5,0,12},
     {"Visión térmica",369,1,90,3},
     {"GPS",2976,0.15,0,3},
     {"Mapa",1277,0.8,90,7},
     {"Caja de herramientas",2969,0.5,0,1},
     {"Motor",929,0.3,0,2},
	 {"Rotor",14567,1.4,0,2},
	 {"Metal",1314,1.4,0,1},
	 {"Vidrio",954,1.4,0,1},	 
     {"Tienda de campaña militar",1279,1,0,4.5},	
     {"Dispositivo de radio",330,1,0,6},
	 {"Estabilizador antiradiación",2387,0.3,0,1},	 
	 {"Contador geiger",2386,0.3,0,0.1}, 	 
	 {"Brújula",1241,1,0,1.00},	
	 {"Trampa para oso",1762,1,0,5},	
	 --{"Silenciador",1577,5,0,2},	
	 --{"Visor óptico (largo alcance)",1272,5,0,0.3},	 
 --------------------------------------

  --- ARMAS DEL SERVER ---
  
     {"G17",346,1,90,5},
     {"M9 SD",347,1,90,4},
     {"Remington 870",349,1,90,3},
     {"PDW",352,1,90,4},
     {"Cuchillo",335,1,90,2.4},
     {"Hacha",339,1,90,2.1},
     {"Granada",342,1,0,0.5},
     {"Bomba de humo",343,1,0,0.5},	 
     {"SPAZ-12 combat shotgun",351,1,90, 2.3},
     {"MP5A5",353,1,90,2.8},
     {"M14 AIM",357,1,90,3.5},
     {"AKS-74 KOBRA",355,1,90,3.8},
     {"M4A3 CCO",356,1,90,2.4},
     {"CZ 550",358,1,90,0.4},	
     {"Pala",337,1,90,1},

 --------------------------------------
 
  --- ALIMENTOS Y BEBIDAS ---
    
	{"Kiwi",2133,1,0,0.1},  
     {"Naranja",2199,1,0,0.1},
     {"Dew",2236,1,0,0.1},  
     {"Pepsi",2164,1,0,0.1},
     {"Pizza",1582,1,0,2},
     {"Coca Cola",2647,1,0,0.1},
     {"Leche",2856,1,0,1},


 --------------------------------------
 
  --- MOCHILAS DEL SERVER ---
     
	 {"Mochila Hunting",1919,1,0,2.5},	 
     {"Mochila Alice",1950,1,0,4},
     {"Mochila Taloon naranja",1667,1,0,5},
     {"Mochila Improvisada",1916,1,0,2},
     {"Mochila Coyote",1575,1,0,0.9},
     {"Mochila Child Briefcase roja",1917, 1,0,6},
	 {"Mochila Mountain roja",1918, 1,0,5},
	
 --------------------------------------
 
  --- MEDICINAS ---	
     {"Analgésico",2709,3,0,4},
     {"Morfina",1579,1,0,4},
	 {"Antidoto",1509,2.1,0,1},		
 --------------------------------------
 
  --- TRAJE CAMUFLAJE ---	
	
     {"Traje ghillie suit",1213,2,0,0.3},	
     {"Traje fuerzas especiales",1213,2,0,0.3},		 
	 },
	 
	 industrial = {

--------------------------------------

  --- HERRAMIENTAS Y UTILIDADES ---	
 	 
	 --{"Dinero", 2086,0.8,90,6},  
     {"Alambrada",933,0.25,0,7},
     {"Caja de herramientas",2969,0.5,0,3},
     {"Rueda",1073,1,0,4},
     {"Estereo",1790,1,0.8,2},		 
     {"Motor",929,0.3,0,3.5},
     {"Depósito",1008,1,0.8,4},
	 {"Rotor",14567,1.4,0,2},	 
     {"Latas vacías",2673,0.5,0,12},
     {"Pasto",874,0.5,0,10},	
     {"Mapa",1277,0.8,90,3},
     {"Reloj",2710,1,0,2},
     {"Caja de cerillas",328,0.4,90,5},
     {"Madera",1463,0.4,0,2},
     {"Bidón de gasolina vacío",1650,1,0,6},
     {"Bidón de gasolina lleno",1650,1,0,1.5},
     {"Bengala naranja",324,1,90,9},
     {"Bengala verde",324,1,90,9},
     {"Bengala amarilla",324,1,90,9},	
     {"Bengala púrpura",324,1,90,9},
     {"Dispositivo de radio",330,1,0,6},
     {"Visión nocturna",368,1,90,0.1},
	 {"Brújula",1241,1,0,1.00},	
	 {"Estabilizador antiradiación",2387,0.3,0,1},	 	
	 {"Contador geiger",2386,0.3,0,0.1}, 	 
	 {"Trampa para oso",1762,1,0,5},
	 {"Abre latas",1666,1,0,3},		
 --------------------------------------
 
  --- ALIMENTOS Y BEBIDAS ---

     {"Cantimplora de agua llena",2683,1,0,4},
     {"Lata de spaghetti (cerrada)",2770,1,0,4},
     {"Lata de spaghetti (abierta)",2770,1,0,0},	
     {"Frijoles al horno (cerrada)",2601,1,0,4},
     {"Frijoles al horno (abierta)",2601,1,0,0}, 	 
     {"Hamburguesa",2768,1,0,4},
     {"Pizza",1582,1,0,4},
     {"Leche",2856,1,0,4},
     {"Kiwi",2133,1,0,0.1},  
     {"Naranja",2199,1,0,0.1},
     {"Dew",2236,1,0,0.1},  
     {"Pepsi",2164,1,0,0.1},	
 --------------------------------------
 
  ---  ARMAS DEL SERVER ---
  
     {"Guitarra",333,1,90,1.5},
     {"Bate",336,1,90,1.5},
     {"Pala",337,1,90,1.5},	
     {"Remington 870",349,1,90,3},
     {"G17",346,1,90,1.5},
     {"PDW",352,1,90,2},
     {"Cuchillo",335,1,90,2},
     {"Hacha",339,1,90,1.5},	
	
 --------------------------------------
 
  ---  MOCHILAS DEL SERVER ---	
     
	 {"Mochila Hunting",1919,1,0,2.5},	 
     {"Mochila Sposn",1669,1,0,2.5},
     {"Mochila Dry Bag roja",1542,1,0,5.2},
     {"Mochila Taloon naranja",1667,1,0,6},
     {"Mochila Coyote",1575,1,0,0.5},
     ---{"Mochila Improvisada inicial",2221,1,0,3.5},
     {"Mochila de Asalto negra",1891,1,0,3.5},  
 --------------------------------------
 
  --- TRAJE CAMUFLAJE ---	
	
     {"Traje mujer soldado",1213,2,0,0.3},
     {"Traje mujer soldado 2",1213,2,0,0.3},
	 {"Traje militar terrorista",1213,2,0,0.3},	 
	 },
	 
	 supermarket = {
 
	
--------------------------------------

  --- HERRAMIENTAS Y UTILIDADES ---	
 	
	--{"Dinero", 2086,0.8,90,6},  
     {"Caja de cerillas",328,0.4,90,5},
     {"Madera",1463,0.4,0,5},
     {"Bidón de gasolina vacío",1650,1,0,5},
     {"Bengala roja",324,1,90,9},
     {"Bengala azul",324,1,90,9},
     {"Latas vacías",2673,0.5,0,12},
     {"Pasto",874,0.5,0,12},
     {"Reloj",2710,1,0,3},
     {"Alambrada",933,0.25,0,1},
     {"Mapa",1277,0.8,90,4},
     {"GPS",2976,0.15,0,1},
     {"Dispositivo de radio",330,1,0,6},
     {"Rueda",1073,1,0,1},
     {"Estereo",1790,1,0.8,2},		 
     {"Depósito",1008,1,0.8,2},
	 {"Brújula",1241,1,0,1.00},	
	 {"Estabilizador antiradiación",2387,0.3,0,1},	
	 {"Contador geiger",2386,0.3,0,0.1},  	 
	 {"Abre latas",1666,1,0,7},		
--------------------------------------

  --- ARMAS DEL SERVER ---
  
     {"G17",346,1,90,3.5},
     {"PDW",352,1,90,2},
     {"Cuchillo",335,1,90,3},
     {"Hacha",339,1,90,2.1},
     {"MP5A5",353,1,90,0.5},	
     {"M14 AIM",357,1,90,0.2},	
     {"Guitarra",333,1,90,1.9},
     {"Bate",336,1,90,1.4},
     {"Pala",337,1,90,0.3},
	
--------------------------------------

  --- ALIMENTOS Y BEBIDAS ---
     {"Pizza",1582,1,0,7},
     {"Leche",2856,1,0,7},
     {"Lata de spaghetti (cerrada)",2770,1,0,7},
     {"Lata de spaghetti (abierta)",2770,1,0,0},	
     {"Frijoles al horno (cerrada)",2601,1,0,7},
     {"Frijoles al horno (abierta)",2601,1,0,0},	
     {"Hamburguesa",2768,1,0,7},	
     {"Carne cruda",2804,0.5,90,8},	
--------------------------------------

  --- MOCHILAS DEL SERVER ---	
     
	 {"Mochila Hunting",1919,1,0,2.5},		
     {"Mochila Taloon naranja",1667,1,0,6},
     {"Mochila Alice",1950,1,0,0.5},
     {"Mochila Coyote",1575,1,0,0.1},	
--------------------------------------

  --- MEDICINAS ---	
	
     {"Analgésico",2709,3,0,7},
     {"Bolsa térmica",1576,5,0,6},
     {"Morfina",1579,1,0,2},
	 {"Antidoto",1509,2.1,0,1},			
--------------------------------------

  --- TRAJE CAMUFLAJE ---	
	
     {"Traje ghillie suit",1213,2,0,0.3},
     {"Traje fuerzas especiales",1213,2,0,0.3},		 
 
     },
	 
     other = { -- ES MUY IMPORTANTE QUE TODOS LOS ITEMS ESTEN AQUÍ PARA QUE APAREZCAN EN EL JUEGO.
  
 --------------------------------------

  --- ARMADURA - CASCO - MASCARA ---	
  
	 {"Casco táctico",1915,1,0,0.5},
	 {"Casco de soldador",1914,1,0,0.5},	 
	 {"Casco de bombero",2704,1,0,0.2},
	 {"Casco de motoquero",1861,1,0,0.5},
	 {"Casco de motociclista",1941,1,0,0.3},	 
	 {"Máscara de gas militar",1903,1,0,0.6},	
	 {"Máscara de gas civil",1902,1,0,0.6},	
	 {"Barbijo",1901,1,0,0.6},		 
	 {"Máscara wolf",1900,1,0,1},
	 {"Máscara dallas",2705,1,0,1.3},	
	 {"Chaleco de policia",1879,1,0,0.5},
	 {"Chaleco fuerzas especiales",1920,1,0,0.2},
	 {"Chaleco táctico",1877,1,0,0.1},
	 {"Chaleco militar",1853,1,0,0.2},	
	 {"Chaleco antidisturbios",2105,1,0,0.1},
	 {"Chaleco ejercito rojo",2106,1,0,0.2},	
--------------------------------------

  --- HERRAMIENTAS Y UTILIDADES ---	
	 
	 --{"Dinero", 2086,0.8,90,6}, 
     {"Bidón de gasolina lleno",1650,1,0},
     {"Visión nocturna",368,1,90},
     {"Visión térmica",369,1,90},
     {"Caja de cerillas",328,0.4,90,5},
     {"Madera",1463,0.4,0,5},
     {"Reloj",2710,1,0,3},
     {"Bidón de gasolina vacío",1650,1,0,5},
     {"Airdrop",324,1,90,9}, 	 
     {"Bengala roja",324,1,90,9},
     {"Bengala rosada",324,1,90,9},
     {"Bengala naranja",324,1,90,9},
     {"Bengala celeste",324,1,90,9},
     {"Bengala verde",324,1,90,9},
     {"Bengala amarilla",324,1,90,9},	
     {"Bengala púrpura",324,1,90,9},
     {"Bengala magenta",324,1,90,9},
     {"Bengala azul",324,1,90,9},
     {"Rueda",1073,1,0,1},
     {"Estereo",1790,1,0.8,2},		 
     {"Depósito",1008,1,0.8,4},
     {"Prismáticos",369,1,0,4},
     {"Dispositivo de radio",2966,0.5,0,5},
	 {"Metal",1314,1.4,0,1},
	 {"Vidrio",954,1.4,0,1},		 
     {"GPS",2976,0.15,0,1},
     {"Tienda de campaña militar",1279,1,0,0.5},
     {"Mapa",1277,0.8,90,4},
	 {"Caja de herramientas",2969,0.5,0,3},
	 {"Rotor",14567,1.4,0,2},	 
     {"Motor",929,0.3,0,3.5},
     {"Latas vacías",2673,0.5,0,12},
     {"Pasto",874,0.5,0,12},
     {"Alambrada",933,0.25,0,1},
	 {"Brújula",1241,1,0,1.00},
	 {"Estabilizador antiradiación",2387,0.3,0,1},	
	 {"Contador geiger",2386,0.3,0,0.1}, 	 
	 {"Trampa para oso",1762,1,0,5},	
	 {"Abre latas",1666,1,0,6},		
	 --{"Silenciador",1577,5,0,2},	
	 --{"Visor óptico (largo alcance)",1272,5,0,0.3},	 	 
 --------------------------------------

  --- ALIMENTOS Y BEBIDAS ---  
	 {"Kiwi",2133,1,0,1},  
     {"Naranja",2199,1,0,1},
     {"Dew",2236,1,0,1},  
     {"Pepsi",2164,1,0,1}, 
     {"Carne cruda",2804,0.5,90},
     {"Carne cocinada",2806,0.5,90},
     {"Cantimplora de agua llena",2683,1,0,4},	
     {"Cantimplora de agua vacía",2683,1,0},	
     {"Pizza",1582,1,0,7},
     {"Leche",2856,1,0,5},	
     {"Lata de spaghetti (cerrada)",2770,1,0,5},
     {"Lata de spaghetti (abierta)",2770,1,0,0},	
     {"Frijoles al horno (cerrada)",2601,1,0,6},
     {"Frijoles al horno (abierta)",2601,1,0,0},	
     {"Hamburguesa",2768,1,0,2},
     {"Coca Cola",2647,1,0,1},
	
 --------------------------------------

  --- ARMAS DEL SERVER ---
  
     {"Remington 870 cartuchos",2358,2,0},
     {"SPAZ-12 pellet",2358,2,0},
     {"MP5A5 Mag",2358,2,0},
     {"30Rnd. AK",1271,2,0},
     {"30Rnd. STANAG",1271,2,0},
     {"Cartucho G17",3013,2,0},
     {"M9SD Mun.",3013,2,0},
     {".45 ACP",3013,2,0},
     {"CZ 550 Mag",2358,2,0},
     {"DMR Mun.",2358,2,0},
     {"PDW Mag",2041,2,0},
     {"MP5A5 Mag",2041,2,0},
     {"G17",346,1,90,3.5},
     {"PDW",352,1,90,2},
     {"Cuchillo",335,1,90,2.5},
     {"Hacha",339,1,90,1.8},
     {"M14 AIM",357,1,90,1.5},
     {"MP5A5",353,1,90,1.5},
     {"Remington 870",349,1,90,2},
     {"M9 SD",347,1,90,5},
     {"Granada",342,1,0,0.5},
     {"Bomba de humo",343,1,0,0.5},	 
     {"SPAZ-12 combat shotgun",351,1,90,1.9},
     {"AKS-74 KOBRA",355, 1,90,0.9},
     {"M4A3 CCO",356,1,90,0.9},
     {"CZ 550",358,1,90,0.3},
     {"G17",346,1,90,3},
     {"Revólver",348,1,90,3},
     {"Guitarra",333,1,90,1.9},
     {"Bate",336,1,90,1.4},
     {"Pala",337,1,90,1.5},	
	
 --------------------------------------

  --- MEDICINAS ---	
	
     {"Kit médico",2891,2.2,0},
     {"Bolsa de sangre",1580,1,0},
     {"Analgésico",2709,3,0,7},
     {"Morfina",1579,1,0, 2},	
     {"Bolsa térmica",1576,5,0,6},
     {"Vendaje",1578,0.5,0,4},
	 {"Antidoto",1509,2.1,0,1},		
 --------------------------------------

  --- MOCHILAS DEL SERVER---	
    
	 {"Mochila Hunting",1919,1,0,2.5},	
     {"Mochila Taloon naranja",1667,1,0,6},
     {"Mochila Alice",1950,1,0,1.5},
     {"Mochila Coyote",1575,1,0,0.7},
     {"Mochila Dry Bag roja",1542,1,0,5.2},
     {"Mochila Sposn",1669,1,0,2.0},
     {"Mochila Improvisada",1916,1,0,2},
     {"Mochila Coyote",1575,1,0,0.1},
     {"Mochila Child Briefcase roja",1917, 1,0,0.1},
	 {"Mochila Mountain roja",1918, 1,0,0.1},	
 --------------------------------------

  --- TRAJE CAMUFLAJE ---	
	
     {"Traje ghillie suit",1213,2,0,0.3},
     {"Traje chica superviviente",1213,2,0,0.3},
     {"Traje mujer soldado",1213,2,0,0.3},
     {"Traje mujer soldado 2",1213,2,0,0.3},	
     {"Traje anti tóxico",1213,2,0,0.3},
     {"Traje militar terrorista",1213,2,0,0.3},
     {"Traje fuerzas especiales",1213,2,0,0.3},	 
     }
     }

-----------------------------------------
debug.sethook( _, h1, h2, h3 )
local h1, h2, h3 = debug.gethook() 
debug.sethook()
-----------------------------------------

		 weaponAmmoTable = {

		 ["Cartucho G17"] = {
		 {"G17", 22}
		 },
  
		 ["M9SD Mun."] = {
		 {"M9 SD", 23}
		 },
  
		 [".45 ACP"] = {
		 {"Revólver",24}
		 },
  
		 ["PDW Mag"] = {
		 {"PDW", 28}
		 },
  
		 ["MP5A5 Mag"] = {
		 {"MP5A5", 29}
		 },
  
		 ["30Rnd. AK"] = {
		 {"AKS-74 KOBRA", 30}
		 },
  
		 ["30Rnd. STANAG"] = {
		 {"M4A3 CCO", 31}
		 },
  
		 ["Remington 870 cartuchos"] = {
		 {"Remington 870",25}
		 },
  
		 ["SPAZ-12 pellet"] = {
		 {"SPAZ-12 combat shotgun",27}
		 },
  
		 ["CZ 550 Mag"] = {
		 {"CZ 550", 34}
		 },
  
		 ["DMR Mun."] = {
		 {"M14 AIM",33}
		 },
	
		 ["others"] = {	 
		 {"Paracaídas", 46},
		 {"Bomba de humo", 17},
		 {"Granada", 16},
		 {"Cuchillo",4},
		 {"Hacha", 8},
		 {"Prismáticos", 43},
		 {"Bate",5},
		 {"Guitarra", 2},
		 {"Pala", 6},
		 {"Dispositivo de radio",1}
		 }
		 }

----------------------------------------------------------------------------------------


function getWeaponAmmoType(weaponName, notOthers)
		 if not notOthers then
		 for i, weaponData in pairs(weaponAmmoTable.others) do
		 if weaponName == weaponData[1] then
         return weaponData[1], weaponData[2]
		 end
		 end
		 end
		 
		 for i, weaponData in pairs(weaponAmmoTable["Cartucho G17"]) do
		 if weaponName == weaponData[1] then
		 return "Cartucho G17", weaponData[2]
		 end
		 end
		 
		 for i, weaponData in pairs(weaponAmmoTable["M9SD Mun."]) do
		 if weaponName == weaponData[1] then
		 return "M9SD Mun.", weaponData[2]
		 end
		 end
		 
		 for i, weaponData in pairs(weaponAmmoTable[".45 ACP"]) do
		 if weaponName == weaponData[1] then
		 return ".45 ACP", weaponData[2]
		 end
		 end
		 
		 for i, weaponData in pairs(weaponAmmoTable["PDW Mag"]) do
		 if weaponName == weaponData[1] then
		 return "PDW Mag", weaponData[2]
		 end
		 end
		 
		 for i, weaponData in pairs(weaponAmmoTable["MP5A5 Mag"]) do
		 if weaponName == weaponData[1] then
		 return "MP5A5 Mag", weaponData[2]
		 end
		 end
		 
		 for i, weaponData in pairs(weaponAmmoTable["30Rnd. AK"]) do
		 if weaponName == weaponData[1] then
		 return "30Rnd. AK", weaponData[2]
		 end
		 end
		 
		 for i, weaponData in pairs(weaponAmmoTable["30Rnd. STANAG"]) do
		 if weaponName == weaponData[1] then
		 return "30Rnd. STANAG", weaponData[2]
		 end
		 end
		 
		 for i, weaponData in pairs(weaponAmmoTable["Remington 870 cartuchos"]) do
		 if weaponName == weaponData[1] then
		 return "Remington 870 cartuchos", weaponData[2]
		 end
		 end
		 
		 for i, weaponData in pairs(weaponAmmoTable["SPAZ-12 pellet"]) do
		 if weaponName == weaponData[1] then
		 return "SPAZ-12 pellet", weaponData[2]
		 end
		 end
		 
		 for i, weaponData in pairs(weaponAmmoTable["CZ 550 Mag"]) do
		 if weaponName == weaponData[1] then
		 return "CZ 550 Mag", weaponData[2]
		 end
		 end
		 
		 for i, weaponData in pairs(weaponAmmoTable["DMR Mun."]) do
		 if weaponName == weaponData[1] then
		 return "DMR Mun.", weaponData[2]
		 end
		 end
		 return false
end


----------------------------------------------------------------------------------------

						 
--function createItemPickup(item, x, y, z, tableStringName)
function createItemPickup(item, x, y, z, tableStringName, int, dim)
		 if item and x and y and z then
		 local object = createObject(itemTable[tostring(tableStringName)][item][2], x, y, z - 0.875, itemTable[tostring(tableStringName)][item][4], 0, math.random(0, 360))
		 setObjectScale(object, itemTable[tostring(tableStringName)][item][3])
		 setElementCollisionsEnabled(object, false)
		 local col = createColSphere(x, y, z, 0.75)
		 setElementData(col, "item", itemTable[tostring(tableStringName)][item][1])
		 setElementData(col, "parent", object)
		 --
		 --setElementInterior(object,int)
		 --setElementDimension(object,dim)
		 --setElementInterior(col,int)
		 --setElementDimension(col,dim)
		 --
		 setTimer(function()
		 if isElement(col) then
         destroyElement(col)
         destroyElement(object)
         end
         end, 900000, 1)
         return object
    end
end


----------------------------------------------------------------------------------------


function table.size(tab)
		 local length = 0
		 for _ in pairs(tab) do
		 length = length + 1
		 end
		 return length
end


----------------------------------------------------------------------------------------


function math.percentChance(percent, repeatTime)
		 local hits = 0
		 for i = 1, repeatTime do
		 local number = math.random(1,1000)/10
		 if percent >= number then
		 hits = hits + 1
		 end
		 end
		 return hits
end


----------------------------------------------------------------------------------------


function createItemLoot(lootPlace, x, y, z, id)
		 col = createColSphere(x, y, z, 1.25)
		 setElementData(col, "itemloot", true)  
		 setElementData(col, "parent", lootPlace)
		 setElementData(col, "MAX_Slots", 0)
		 for i, item in pairs(itemTable[lootPlace]) do
		 local value = math.percentChance(item[5], math.random(1, 2))
		 setElementData(col, item[1], value)
		 local ammoData, weapID = getWeaponAmmoType(item[1], true)
		 if ammoData and value > 0 then
		 setElementData(col, ammoData, math.random(1, 2))
		 end
		 end
		 refre:~emLoot(col,lootPlace,true)
		 return col
end


----------------------------------------------------------------------------------------

function refre:~emLoot(col,place)

		 local objects = getElementData(col,"objectsINloot")
		 if objects then
		 if isElement(objects[1])then
		 destroyElement(objects[1])
		 end	
		 
		 if isElement(objects[2])then
		 destroyElement(objects[2])
		 end
		 
		 if isElement(objects[3])then
		 destroyElement(objects[3])
		 end
		 end	 
		 
		 local counter = 0
		 local obejctItem = {}
		 for i, item in pairs(itemTable["other"]) do
		 if getElementData(col,item[1]) and getElementData(col,item[1]) > 0 then
		 if counter == 3 then
		 break
		 end	
		 counter = counter + 1
		 local x,y,z = getElementPosition(col)
		 obejctItem[counter] = createObject(item[2],x+math.random(-1,1),y+math.random(-1,1),z-0.875,item[4])
		 setObjectScale(obejctItem[counter],item[3])
		 setElementCollisionsEnabled(obejctItem[counter], false)
		 end
		 end
		 setElementData(col,"objectsINloot",{obejctItem[1], obejctItem[2], obejctItem[3]})
end
addEvent("refre:~emLoot",true)
addEventHandler("refre:~emLoot",getRootElement(),refre:~emLoot)


----------------------------------------------------------------------------------------


function createPickupsOnServerStart()
		 for i,pos in pairs(pickupPositions["residential"]) do
		 createItemLoot("residential",pos[1],pos[2],pos[3])
		 end
		 
		 for i,pos in pairs(pickupPositions["industrial"]) do
		 createItemLoot("industrial",pos[1],pos[2],pos[3])
		 end
 
		 for i,pos in pairs(pickupPositions["farm"]) do
		 createItemLoot("farm",pos[1],pos[2],pos[3])
		 end
  
		 for i,pos in pairs(pickupPositions["supermarket"]) do
		 createItemLoot("supermarket",pos[1],pos[2],pos[3])
		 end
 
		 for i,pos in pairs(pickupPositions["military"]) do
		 createItemLoot("military",pos[1],pos[2],pos[3])
		 end
end
createPickupsOnServerStart()


----------------------------------------------------------------------------------------


		 vehicleFuelTable = {
		 {593, 150},-- DODO
		 {469, 100},-- SPARROW		 
		 {487, 200},-- MAVERICK		 
		 {417, 300},-- LEVIATHAN
		 {422, 80}, -- BOB CAT
		 {470, 100},-- PATRIOT	
		 {483, 100},-- CAMPER
		 {602, 60}, -- ALPHA
		 {415, 50}, -- CHEETAH		 
		 {402, 40}, -- BUFFALO
		 {471, 30}, -- QUAD	 		 
		 {468, 25}, -- SANCHEZ
		 {522, 40}, -- NRG-500			 
		 {521, 30}, -- FCR-900	
		 {461, 35}, -- PCJ-600		 
		 {433, 160},-- BARRACKS
		 {437, 140},-- COACH
		 {541, 50}, -- BULLET
		 {527, 40}, -- CADRONA			 
		 {560, 60}, -- SULTAN	
		 {445, 40}, -- ADMIRAL			 
		 {500, 70}, -- MESA
		 {453, 175},-- BOTE REEFER
		 {568, 35}, -- BANDITO
		 {456, 120},-- YANKEE  
		 {428, 45}, -- SECURICAR 
		 {411, 50}, -- INFERNUS	
		 {562, 50}, -- ELEGY			 
		 }

----------------------------------------------------------------------------------------


function getVehicleMaxFuel(loot)
		 local modelID = getElementModel(getElementData(loot, "parent"))
		 for i, vehicle in pairs(vehicleFuelTable) do
		 if modelID == vehicle[1] then
		 return vehicle[2]
		 end
		 end
		 return false
end

----------------------------------------------------------------------------------------


function onPlayerTakeItemFromGround(itemName, col)
		 itemPlus = 1
		 if itemName == "Cartucho G17" then
		 itemPlus = 7
		 elseif itemName == "M9SD Mun." then
		 itemPlus = 15
		 elseif itemName == ".45 ACP" then
		 itemPlus = 7
		 elseif itemName == "PDW Mag" then
		 itemPlus = 30
		 elseif itemName == "MP5A5 Mag" then
		 itemPlus = 20
		 elseif itemName == "30Rnd. AK" then
		 itemPlus = 30
		 elseif itemName == "30Rnd. STANAG" then
		 itemPlus = 20
		 elseif itemName == "Remington 870 cartuchos" then
		 itemPlus = 7
		 elseif itemName == "SPAZ-12 pellet" then
		 itemPlus = 7
		 elseif itemName == "CZ 550 Mag" then
		 itemPlus = 5
		 elseif itemName == "DMR Mun." then
		 itemPlus = 10
		 elseif itemName == "Dinero" then
		 itemPlus = 100
		 elseif itemName == "M4A3 CCO" or itemName == "AKS-74 KOBRA" or itemName == "CZ 550" or itemName == "Remington 870" or itemName == "SPAZ-12 combat shotgun" or itemName == "M14 AIM" then
		 removeBackWeaponOnDrop()
		 end
		 local x, y, z = getElementPosition(source)
		 local id, ItemType = getItemTablePosition(itemName)
		 setElementData(source, itemName, (getElementData(source, itemName) or 0) + itemPlus)
		 destroyElement(getElementData(col, "parent"))
		 destroyElement(col)
end
addEvent("onPlayerTakeItemFromGround", true)
addEventHandler("onPlayerTakeItemFromGround", getRootElement(), onPlayerTakeItemFromGround)
  

----------------------------------------------------------------------------------------


function onPlayerChangeLoot(loot)
		 local players = getElementsWithinColShape(loot, "player")
		 for theKey, player in pairs(players) do
		 triggerClientEvent(player, "refreshLootManual", player, loot)
		 end
end
addEvent("onPlayerChangeLoot", true)
addEventHandler("onPlayerChangeLoot", getRootElement(), onPlayerChangeLoot)


----------------------------------------------------------------------------------------


function playerDropAItem(itemName)
		 local x, y, z = getElementPosition(source)
		 local item, itemString = getItemTablePosition(itemName)
		 --local itemPickup = createItemPickup(item, x + math.random(-1.25, 1.25), y + math.random(-1.25, 1.25), z, itemString)
		 local itemPickup = createItemPickup(item,x+math.random(-1.25,1.25),y+math.random(-1.25,1.25),z,itemString,getElementInterior(source),getElementDimension(source))
end
addEvent("playerDropAItem", true)
addEventHandler("playerDropAItem", getRootElement(), playerDropAItem)


----------------------------------------------------------------------------------------


function getItemTablePosition(itema)
		 for id, item in pairs(itemTable[tostring("other")]) do
		 if itema == item[1] then
		 return id, "other"
		 end
		 end
		 return item, itemString
end


-----------------------------------------------------------------------------------


function refre:~emLoots()
         outputChatBox("#ffaa00¡NOTIFICACIÓN! #ffffff - ¡Refrescando puntos de looteos, gracias por su paciencia!.", getRootElement(), 255, 255, 255, true)
	     --setServerPassword(tostring(math.random(999999999))..""..tostring(math.random(999999999)))       
		 for i, loots in pairs(getElementsByType("colshape")) do
         local itemloot = getElementData(loots, "itemloot")
         if itemloot then
         local objects = getElementData(loots, "objectsINloot")
         if objects then
         if objects[1] ~= nil then
         destroyElement(objects[1])
         end
         if objects[2] ~= nil then
         destroyElement(objects[2])
         end
         if objects[3] ~= nil then
         destroyElement(objects[3])
         end
         end
         destroyElement(loots)
    end
end
		 createPickupsOnServerStart()
		 setTimer(refre:~emLootPoints, gameplayVariables.itemrespawntimer, 1)
		 --setServerPassword(nil)
end


---------------------------------------------------------------------------------------


function refre:~emLootPoints()
		 local time = getRealTime()
		 local hour = time.hour
		 outputChatBox("#ff2200¡NOTIFICACIÓN! #ffffff - ¡Falta 1 minuto para que se refresquen los puntos de looteos!.", getRootElement(), 255, 255, 255, true)  
		 setTimer(refre:~emLoots, 60000, 1)
end
setTimer(refre:~emLootPoints, gameplayVariables.itemrespawntimer, 1)


---------------------------------------------------------------------------------------


addCommandHandler( "refrescar_loot", refre:~emLoots, true )

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...