-
Posts
1,673 -
Joined
-
Last visited
-
Days Won
6
Everything posted by 0xCiBeR
-
Definiste mal el sonido en stopSound. Ponelo asi: local messageTimer local messageCount = 0 sound = playSound("sonido.mp3") function stopSonido() stopSound(sound) end addEventHandler("onClientPlayerSpawn", root, stopSonido)
-
Te falta un END al final que cierra la funcíon PD: Con el tema de tu error, no se porque sera, ya que lo defines bien al principio del script..Posiblemente sea el END ese que te falta aunque no lo creo. Proba así: function playerGetDamageDayZ(attacker, weapon, bodypart, loss) cancelEvent() damage = 100 headshot = false if weapon == 37 then return end if getElementData(attacker, "zombie") then setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - gameplayVariables.zombiedamage) local number = math.random(1, 7) if number == 4 then setElementData(getLocalPlayer(), "bleeding", getElementData(getLocalPlayer(), "bleeding") + math.floor(loss * 10)) end end if weapon == 49 then if loss > 30 then setElementData(getLocalPlayer(), "brokenbone", true) playSound( 'sounds/brokenbone.mp3' ) setControlState("jump", true) setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - math.floor(loss * 10)) end setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - math.floor(loss * 5)) elseif weapon == 63 or weapon == 51 or weapon == 19 then setElementData(getLocalPlayer(), "blood", 0) if getElementData(getLocalPlayer(), "blood") <= 0 and not getElementData(getLocalPlayer(), "isDead") == true then triggerServerEvent("kilLDayZPlayer", getLocalPlayer(), attacker, headshot) end elseif weapon and weapon > 1 and attacker and getElementType(attacker) == "player" then do local number = math.random(1, -- s8) --> if number >= 6 or number <= 8 then setElementData(getLocalPlayer(), "bleeding", getElementData(getLocalPlayer(), "bleeding") + math.floor(loss * 10)) end local number = math.random(1, 7) if number == 2 then setElementData(getLocalPlayer(), "pain", true) end damage = getWeaponDamage(weapon) if bodypart == 9 then damage = damage * 1.5 headshot = true end if bodypart == 7 or bodypart == 8 then setElementData(getLocalPlayer(), "brokenbone", true) playSound( 'sounds/brokenbone.mp3' ) end playRandomHitSound() setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - math.random(damage * 0.75, damage * 1.25)) -- ACA EL ERROR if not getElementData(getLocalPlayer(), "bandit") then setElementData(attacker, "humanity", getElementData(attacker, "humanity") - math.random(40, 200)) if 0 > getElementData(attacker, "humanity") then setElementData(attacker, "bandit", true) end else setElementData(attacker, "humanity", getElementData(attacker, "humanity") + math.random(40, 200)) if getElementData(attacker, "humanity") > 5000 then setElementData(attacker, "humanity", 5000) end if getElementData(attacker, "humanity") > 2000 then setElementData(attacker, "bandit", false) end end if getElementData(getLocalPlayer(), "blood") <= 0 and not getElementData(getLocalPlayer(), "isDead") then triggerServerEvent("kilLDayZPlayer", getLocalPlayer(), attacker, headshot, getWeaponNameFromID(weapon)) setElementData(getLocalPlayer(), "isDead", true) end end elseif weapon == 54 or weapon == 63 or weapon == 49 or weapon == 51 then setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - math.random(100, 1000)) local number = math.random(1, 5) if loss > 30 then setElementData(getLocalPlayer(), "brokenbone", true) playSound( 'sounds/brokenbone.mp3' ) setControlState("jump", true) end if loss >= 100 then setElementData(getLocalPlayer(), "blood", 49) setElementData(getLocalPlayer(), "bleeding", 50) end local number = math.random(1, 11) if number == 3 then setElementData(getLocalPlayer(), "pain", true) end if getElementData(getLocalPlayer(), "blood") <= 0 and not getElementData(getLocalPlayer(), "isDead") == true then triggerServerEvent("kilLDayZPlayer", getLocalPlayer(), attacker, headshot, getWeaponNameFromID(weapon)) setElementData(getLocalPlayer(), "isDead", true) end end end end addEventHandler("onClientPlayerDamage", getLocalPlayer(), playerGetDamageDayZ)
-
es /givevip [CUENTA DEL DUEÑO DE CLAN] [CANTIDAD DE SLOTS A AGREGAR Ej: Tienes 12 slots, y aca pones 10, el valor final de los slots es 22]
-
Lo habran limitado, con un sistema propio y usando tus exports capaz? e.e No es algo muy dificil de hacer..
-
En dayZ si lo limitaron, El comando es: /givevip >
-
Si, aunque le erraste en el argumento de tu segundo evento..Seria asi: --SAVE ITEMS VIP function saveitems () local Items = getElementData(source, "Iitemss") local account = getPlayerAccount(source) setAccountData(account,"Iitemss",Items) end addEventHandler ( "onPlayerQuit", getRootElement(), saveitems ) --LOAD ITEMS VIP function loaditems () local account = getPlayerAccount(source) local Items = getAccountData(account, "Iitemss") setElementData(source,"Iitemss",Items) end addEventHandler ( "onPlayerLogin", getRootElement(), loaditems ) Felicidades
-
Usa: --Para guardar onPlayerQuit getElementData getPlayerAccount setAccountData --Para volver a dar onPlayerLogin getPlayerAccount getAccountData setElementData O puedes usar SQL para almacenar.
-
Example script added..
-
OMG, use your brains..Every one knows the only way to draw anything in dx is using onClientRender. Anyway added to requiered stuff Besides, i'm not the creator.And the wiki is free to edit..So, if you want to make an example, edit it.I just gave the basics on using it. @Renkon you are right, missed the order in the template..Thanks!
-
This is a usfull function created by Bc# and posted in the spanish forums. I translated it and Add it to the wiki All credits go to Bc# dxDrawAnimWindow
-
Con mi script, solucione ese error. PD: si es un problema con boolean, prueba esto: function repair ( ) setElementData(source,"Iitemss",true) end addEventHandler ( "onPlayerSpawn", getRootElement(), repair )
-
Me parecio una buena funcion y por lo tanto la agregue a la wiki de MTA.. Link de Usfull Functions https://wiki.multitheftauto.com/wiki/Useful_Functions Link directo: https://wiki.multitheftauto.com/wiki/DxDrawAnimWindow Gracias Bc# por tu funcíon
-
Ayuda, ya no sé q hacer
0xCiBeR replied to Alvaro_Es's topic in Ayuda relacionada al cliente/servidor
Si en estos dias actualizaste a una de las versiones nightly lo mas probable recibiste el crash que recibieron muchisimos incluyendome..La solucion es re-instalar MTA..Que por lo que veo, no has hecho.. Te recuerdo que si no queres volver a descargar todos los resources de los servidores, puedes hacer una copia de los mismos para luego volver a colocarlos en la instalacion nueva de MTA.. Saludos -
Problemas al abrir PUERTOS
0xCiBeR replied to Mr.Balp's topic in Ayuda relacionada al cliente/servidor
Seguro colocaste bien tu IP local=?.. A simple vista y sin ver los *** tu ip externa esta mal..Eso corresponde a una IP Local mas bien..por ahi estoy equivocado Para que te ayudemos, dinos al menos el modelo del modem -
Prueba esto:(Inicia el resource, reconnecta,date spawn y dime si te va) function Restart ( ) setElementData(source,"Iitemss",0) end addEventHandler ( "onPlayerWasted", getRootElement(), Restart ) addEventHandler ( "onPlayerSpawn", getRootElement(), Restart )
-
Ya capte..Gracias solid function obtenerDatos(jugador) local cuenta = getPlayerAccount( jugador ) local datos = getAllAccountData( cuenta ) for k,v in pairs ( datos ) do outputChatBox(k..": "..v) end return datos end
-
Ninguno Tenia algunos pero ya los corregi..Ese script no da errores
-
Gracias de antemano --NEMEORIGINAL local hillRadar = createRadarArea ( 2520.1318359375, -953.83752441406, 200, 200, 181, 0, 0, 255 ) setElementData (hillRadar, "zombieProof", true) function neme ( ) nemesi = exports [ "slothBot" ]:spawnBot ( 2622.4934082031, -847.33459472656, 75.048431396484, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) setElementModel ( nemesi, 312 ) setElementData (nemesi, "boss", true) outputChatBox ("#9E0000Nemesis Containment Alert!",getRootElement(), 255, 255, 255, true ) local myBlip = (createBlipAttachedTo ( nemesi, 0 )) exports.extra_health:setElementExtraHealth(nemesi, 1000) end addEventHandler("onResourceStart", resourceRoot, neme) --NEMEUNO function nemeuno ( ) nemeuno = exports [ "slothBot" ]:spawnBot ( 2619.4934082031, -847.33459472656, 75.048431396484, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) setElementModel ( nemeuno, 312 ) setElementData (nemeuno, "boss", true) exports.extra_health:setElementExtraHealth(nemeuno, 1000) end addEventHandler("onResourceStart", resourceRoot, nemeuno) --AGREGADOS function money (theKiller) if getElementData(source,"boss")==true then local premio = math.random(1000,5000) local oldZcount = getElementData ( theKiller, "ZombKill" ) setElementData ( theKiller, "ZombKill", oldZcount+25 ) givePlayerMoney(theKiller,premio) outputChatBox ( getPlayerName ( theKiller ) .. " #081DBFMato al Boss!, Ha Ganado $".. premio .." como recompensa y #66000025 Zombie Kill",getRootElement(), 255, 255, 255, true ) if source == nemesi then setTimer(neme, 16000, 1) end if (not isElement(nemeuno)) then setTimer(nemeuno, 16000, 1) end end end addEvent("onBotWasted", true) addEventHandler("onBotWasted", getRootElement(), money)
-
No estaria mal si agregas getPlayerName y listo..Por favor deja de decir que esta mal..Solo le faltaba una funcion.: @Sergio, de nada Client: function Kick() showCursor ( true ) local Kicked = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) local reason = guiGetText (GUIEditor.edit[1]) local jugador = getPlayerFromName(Kicked) triggerServerEvent ("Kick1", localPlayer, reason, jugador) end Server: addEvent("Kick1", true) addEventHandler("Kick1", root, function ( reason, Kicked ) if ( hasObjectPermissionTo ( source, "function.kickPlayer" ) ) then kickPlayer ( Kicked, source, reason ) local nombre = getPlayerName(Kicked) for _, player in ipairs ( getElementsByType ( "player" ) ) do outputChatBox ( "* " .. nombre .. " Fue Kickeado (Razon: ".. reason ..") *", player, 255, 0, 0, true ) end end end )
-
Vale asi: function obtenerDatos(jugador) local cuenta = getPlayerAccount( jugador ) local datos = getAllAccountData( cuenta ) return datos for k,v in pairs ( datos ) do outputChatBox(k..": "..v) end end
-
Cambia esto: function Kick() showCursor ( true ) local Kicked = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) local reason = guiGetText (GUIEditor.edit[1]) triggerServerEvent ("Kick1", localPlayer, Kicked, reason) end Por esto: function Kick() showCursor ( true ) local Kicked = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) local reason = guiGetText (GUIEditor.edit[1]) local jugador = getPlayerFromName(Kicked) triggerServerEvent ("Kick1", localPlayer, reason, jugador) end
-
Bueno estoy creando un sistema de Exports para simplificar las cosas con mi servidor. Esto estaria bien? PD: Obiamente Jugador lo defino cuando mando el export function obtenerDatos(jugador) local cuenta = getPlayerAccount( jugador ) local datos = getAllAccountData( cuenta ) for k,v in pairs ( datos ) do outputChatBox(k..": "..v) return k,v end end
-
Para el de 50p: https://forum.multitheftauto.com/viewtopic.php?f=91&t=55423&p=543576