Jump to content

Enargy,

Members
  • Posts

    1,102
  • Joined

Everything posted by Enargy,

  1. Wrong, To make that, you can attach a colshap to ped or create a marker and attach it to the ped and set it invisible. Then use these functions in below: createMarker dxDrawText bindKey unbindKey showCursor --events: onMarkerHit onMarkerLeave It isn't wrong, you do this with functions that I have mentioned.
  2. getDistanceBetweenPoints2D bindKey guiSetVisible showCursor
  3. Dentro de esa misma funcion pon esto y fijate si te tira error o si son textos diferentes outputChatBox(getElementData(source,"gang").. " / "..getElementData(source,"gang"))
  4. Pues usas eso para saber si source es un elemento, el evento tiene predefinido a source como al elemento que en este caso es player que recibe el daño. El error debe ser al momento de retornar algún dato en la parte de getElementData ó que el meta no esté correcto.
  5. Es lo mismo. @Dokitoh sabes si algún elemento tiene un dato?
  6. O simplemente %D, quita todo lo que no sean números No sabia eso . Gracias
  7. addEventHandler ("onClientGUIChanged", --[[ Aqui el memo ]]--, function( ) guiSetText ( source, string.gsub ( guiGetText(source), "%p", "" )) guiSetText ( source, string.gsub ( guiGetText(source), "%s", "" )) guiSetText ( source, string.gsub ( guiGetText(source), "%a", "" )) end )
  8. También puede servirte. addEventHandler("onVehicleDamage", getRootElement(), function() if getElementModel(source) == 470 and not isVehicleDamageProof(source) then setVehicleDamageProof(source, true); fixVehicle(source); end end )
  9. Good job. deberías de publicarlo también en la sección Ingles porque aquí no hay una cantidad abundante de personas .
  10. function buttonPick() if (source == Button_VS_sn) then local v = getPedOccupiedVehicle(localPlayer) if v then local x, y, z = getElementPosition(v) local vehicleZoneName = getZoneName(x, y, z) guiSetText(Label_Zone, "", tostring(vehicleZoneName)) end end end addEventHandler("onClientGUIClick", guiRoot, buttonPick)
  11. function setData(player,_,who) if who then who = getPlayerFromPartialName(tostring(who)); if who then if getElementData(player, "team1") ~= true then setElementData(player, "team1", true) return true; end return false; end return false; end return false; end addCommandHandler("setpoli", setData) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end
  12. You must get the element-data and put it at dxDrawText as string. dxDrawText(tostring(getElementData (target,"pvpmoney")) or "0", x ,y ,w, h)
  13. Es porque como no hay un atacante te da ese error. Primero verifica si el atacante exista para que no te de ese error if attacker and attacker ~= source then -- getElementData(...) end
  14. Dos teams con el mismo nombre? lo ideal sería hacer esto mismo https://forum.multitheftauto.com/viewtopic.php?f=145&t=96102 en el que ha participado usted, pero no se porqué no me va, ni me aparece ningún error, no se si es porque estoy usando una versión dayz, o porque solo funciona una vez que ejecutes el script y posteriormente crees la gang. Si no hay solución para esta versión de dayz, pues la idea era que cuando se cree un grupo, se cree tambien un equipo con el mismo nombre, porque en dayz, recuerdo que solo existen dos grupos (zombies, players), de modo que el tema de equipos pues conviene usar la gang. Saludos En ese mismo topic postee un código que es parecido al de alex17. Nose como esta estructurado dayZ pero por creo que el gm no tiene que ver, Tanto localPlayer y attacker deben tener el mismo valor pero a excepción del "None". Trata de usar el código que postee allí pero en la condicional if colocas esto: if ( myself == otherguy and not myself == "None" ) then
  15. Dos teams con el mismo nombre?
  16. You are missing an 'end'.
  17. fps = math.floor(1 / msSinceLastFrame) * 1000
  18. Te esta dando un valor nulo. postea la parte del cliente.
  19. function getPVPMoney (target) if getElementType(target) ~= "player" then return end return getElementData (target,"pvpmoney") or 0 -- if anyone has not the data it'll return 0. end
  20. I don't really understood, are you trying this? setElementPosition( vehicle, tonumber(fX)+1,tonumber(fY)+1,tonumber(fZ)+1 )
  21. Que el error sólo aparecerá si todos los argumentos están 'mal', por ejemplo aquí: arg1 = false arg3 = false print( (type(arg1) ~= "string" and not arg2 and type(arg3) ~= "string") and "y" or "n" ) --> y Hay sólo un valor correcto y de todos modos pasa la condición, la solución sería esta: if ( type(arg1) ~= "string" or not arg2 or type(arg3) ~= "string" ) then ... error ... Lo había puesto así pero tuve un error en el source y borre todo y lo puse así. De todos modos gracias. Editado.
  22. No entendi , como asi?
  23. table = {} _addEventHandler = addEventHandler function addEventHandler(arg1, arg2, arg3, arg4) if type(arg1) ~= "string" or not arg2 or type(arg3) ~= "function" or type(arg4) ~= "string" then error("@addEventHandler [Error en la sintaxis]") end table[tostring(arg4)] = type(arg4) == "string" _addEventHandler(arg1, arg2, arg3) end _removeEventHandler = removeEventHandler function removeEventHandler(arg1, arg2, arg3) if type(arg1) ~= "string" or not arg2 or type(arg3) ~= "string" then error("@removeEventHandler [Error en la sintaxis]") end for i,v in ipairs(getEventHandlers(arg1, arg2)) do if table[arg3] then _removeEventHandler(arg1, arg2, v) break end end end Lo que hice en el addEventHandler fue agregar un cuarto valor que me permite darle una id al evento. En el tercer parametro de removeEventHandler en lugar de pedir que una tal función sea eliminado por un nombre, la id que se le dió en la función anterior va a ser una key. Ejemplo: -- aquí hago que la función sea directamente la key. addEventHandler("onClientRender", root, function() outputChatBox("Output!") end, "spamming") -- "spamming" es el nombre que le doy al evento. -- y aqui elimino el evento. addCommandHandler("stopspam", function() removeEventHandler("onClientRender", root, "spamming") -- "spamming" es el supuesto nombre del evento. outputChatBox("Spam detenido.") end)
  24. Booleans are not an avaible values as parameters I guess.
×
×
  • Create New...