Jump to content

Alexs

Members
  • Posts

    2,869
  • Joined

  • Last visited

Everything posted by Alexs

  1. 'MTA San Andreas 1.3\server\mods\deathmatch\resources(\[gameplay])\gps\MinHeap.lua': MinHeap = {} MinHeap.__index = MinHeap local floor = math.floor function MinHeap.new() return setmetatable({ n = 0 }, MinHeap) end function MinHeap:insertvalue(num) self[self.n] = num self.n = self.n + 1 local child = self.n - 1 local parent, temp while child > 0 do parent = floor((child - 1)/2) if self[parent] <= self[child] then break end temp = self[parent] self[parent] = self[child] self[child] = temp child = parent end return true end function MinHeap:findindex(num, root) root = root or 0 if root >= self.n or num < self[root] then return false end if num == self[root] then return root end return self:findindex(num, root*2 + 1) or self:findindex(num, root*2 + 2) end function MinHeap:deleteindex(index) if index < 0 or index >= self.n then return false end local deleted = self[index] self[index] = self[self.n-1] self[self.n-1] = nil self.n = self.n - 1 local parent = index local child, temp while true do child = parent*2 + 1 if child >= self.n then break end if child < self.n - 1 and self[child+1] < self[child] then child = child + 1 end if self[parent] <= self[child] then break end temp = self[parent] self[parent] = self[child] self[child] = temp parent = child end return deleted end function MinHeap:deletevalue(num) local index = self:findindex(num) if not index then return false end return self:deleteindex(index) end function MinHeap:size() return self.n end function MinHeap:empty() return self.n == 0 end function MinHeap:__tostring(index, depth) index = index or 0 depth = depth or 0 if index >= self.n then return '' end return (' '):rep(depth) .. tostring(self[index]) .. '\n' .. self:__tostring(index*2+1, depth+1) .. self:__tostring(index*2+2, depth+1) end
  2. MinHeap = {} MinHeap.__index = MinHeap function MinHeap.new() return setmetatable({n = 0}, MinHeap) end function MinHeap:__tostring(index, depth) index = index or 0 depth = depth or 0 if index >= self.n then return "" end return (" "):rep(depth) .. tostring(self[index]) .. "\n" .. self:__tostring(index * 2 + 1, depth + 1) .. self:__tostring(index * 2 + 2, depth + 1) end Es un error bastante sencillo, deberías intentar hacer tus propias funciones para evitarlos.
  3. El Sub-foro correcto es 'Ayuda relacionada al cliente/servidor', y para actualizarlo (según entiendo) debes reemplazar las librerías (DLL en Windows y SO en Linux).
  4. --[[ Copyright (c) 2010 MTA: Paradise This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ]] local skins = { male = { black = { 0, 7, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 28, 51, 66, 67, 79, 80, 83, 84, 102, 103, 104, 105, 106, 107, 134, 136, 142, 143, 144, 156, 163, 166, 168, 176, 180, 182, 183, 185, 220, 221, 222, 249, 253, 260, 262 }, white = { 23, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 43, 44, 45, 46, 47, 48, 49, 50, 52, 57, 58, 59, 60, 61, 62, 68, 70, 71, 72, 73, 78, 81, 82, 94, 95, 96, 97, 98, 99, 100, 101, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 132, 133, 135, 137, 146, 147, 153, 154, 155, 158, 159, 160, 161, 162, 164, 165, 167, 170, 171, 172, 173, 174, 175, 177, 179, 181, 184, 186, 187, 188, 189, 200, 202, 203, 204, 206, 209, 210, 212, 213, 217, 223, 227, 228, 229, 230, 234, 235, 236, 239, 240, 241, 242, 247, 248, 250, 252, 254, 255, 258, 259, 261, 264 } }, female = { black = { 9, 10, 11, 13, 63, 69, 76, 139, 148, 190, 195, 207, 215, 218, 219, 238, 244, 245, 256, }, white = { 12, 31, 38, 39, 40, 41, 53, 54, 55, 56, 64, 75, 77, 85, 87, 88, 89, 90, 91, 92, 93, 129, 130, 131, 138, 140, 141, 145, 150, 151, 152, 157, 169, 178, 191, 192, 193, 194, 196, 197, 198, 199, 201, 205, 211, 214, 216, 224, 225, 226, 231, 232, 233, 237, 243, 246, 251, 257, 263 } } } local skins_ = { } local skins__ = { } for k, v in pairs( skins ) do for k2, v2 in pairs( v ) do for _, skin in ipairs( v2 ) do table.insert( skins_, skin ) skins__[ skin ] = { gender = k, color = k2 } end end end table.sort( skins_ ) function getSkins( ) return skins_ end function isValidSkin( skin ) return skin and skins__[ skin ] and true or false end function getSkinDetails( skin ) return isValidSkin( skin ) and skins__[ skin ] end addEventHandler( 'onPlayerSpawn', root, function() local model = getElementModel( source ) setPedWalkingStyle( source, skins_[model] and skins_[model].gender == 'female' and 55 or 0 ) end ) Intenta así.
  5. chat_range=100 results = { "lo logra.", "no lo logra." } function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function publicIntentar ( source, cmd, ... ) if ... then local message = table.concat ( { ... }, " " ) for _,v in ipairs(getElementsByType("player")) do local px, py, pz = getElementPosition( source ) if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox ( getPlayerName(source).." intenta "..message.." y "..results[math.random( 1, #results )], v, 0, 255, 95, true ) end end else outputChatBox ( "Syntax /intentar [texto IC]'", source, 15, 255, 0, false ) end end addCommandHandler ( "intentar", publicIntentar )
  6. Un consejo, destruir los vehículos haría que al poco tiempo estos se acaben y tendrías que volver a crearlos. Intenta mejor detener su avance o respawnearlos.
  7. chat_range=100 results = { "lo logra.", "no lo logra." } function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function publicIntentar ( source, cmd, ... ) if ... then local message = table.concat ( { ... }, " " ) for _,v in ipairs(getElementsByType("player")) do local px, py, pz = getElementPosition( source ) if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox ( getPlayerName(source).." intenta "..message.." y "..results[math.random( 1, #results )], root, 0, 255, 95, true ) end end else outputChatBox ( "Syntax /intentar [texto IC]'", source, 15, 255, 0, false ) end end addCommandHandler ( "intentar", publicIntentar ) Intenta eso.
  8. Alexs

    Scoreboard

    Sobre lo primero, si es la dxscoreboard (creo que es la scoreboard predeterminada ahora), desde el panel de administración, en la pestaña resources puedes cambiarlo y hacer que los colores se vean.
  9. Si lo que almacenas es sencillo, puedes usar XML o un archivo sencillo, si es mas complejo utiliza lo que dijo @Renkon.
  10. Puedes usar 'createElement' y asignarle datos con 'setElementData' o optar por lo simple y usar una variable.
  11. No se si existe algún comando, pero puedes utilizar 'removeAccount' para hacerlo vía script o con el runcode.
  12. Eso es que el AntiCheat del MTA te detecto algún tipo de trainer: https://wiki.multitheftauto.com/wiki/Anti-cheat_guide
  13. ¿Intentaste reinstalar MTA? Quizá en esta sección te puedan ayudar: viewforum.php?f=104
  14. Seria mas eficiente usar un boolean y no un string al definir si la 'puerta' y el 'elevador' esta en una posición u otra.
  15. Publicaste esto hace 6 horas, muy pronto para insistir. viewtopic.php?f=147&t=67170
  16. No existe una manera de evitar los ataques DDoS, pero si de combatirlos, esta claro que se refiere a que se esfuerzan mas en combatirlos en los planes de mayor precio. *Si no aportaras nada productivo sobre SawHost, deberías evitar seguir comentando en este post.
  17. Deberías leer un poco mas sobre estos temas antes de hablar, si no, acabas haciendo el ridículo.
  18. Creo que significa que los DDoS son inevitables, pero si se esfuerzan mas en combatirlos en los planes mas costosos.
  19. 200 de ping es mucho mas bajo que en empresas de precios mas altos y con mucha mas antigüedad.
  20. ¿Error en el debug al cargar el recurso o al presionar el botón?
  21. Solo es un problema con los end, intenta esto: chat_range = 100 -- Distancia function engineSwitch () if (isPedInVehicle (source)) then local veh = getPedOccupiedVehicle (source) if (getVehicleEngineState (veh) == true) then setVehicleEngineState (veh, false) local px,py,pz = getElementPosition(source) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox ("*".. getPlayerName(source) .." ah apagado el Vehiculo.", v, 255, 40, 80) elseif (getVehicleEngineState (veh) == false) then setVehicleEngineState (veh, true) local px,py,pz = getElementPosition(source) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox ("*".. getPlayerName(source) .." ah encendido el Vehiculo.", v, 255, 40, 80) end end end else outputChatBox ("You aren't in a vehicle!", source, 255, 0, 0) end end end end addEvent("engenieSwitch",true) addEventHandler("engenieSwitch",getRootElement(),engineSwitch) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5 <= range end
  22. Ni yo ni @Renkon damos soporte, yo solo soy cliente... y que yo sepa esto no tiene nada que ver con FirezHost, de otros datos no tengo casi ni idea. PD: Te aconsejo informarte mejor para la próxima, supongo que solo vienes a insultarles por gusto y ya, como siempre haces. Ahora que si te molestan mis galletas, tu y tus 131 posts pueden joderse con total tranquilidad.
  23. No quiero entrar en discusiones pero yo no llamaría a Vortex Servers un 'host de calidad.'
×
×
  • Create New...