Jump to content

Enargy,

Members
  • Posts

    1,102
  • Joined

Everything posted by Enargy,

  1. Linea 17: timer = setTimer (greetingCommand, 500, 1, client, PasajSuben) Borra la linea 25: local playerSource = getPlayerName( playerSource )
  2. Enargy,

    Tablas

    Por lo menos prueba el código que él hizo por ti lo cual si funciona sin probarlo....
  3. Could you try...? -- -- SERVER local object = {id = 1271, x = 1000, y = 1000, z = 200} function moveSupply(source, command) local box = createObject(object.id, object.x, object.y, object.z, 0, 0, 0) triggerClientEvent(source, "onGroundPosGot", box) end addCommandHandler("supply", moveSupply) addEvent("onBoxMove", true) addEventHandler("onBoxMove", root, function(Z) moveObject(source, 10000, object.x, object.y, Z) end ) -- -- CLIENT addEvent("onGroundPosGot", true) addEventHandler("onGroundPosGot", root, function() if isElementStreamedIn(source) then triggerServerEvent("onBoxMove", source, getGroundPosition(getElementPosition(source))) setElementData(source, "falling" true) else addEventHandler("onClientElementStreamIn", source, getGrondPosFromStreamIn) end end ) function getGrondPosFromStreamIn() if not getElementData(source, "falling") then triggerServerEvent("onBoxMove", source, getGroundPosition(getElementPosition(source))) setElementData(source, "falling" true) end end
  4. You cand find something on DxDrawTextOnElement and use getTickCount or setTimer to hide it.
  5. removeElementData(source, "dataName") -- es igual que hacer setElementData(source, "dataName", nil) Con datos pequeños me refiero a lo que quisieras almacenar como por ejemplo los booleanos, tablas, elements etc etc. Puedes usar los elementData guardar datos inclusive los que son algo pesados, como las tablas con valores dentro siempre y cuando no sincronices cliente con server y viceversa. setElementData(source, "test", {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...}, false) -- 'false' es para no sincronizar los dos sides. Aun con esto todavía sigue siendo mal optimizado porque aun cuando esta desactivado necesita que todos los clientes estén sincronizados. Mejor usa eventos para que no te consume mucho CPU y usas tablas para guardar datos.
  6. Te llega a consumir demasiado dependiendo el valor que quieres almacenar; yo lo utilizo cuando necesito guardar datos pequeños, de lo contrario si fuesen tablas o elementos uso los trigger. Con respecto al limite eso varía dependiendo del tipo de script que quieres hacer ya sea algo simple o más complicado.
  7. Puedes guiarte del código de DxDrawCircle y dibujar el circulo.
  8. if getDistanceBetweenPoints3D( tx, ty, tz, getElementPosition( v ) ) <= 8 and v ~= localPlayer then
  9. You are putting triggerEvent as a name while also is a lua function, change it. At the attached function's eventHandler add a new argument setting False.
  10. triggerServerEvent ( "addPJ", resourceRoot, me )
  11. Enargy,

    Help

    Im a little tired so try this addEventHandler("onPlayerJoin", root, function() local ip = getPlayerIP(source) fetchRemote ("http://ip-api.com/json/"..ip, setCountry, source) end ) function setCountry(data, _, player) if data ~= "ERROR" then local t = fromJSON(data) setElementData(player, "country", tostring(t.country)) end end And then with onPlayerChat event you make a for-loop and check if some player has your same country name.
  12. Enargy,

    Help

    You can use an API to get the country name by giving the player ip everytime he would join the server and then store the name using elementData. Then you have to make a loop and compare.
  13. I have already found it dude but thank you!
  14. Hello, I'm looking for a resource that is used by some dayz inventories, it draws a 3D player representation like this: So it uses some shader's implementation but unfortunately I don't handle that language. I had a couple years this script but i lost and can't even found it.
  15. function markerbelepkocsival(hitter) if hitter == localPlayer then -- if isPedIn... end end
  16. Puedes cambiar la textura del arma usando shader y colocándole una imagen transparente. Hay un resource que se llama shader_tex_names y lo puedes usar para identificar la textura de cualquier cosa y sobre el código que colocaste eso solo funcionaría con armas del createWeapon, si la quieres para las armas del jugador usa shaders
  17. Nope, if the element is in the same marker's dimension. Otherwise if you're not it would not work. addEventHandler("onVehicleEnter", root, function ( player ) if ( source == Bike1 ) then --destroyElement( mBike1 ) > is mBike1 also a variable ? if not mFirstMis then mFirstMis = createMarker ( 2495.2, -1687.3, 12.5, "cylinder", 1, 255, 0, 0, 255 ) bFirstMis = createBlip ( 2495.2, -1687.3, 12.5, 15) end end end ) addEventHandler("onPlayerMarkerHit", getRootElement(), function( marker, matchingDimension ) if (matchingDimension) then if isElement(mFirstMis) and isElement(bFirstMis) and marker == mFirstMis then destroyElement( mFirstMis ) destroyElement( bFirstMis ) mFirstMis, bFirstMis = nil, nil end end end )
  18. function Cortina1() local vehicle = getPedOccupiedVehicle( source ) if ( vehicle ) then local pos = {getElementPosition( vehicle )} local object = createObject( 1000, pos[1], pos[2], pos[3] ) attachElements( object, vehicle, 0, 0, 1, 0, 0, -90 ) end end addEvent("PonerCortina", true) addEventHandler("PonerCortina", root, Cortina1)
  19. Cambia onPlayerJoin por 'onPlayerLogin' ya que siempre te saltara false la condición si lo usas con ese evento.
  20. Enargy,

    MTA does not work

    Open your GTA SA and then MTA.
  21. Enargy,

    MTA does not work

    Try to open GTA SA which is not gonna open and then open again MTA (I always do that). This kindda problem always happend to me and I don't know how to fix it.
  22. why don not you edit attach's resources? You can add setElementDimension/Interior in the render event.
  23. local deathSoundTable = { [5] = {"The_Incredible_Coneman_Death.wav", "sound2.wav", "..."}, -- Kirby's sounds. [9] = {"sound1.wav", "sound2.wav", "..."}, -- Yoshi's sounds. } addEventHandler('onClientPlayerWasted',localPlayer, function() local model = getElementModel(localPlayer) if deathSoundTable[model] then local r = math.random(1, #deathSoundTable[model]) local sound = playSound(deathSoundTable[model][r], false) setSoundVolume(sound, 1.0) -- 1.0 is the max value. end end )
  24. if getElementModel(whodied) == kirby then --playSound(...) - kirby's death sound elseif getElementModel(whodied) == cat then --playSound(...) - cat's death sound end
×
×
  • Create New...