Jump to content

aka Blue

Members
  • Posts

    2,106
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by aka Blue

  1. Básicamente quiero hacer el almacenamiento de varios tipos de daños al jugador. Esto: local daños = { } -- 3 = Torso -- 4 = Culo -- 5 = Brazo izquierdo -- 6 = Brazo derecho -- 7 = Pierna izquierda -- 8 = Pierna derecha -- 9 = Cabeza local armasNormales = { -- Puño [0] = true, -- Puño americano [1] = true, -- Palo de golf [2] = true, -- Porra [3] = true, } addEventHandler ( "onPlayerDamage", getRootElement ( ), function ( attacker, weapon, bodypart, loss ) local vida = getElementHealth ( source ) if armasNormales [ getPedWeapon ( attacker ) ] == weapon then if bodypart == 3 then setElementHealth ( source, vida - 3 ) daños [ source ] = { torso = 1, culo = 0, bI = 0, bD = 0, pI = 0, pD = 0, cabeza = 0 } outputChatBox ( "(( Has sido golpeado en el torso. ))", source, 255, 255, 0 ) end end end )
  2. Ya, pero mi pregunta fue la extracción de una tabla si la misma se guarda así: tablaValores [ p ] = { valor = valor, valor1 = valor1, valor2 = valor2 } ¿Tengo que usar toJSON o fromJSON para almacenarla y después sacarla mediante un loop o cómo?
  3. Try this: function vipPayDay ( ) for k, player in ipairs ( getElementsByType ( 'player' ) ) do local account = getAccountName ( getPlayerAccount ( player ) ) local amount = math.random ( 100 ) if isObjectInACLGroup ( "user." .. account, aclGetGroup ( "V.İ.P" ) ) then givePlayerMoney ( player, amount ) outputChatBox ( "*------------ V.İ.P BONUS ------------*", player, 142, 6, 0) outputChatBox ( " #00ff00"..amount.." $ ", player, 255, 255, 255, true ) end end end
  4. Es que son valores pequeños. Básicamente 1 o 0 y creo que estaría mejor hacerlo con tablas para no petar todo con elementData .
  5. Quiero almacenar varios datos de un jugador en una tabla y después sacarlos en otro script mediante un trigger o función exportable.
  6. You need to use shaders. And for remove CJ's head, setPedHeadless and remove the blood.
  7. Bueno, quiero hacer que una tabla normal almacene varios datos de un jugador y que, al triggearla, saque dichos valores y los pueda usar (los valores en éste caso son numéricos, pero vamos, podrían ser un string también). ¿Debo usar un simple for o debo realizar algo con lo que viene siendo toJSON y fromJSON? Aquí dejo un ejemplo de lo que quiero hacer: local tablaValores = { } addCommandHandler ( "comando", function ( p, cmd, valor, valor1, valor2 ) local valor = tonumber ( valor ) local valor1 = tonumber ( valor1 ) local valor2 = tonumber ( valor2 ) if valor and valor1 and valor2 then tablaValores [ p ] = { valor = valor, valor1 = valor1, valor2 = valor2 } triggerServerEvent ( "onEnviarValores", p, tablaValores [p], p ) outputChatBox ( "¡Valores cambiados!" ) end end ) addEvent ( "onEnviarValores", true ) addEventHandler ( "onEnviarValores", getRootElement ( ), function ( tabla, jugador ) outputChatBox ( "Valores del jugador "..jugador ) -- Y de aquí sacar los valores y almacenarlos en una variable end )
  8. But, ¿where can i find the model? I search on Google but nothing.
  9. ¿Can you convert VCS vehicles to GTA SA? https://www.google.com/url?sa=i&rct=j&q ... 7444238467
  10. Ps no entiendo que pasa .
  11. Ese es el código cliente.
  12. Nada, sigue sin funcionar. Aquí mi código cliente: saco1 = createObject ( 1985, 140.351, 2510.98, 18.9705 ) saco2 = createObject ( 1985, 139.841, 2516.55, 18.9399 ) setElementDimension ( saco1, 15 ) setElementDimension ( saco2, 15 ) setElementInterior ( saco1, 0 ) setElementInterior ( saco2, 0 ) local function testNonStreamableObjects() setElementStreamable ( saco1, false ) setElementStreamable ( saco2, false ) end addEventHandler ( "onClientResourceStart", resourceRoot, testNonStreamableObjects ) function outputLoss(loss) if isElementStreamable ( source ) then local oldHealth = getElementHealth(source) setTimer(function() local newHealth = getElementHealth(source) outputChatBox("Real loss: "..(newHealth-oldHealth)) outputChatBox("Theoretical loss: "..loss) end,100,1) end end addEventHandler("onClientObjectDamage", root, outputLoss)
  13. ¿Dou you mean this? setAccountData
  14. No entendí, ¿qué evento debo usar entonces? pd:
  15. Me da éste error: contains invalid version strings.
  16. Tengo la última versión, no sé.
  17. Sigue sin ir, no lo entiendo. local x, y = guiGetScreenSize ( ) local golpes = 0 function dxDrawTextAllResolutions (v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) dxDrawText(v1, v2/1280*x, v3/800*y, v4/1280*x, v5/800*y, v6, v7/1280*x, v8, v9, v10, v11, v12, v13, v14, v15) end function render ( ) addEventHandler ( "onClientRender", getRootElement ( ), dibujarTest ) end function dibujarTest ( ) dxDrawTextAllResolutions("Llevas "..golpes.." golpes", 500, 703, 614, 694, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawTextAllResolutions("Llevas "..golpes.." golpes", 500, 700, 614, 694, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) end function pegar ( loss, attacker ) outputChatBox ( "hey" ) render ( ) end addEventHandler ( "onClientObjectDamage", root, pegar )
  18. Mmmm, sigue sin funcionar. function pegarVentana ( _, current ) if ( current ) then if ( getElementType ( current ) == "object" and getElementModel ( current ) == 2900 ) then outputChatBox ( "ola" ) end end end addEventHandler ( "onPlayerContact", getRootElement(), pegarVentana )
  19. Bueno, lo que quiero hacer es que al darle un golpe a x objeto, realice una función. Estoy intentando actualmente con onPlayerDamage pero no funciona. Gracias function golpeObjeto ( attacker, weapon, _, _ ) if weapon == 0 then if getElementType ( source ) == "object" and getElementModel ( source ) == 2001 then outputChatBox ( "s" ) end end end addEventHandler ( "onPlayerDamage", getRootElement (), golpeObjeto )
×
×
  • Create New...