Jump to content

Anti-fuegoamigo


Dokitoh

Recommended Posts

Pega esto dentro de la funcion playerGetDamageDayZ

local migp = getElementData( getLocalPlayer(  ), ( "Group" or "gang" )) 
    local atgp = getElementData( attacker, ( "Group" or "gang" )) 
    if atgp and migp ~= "N/A" then  
        if atgp == migp then return end 
    end 

Link to comment
Me he tomado la libertad de tomarme un ligero descanso, he seguido intentando hacer este script pero sigue sin haber resultado alguno, he conseguido que no me salga ningún error, pero aun así no funciona. Yo creo que tiene bastante que ver el elemento attacker.

Postea el meta

Meta del modo dayz.

  
<meta> 
    <info author="Dokitoh" description="MTA:DayZ - DayZ for MTA" version="0.6" type="gamemode" /> 
    <script src="editor_server.lua" type="server" /> 
    <script src="editor_client.lua" type="client" /> 
    <script src="pickups.lua" type="server" /> 
    <script src="spawn.lua" type="server" /> 
    <script src="vehicle_spawns.lua" type="server" /> 
    <script src="survivorSystem.lua" type="server" /> 
    <script src="animals.lua" type="server" /> 
    <script src="weather.lua" type="server" /> 
    <script src="zombies.lua" type="server" /> 
    <script src="login.lua" type="server" /> 
    <script src="tools/jq_server.lua" type="server" /> 
    <script src="menu_client.lua" type="client" /> 
    <script src="inventory.lua" type="client" /> 
    <script src="survivorSystem_client.lua" type="client" /> 
    <script src="animals_client.lua" type="client" /> 
    <script src="tools/jq_client.lua" type="client" /> 
    <script src="textlib.lua" type="client" /> 
    <script src="addons.lua" type="server" /> 
    <script src="logsystem.lua" type="server" /> 
    <script src="shader/motion/motion_c.lua" type="client" /> 
    <file src="shader/motion/motion.fx" /> 
    <script src="shader/blackwhite/blackwhite_c.lua" type="client" /> 
    <file src="shader/blackwhite/blackwhite.fx" /> 
    <file src="tools/images/c_info/rand.png" /> 
    <file src="tools/images/background.png" /> 
    <file src="tools/images/imageHolder.png" /> 
    <file src="tools/images/flags/died.png" /> 
    <file src="tools/images/flags/join.png" /> 
    <file src="tools/images/flags/quit.png" /> 
    <script src="group_system/gang_client.lua" type="client" /> 
    <script src="group_system/gang_utils.lua" type="server" /> 
    <script src="group_system/gang_server.lua" type="server" /> 
    <script src="group_system/groupsystem.lua" type="server" /> 
    <script src="group_system/groupsystem_client.lua" type="client" /> 
    <export function="addGang" type="server" /> 
    <!-- Addon: Exported Functions --> 
    <export function="addAddonInfo" type="server" /> 
    <export function="addDayZInfoBox" type="client" /> 
  
    <settings> 
        <setting name="*column_name" value="Group" /> 
        <setting name="*gang_list_command" value="gangs" /> 
        <setting name="*gang_create_command" value="creategang" /> 
    </settings> 
--Models-- 
    <file src="models/players/txd/ghilliesuit.txd" /> 
    <file src="models/players/dff/ghilliesuit.dff" /> 
    <file src="models/players/txd/civilian_male.txd" /> 
    <file src="models/players/dff/civilian_male.dff" /> 
    <file src="models/players/txd/bandit1_male.txd" /> 
    <file src="models/players/dff/bandit1_male.dff" /> 
    <file src="models/players/txd/bandit2_male.txd" /> 
    <file src="models/players/dff/bandit2_male.dff" /> 
    <file src="models/players/txd/bandit3_male.txd" /> 
    <file src="models/players/dff/bandit3_male.dff" /> 
    <file src="models/players/txd/standard_male.txd" /> 
    <file src="models/players/dff/standard_male.dff" /> 
    <file src="models/players/txd/civilian_female.txd" /> 
    <file src="models/players/dff/civilian_female.dff" /> 
    <file src="models/players/txd/bandit1_female.txd" /> 
    <file src="models/players/dff/bandit1_female.dff" /> 
    <file src="models/players/txd/bandit2_female.txd" /> 
    <file src="models/players/dff/bandit2_female.dff" /> 
    <file src="models/players/txd/standard_female.txd" /> 
    <file src="models/players/dff/standard_female.dff" /> 
    <file src="models/players/txd/hero_male.txd" /> 
    <file src="models/players/dff/hero_male.dff" /> 
    <file src="models/players/txd/army_male.txd" /> 
    <file src="models/players/dff/army_male.dff" /> 
-- 
    <file src="images/scrollmenu_1.png" /> 
    <file src="images/background_scoreboard.png" /> 
    <file src="images/white.png" /> 
    <file src="images/window_bg.png" /> 
    <file src="images/dead.jpg" /> 
    <file src="images/dayzicons/bandit.png" /> 
    <file src="images/dayzicons/blood.png" /> 
    <file src="images/dayzicons/brokenbone.png" /> 
    <file src="images/dayzicons/eye.png" /> 
    <file src="images/dayzicons/food.png" /> 
    <file src="images/dayzicons/sound.png" /> 
    <file src="images/dayzicons/temperature.png" /> 
    <file src="images/dayzicons/thirsty.png" /> 
    <file src="images/dayzicons/medic.png" /> 
    <file src="images/dayzicons/level_2.png" /> 
    <file src="images/dayzicons/level_3.png" /> 
    <file src="images/dayzicons/level_4.png" /> 
    <file src="images/dayzicons/level_5.png" /> 
    <file src="mods/sniper.txd" /> 
    <file src="mods/sniper.dff" /> 
    <file src="mods/civilian.txd" /> 
    <file src="mods/civilian.dff" /> 
    <file src="mods/bandit1.txd" /> 
    <file src="mods/bandit1.dff" /> 
    <file src="mods/bandit2.txd" /> 
    <file src="mods/bandit2.dff" /> 
    <file src="mods/bandit3.txd" /> 
    <file src="mods/bandit3.dff" /> 
    <file src="mods/standart.txd" /> 
    <file src="mods/standart.dff" /> 
    <file src="mods/femalestandard.dff" /> 
    <file src="mods/femalestandard.txd" /> 
    <file src="mods/hero.txd" /> 
    <file src="mods/hero.dff" /> 
    <file src="mods/bear.txd" /> 
    <file src="mods/bear.dff" /> 
    <file src="mods/fox.txd" /> 
    <file src="mods/fox.dff" /> 
    <file src="mods/wolf.txd" /> 
    <file src="mods/wolf.dff" /> 
    <file src="skins/22.txd" /> 
    <file src="skins/56.txd" /> 
    <file src="skins/67.txd" /> 
    <file src="skins/68.txd" /> 
    <file src="skins/69.txd" /> 
    <file src="skins/70.txd" /> 
    <file src="skins/84.txd" /> 
    <file src="skins/92.txd" /> 
    <file src="skins/97.txd" /> 
    <file src="skins/105.txd" /> 
    <file src="skins/107.txd" /> 
    <file src="skins/108.txd" /> 
    <file src="skins/111.txd" /> 
    <file src="skins/126.txd" /> 
    <file src="skins/127.txd" /> 
    <file src="skins/128.txd" /> 
    <file src="skins/152.txd" /> 
    <file src="skins/162.txd" /> 
    <file src="skins/167.txd" /> 
    <file src="skins/188.txd" /> 
    <file src="skins/192.txd" /> 
    <file src="skins/195.txd" /> 
    <file src="skins/206.txd" /> 
    <file src="skins/209.txd" /> 
    <file src="skins/212.txd" /> 
    <file src="skins/229.txd" /> 
    <file src="skins/230.txd" /> 
    <file src="skins/258.txd" /> 
    <file src="skins/264.txd" /> 
    <file src="skins/274.txd" /> 
    <file src="skins/277.txd" /> 
    <file src="skins/280.txd" /> 
    <file src="skins/287.txd" /> 
    <file src="sounds/mgroan1.ogg" /> 
    <file src="sounds/mgroan2.ogg" /> 
    <file src="sounds/mgroan3.ogg" /> 
    <file src="sounds/mgroan4.ogg" /> 
    <file src="sounds/mgroan5.ogg" /> 
    <file src="sounds/mgroan6.ogg" /> 
    <file src="sounds/mgroan7.ogg" /> 
    <file src="sounds/mgroan8.ogg" /> 
    <file src="sounds/mgroan9.ogg" /> 
    <file src="sounds/mgroan10.ogg" /> 
    <file src="sounds/hit1.mp3" /> 
    <file src="sounds/hit2.mp3" /> 
    <file src="sounds/hit3.mp3" /> 
    <file src="items/assault_ammo.txd" /> 
    <file src="items/assault_ammo.dff" /> 
    <file src="items/army_clothes.txd" /> 
    <file src="items/army_clothes.dff" /> 
    <file src="items/backpack_alice.txd" /> 
    <file src="items/backpack_alice.dff" /> 
    <file src="items/backpack_coyote.txd" /> 
    <file src="items/backpack_coyote.dff" /> 
    <file src="items/beans_can.txd" /> 
    <file src="items/beans_can.dff" /> 
    <file src="items/civilian_clothes.txd" /> 
    <file src="items/civilian_clothes.dff" /> 
    <file src="items/first_aid_kit.txd" /> 
    <file src="items/first_aid_kit.dff" /> 
    <file src="items/heat_pack.txd" /> 
    <file src="items/heat_pack.dff" /> 
    <file src="items/katana.txd" /> 
    <file src="items/katana.dff" /> 
    <file src="items/pain_killers.txd" /> 
    <file src="items/pain_killers.dff" /> 
    <file src="items/pasta_can.txd" /> 
    <file src="items/pasta_can.dff" /> 
    <file src="items/pistol_ammo.txd" /> 
    <file src="items/pistol_ammo.dff" /> 
    <file src="items/shotgun_ammo.txd" /> 
    <file src="items/shotgun_ammo.dff" /> 
    <file src="items/backpack_small.txd" /> 
    <file src="items/backpack_small.dff" /> 
    <file src="items/backpack_czech.txd" /> 
    <file src="items/backpack_czech.dff" /> 
    <file src="items/backpack_army.txd" /> 
    <file src="items/backpack_army.dff" /> 
    <file src="items/smg_ammo.txd" /> 
    <file src="items/smg_ammo.dff" /> 
    <file src="items/sniper_ammo.txd" /> 
    <file src="items/sniper_ammo.dff" /> 
    <file src="items/sniper_clothes.txd" /> 
    <file src="items/sniper_clothes.dff" /> 
    <file src="items/soda_can.txd" /> 
    <file src="items/soda_can.dff" /> 
    <file src="items/water_bottle.txd" /> 
    <file src="items/water_bottle.dff" /> 
    <file src="items/standard_clothes.txd" /> 
    <file src="items/standard_clothes.dff" /> 
    <file src="items/tent.txd" /> 
    <file src="items/tent.dff" /> 
    <file src="items/wirefence.txd" /> 
    <file src="items/wirefence.dff" /> 
    <file src="items/camera.txd" /> 
    <file src="items/camera.dff" /> 
    <script src="bone_attach/bone_attach.lua" /> 
    <script src="bone_attach/bone_attach_c.lua" type="client" /> 
    <script src="bone_attach/attach_func.lua" /> 
    <script src="bone_attach/attach_func.lua" type="client" /> 
    <script src="bone_attach/bone_pos_rot.lua" type="client" /> 
</meta> 
  

Meta del script

  
<meta> 
    <info author='Dokitoh' version='1.0' name='FiendlyFire' description='FiendlyFire' type='script' /> 
    <script src='client.lua' type='client' /> 
</meta> 
  

Link to comment
Prueba éste
function stopDamageSameTeam ( attacker, weapon, bodypart ) 
    if source and attacker then 
        if source ~= attacker then 
            if isElement(source) and isElement(attacker) then 
                if getElementData (source, "gang") and getElementData (attacker, "gang") then 
                    if getElementData (source, "gang") == getElementData (attacker, "gang") then 
                        cancelEvent() 
                    end 
                end 
            end 
        end 
    end 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamageSameTeam ) 

Es lo mismo.

@Dokitoh sabes si algún elemento tiene un dato?

El elemento gang, tiene los datos del grupo que creas y el elemento attacker no se que datos tiene...

Link to comment
Prueba éste
function stopDamageSameTeam ( attacker, weapon, bodypart ) 
    if source and attacker then 
        if source ~= attacker then 
            if isElement(source) and isElement(attacker) then 
                if getElementData (source, "gang") and getElementData (attacker, "gang") then 
                    if getElementData (source, "gang") == getElementData (attacker, "gang") then 
                        cancelEvent() 
                    end 
                end 
            end 
        end 
    end 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamageSameTeam ) 

Más de lo mismo no funciona, pero no sale ningún error ni nada.

Link to comment
Pega esto dentro de la funcion playerGetDamageDayZ
local migp = getElementData( getLocalPlayer(  ), ( "Group" or "gang" )) 
    local atgp = getElementData( attacker, ( "Group" or "gang" )) 
    if atgp and migp ~= "N/A" then  
        if atgp == migp then return end 
    end 

Probado tambien, sin resultado alguno.

Si cambio el cancelEvent() por return, se me medio buguea y no me termina de cargar completamente el modo dayz.

Link to comment

Os pongo aquí el survivorSystem_client.lua:

  
--[[
#---------------------------------------------------------------#
----*           DayZ MTA Script survivor_system.lua         *----
----* This Script is owned by Marwin, you are not allowed to use or own it.
----* Owner: Marwin W., Germany, Lower Saxony, Otterndorf
----* Skype: xxmavxx96
----* Перевод мода: by Lorenco                              *----
#---------------------------------------------------------------#
]]
 
--version drawing
addEventHandler("onClientResourceStart", getResourceRootElement(),
    function()
    dayzVersion = "DayZ: DB v0.3"
        versionLabel  = guiCreateLabel(1,1,0.3,0.3,dayzVersion,true)
        guiSetSize ( versionLabel, guiLabelGetTextExtent ( versionLabel ), guiLabelGetFontHeight ( versionLabel ), false )
        x,y = guiGetSize(versionLabel,true)
        guiSetPosition( versionLabel, 1-x, 1-y*1.8, true )
        guiSetAlpha(versionLabel,0.5)
    end
)
 
--disable ped targeting markers
setPedTargetingMarkerEnabled(false)
 
-- // Player Skins // --
-- Standard (Male)
snipertxd = engineLoadTXD(":DayZ/models/players/txd/standard_male.txd")
engineImportTXD(snipertxd, 73)
sniperdff = engineLoadDFF(":DayZ/models/players/dff/standard_male.dff", 73)
engineReplaceModel(sniperdff, 73)
-- Standard (Female)
snipertxd = engineLoadTXD(":DayZ/models/players/txd/standard_female.txd")
engineImportTXD(snipertxd, 192)
sniperdff = engineLoadDFF(":DayZ/models/players/dff/standard_female.dff", 192)
engineReplaceModel(sniperdff, 192)
-- Civilian (Male)
snipertxd = engineLoadTXD(":DayZ/models/players/txd/civilian_male.txd")
engineImportTXD(snipertxd, 179)
sniperdff = engineLoadDFF(":DayZ/models/players/dff/civilian_male.dff", 179)
engineReplaceModel(sniperdff, 179)
--Civilian (Female)
snipertxd = engineLoadTXD(":DayZ/models/players/txd/civilian_female.txd")
engineImportTXD(snipertxd, 172)
sniperdff = engineLoadDFF(":DayZ/models/players/dff/civilian_female.dff", 172)
engineReplaceModel(sniperdff, 172)
-- Ghillie Suit
snipertxd = engineLoadTXD(":DayZ/models/players/txd/ghilliesuit.txd")
engineImportTXD(snipertxd, 285)
sniperdff = engineLoadDFF(":DayZ/models/players/dff/ghilliesuit.dff", 285)
engineReplaceModel(sniperdff, 285)
--Bandit 1 (Male)
snipertxd = engineLoadTXD(":DayZ/models/players/txd/bandit1_male.txd")
engineImportTXD(snipertxd, 180)
sniperdff = engineLoadDFF(":DayZ/models/players/dff/bandit1_male.dff", 180)
engineReplaceModel(sniperdff, 180)
-- Bandit 1 (Female)
snipertxd = engineLoadTXD(":DayZ/models/players/txd/bandit1_female.txd")
engineImportTXD(snipertxd, 191)
sniperdff = engineLoadDFF(":DayZ/models/players/dff/bandit1_female.dff", 191)
engineReplaceModel(sniperdff, 191)
--Bandit 2 (Male)
snipertxd = engineLoadTXD(":DayZ/models/players/txd/bandit2_male.txd")
engineImportTXD(snipertxd, 288)
sniperdff = engineLoadDFF(":DayZ/models/players/dff/bandit2_male.dff", 288)
engineReplaceModel(sniperdff, 288)
-- Bandit 2 (Female)
snipertxd = engineLoadTXD(":DayZ/models/players/txd/bandit2_female.txd")
engineImportTXD(snipertxd, 211)
sniperdff = engineLoadDFF(":DayZ/models/players/dff/bandit2_female.dff", 211)
engineReplaceModel(sniperdff, 211)
-- Hero (Male)
snipertxd = engineLoadTXD(":DayZ/models/players/txd/hero_male.txd")
engineImportTXD(snipertxd, 210)
sniperdff = engineLoadDFF(":DayZ/models/players/dff/hero_male.dff", 210)
engineReplaceModel(sniperdff, 210)
-- Army (Male)
snipertxd = engineLoadTXD(":DayZ/models/players/txd/army_male.txd")
engineImportTXD(snipertxd, 287)
sniperdff = engineLoadDFF(":DayZ/models/players/dff/army_male.dff", 287)
engineReplaceModel(sniperdff, 287)
 
--Items
 
itemTXD = engineLoadTXD ("items/army_clothes.txd");
engineImportTXD (itemTXD, 1247);
itemDFF = engineLoadDFF ("items/army_clothes.dff", 1247);
engineReplaceModel (itemDFF, 1247);
 
itemTXD = engineLoadTXD ("items/sniper_clothes.txd");
engineImportTXD (itemTXD, 1213);
itemDFF = engineLoadDFF ("items/sniper_clothes.dff", 1213);
engineReplaceModel (itemDFF, 1213);
 
itemTXD = engineLoadTXD ("items/civilian_clothes.txd");
engineImportTXD (itemTXD, 1241);
itemDFF = engineLoadDFF ("items/civilian_clothes.dff", 1241);
engineReplaceModel (itemDFF, 1241);
 
itemTXD = engineLoadTXD ("items/standard_clothes.txd");
engineImportTXD (itemTXD, 1577);
itemDFF = engineLoadDFF ("items/standard_clothes.dff", 1577);
engineReplaceModel (itemDFF, 1577);
 
itemTXD = engineLoadTXD ("items/beans_can.txd");
engineImportTXD (itemTXD, 2601);
itemDFF = engineLoadDFF ("items/beans_can.dff", 2601);
engineReplaceModel (itemDFF, 2601);
 
itemTXD = engineLoadTXD ("items/first_aid_kit.txd");
engineImportTXD (itemTXD, 2891);
itemDFF = engineLoadDFF ("items/first_aid_kit.dff", 2891);
engineReplaceModel (itemDFF, 2891);
 
itemTXD = engineLoadTXD ("items/heat_pack.txd");
engineImportTXD (itemTXD, 1576);
itemDFF = engineLoadDFF ("items/heat_pack.dff", 1576);
engineReplaceModel (itemDFF, 1576);
 
itemTXD = engineLoadTXD ("items/pain_killers.txd");
engineImportTXD (itemTXD, 2709);
itemDFF = engineLoadDFF ("items/pain_killers.dff", 2709);
engineReplaceModel (itemDFF, 2709);
 
itemTXD = engineLoadTXD ("items/pasta_can.txd");
engineImportTXD (itemTXD, 2770);
itemDFF = engineLoadDFF ("items/pasta_can.dff", 2770);
engineReplaceModel (itemDFF, 2770);
 
itemTXD = engineLoadTXD ("items/pistol_ammo.txd");
engineImportTXD (itemTXD, 3013);
itemDFF = engineLoadDFF ("items/pistol_ammo.dff", 3013);
engineReplaceModel (itemDFF, 3013);
 
itemTXD = engineLoadTXD ("items/shotgun_ammo.txd");
engineImportTXD (itemTXD, 2358);
itemDFF = engineLoadDFF ("items/shotgun_ammo.dff", 2358);
engineReplaceModel (itemDFF, 2358);
 
itemTXD = engineLoadTXD ("items/backpack_small.txd");
engineImportTXD (itemTXD, 3026);
itemDFF = engineLoadDFF ("items/backpack_small.dff", 3026);
engineReplaceModel (itemDFF, 3026);
 
itemTXD = engineLoadTXD ("items/backpack_army.txd");
engineImportTXD (itemTXD, 2405);
itemDFF = engineLoadDFF ("items/backpack_army.dff", 2405);
engineReplaceModel (itemDFF, 2405);
 
itemTXD = engineLoadTXD ("items/smg_ammo.txd");
engineImportTXD (itemTXD, 2041);
itemDFF = engineLoadDFF ("items/smg_ammo.dff", 2041);
engineReplaceModel (itemDFF, 2041);
 
itemTXD = engineLoadTXD ("items/sniper_ammo.txd");
engineImportTXD (itemTXD, 2358);
itemDFF = engineLoadDFF ("items/sniper_ammo.dff", 2358);
engineReplaceModel (itemDFF, 2358);
 
itemTXD = engineLoadTXD ("items/soda_can.txd");
engineImportTXD (itemTXD, 2647);
itemDFF = engineLoadDFF ("items/soda_can.dff", 2647);
engineReplaceModel (itemDFF, 2647);
 
itemTXD = engineLoadTXD ("items/water_bottle.txd");
engineImportTXD (itemTXD, 2683);
itemDFF = engineLoadDFF ("items/water_bottle.dff", 2683);
engineReplaceModel (itemDFF, 2683);
 
itemTXD = engineLoadTXD ("items/assault_ammo.txd");
engineImportTXD (itemTXD, 1271);
itemDFF = engineLoadDFF ("items/assault_ammo.dff", 1271);
engineReplaceModel (itemDFF, 1271);
 
itemTXD = engineLoadTXD ("items/backpack_alice.txd");
engineImportTXD (itemTXD, 1248);
itemDFF = engineLoadDFF ("items/backpack_alice.dff", 1248);
engineReplaceModel (itemDFF, 1248);
 
itemTXD = engineLoadTXD ("items/backpack_coyote.txd");
engineImportTXD (itemTXD, 1252);
itemDFF = engineLoadDFF ("items/backpack_coyote.dff", 1252);
engineReplaceModel (itemDFF, 1252);
 
itemTXD = engineLoadTXD ("items/backpack_czech.txd");
engineImportTXD (itemTXD, 1575);
itemDFF = engineLoadDFF ("items/backpack_czech.dff", 1575);
engineReplaceModel (itemDFF, 1575);
 
itemTXD = engineLoadTXD ("items/tent.txd");
engineImportTXD (itemTXD, 3243);
itemDFF = engineLoadDFF ("items/tent.dff", 3243);
engineReplaceModel (itemDFF, 3243);
 
itemTXD = engineLoadTXD ("items/wirefence.txd");
engineImportTXD (itemTXD, 983);
itemDFF = engineLoadDFF ("items/wirefence.dff", 983);
engineReplaceModel (itemDFF, 983);
 
--Weapons
 
-- Camera -> Binoculars
weaponTXD = engineLoadTXD ("items/camera.txd");
engineImportTXD (weaponTXD, 367);
weaponDFF = engineLoadDFF ("items/camera.dff", 367);
engineReplaceModel (weaponDFF, 367);
 
-- Katana -> Hatchet
weaponTXD = engineLoadTXD ("items/katana.txd");
engineImportTXD (weaponTXD, 339);
weaponDFF = engineLoadDFF ("items/katana.dff", 339);
engineReplaceModel (weaponDFF, 339);
 
function playerStatsClientSite()
    if getElementData(getLocalPlayer(),"logedin") then
        toggleControl ("radar",false)
        showPlayerHudComponent ("clock",false)
        showPlayerHudComponent ("radar",false)
        showPlayerHudComponent ("money",false)
        showPlayerHudComponent ("health",false)
        showPlayerHudComponent ("weapon",false)
        --showPlayerHudComponent ("ammo",false)
        showPlayerHudComponent ("breath",false)
        if getElementData(getLocalPlayer(),"Map") >= 1  then
            toggleControl ("radar",true)
        end
        if getElementData(getLocalPlayer(),"GPS") >= 1  then
            showPlayerHudComponent ("radar",true)
        end
        if getElementData(getLocalPlayer(),"Watch") >= 1 then
            showPlayerHudComponent ("clock",true)
        end
    end
end
setTimer(playerStatsClientSite,1000,0)
 
function playerZoom (key,keyState)
    if key == "n" then
        if getElementData(getLocalPlayer(),"Night Vision Goggles") > 0 then
            if nightvision then
                nightvision = false
                setCameraGoggleEffect("normal")
                local hour, minutes = getTime()
                if gameplayVariables["enablenight"] then
                    setClientNight (hour,minutes)
                end
            else
                nightvision = true
                setCameraGoggleEffect("nightvision")
Link to comment

Vale amigos, he probado con otro tipo de script que no es si no otro que uno de la wiki.

  
function playerDamage_text ( attacker, weapon, bodypart, loss ) --when a player is damaged 
    if ( bodypart == 9 ) then -- if the body part is 9, i.e. the head 
            outputChatBox ( "Headshot!", getRootElement (), 255, 170, 0 ) --output "Headshot" into the chatbox 
        killPed ( source, attacker, weapon, bodypart ) -- and kill the player 
    end 
end 
addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage_text ) 
  

Supuestamente me tiene que salir en el chat, cuando doy un headshot, pero no sale nada, ni error ni nada, cada vez estoy mas convencido de que debe de ser algo con el elemento attacker.

Seguiré investigando a ver si doy con alguna solución.

Link to comment
Sube la información de tu archivo meta.xml

ya la he subido en algún post anterior, no obstante, te la subo aqui de nuevo.

Esta es la meta del modo:

  
<meta> 
    <info author="Dokitoh" description="MTA:DayZ - DayZ for MTA" version="0.6" type="gamemode" /> 
    <script src="editor_server.lua" type="server" /> 
    <script src="editor_client.lua" type="client" /> 
    <script src="pickups.lua" type="server" /> 
    <script src="spawn.lua" type="server" /> 
    <script src="vehicle_spawns.lua" type="server" /> 
    <script src="survivorSystem.lua" type="server" /> 
    <script src="animals.lua" type="server" /> 
    <script src="weather.lua" type="server" /> 
    <script src="zombies.lua" type="server" /> 
    <script src="login.lua" type="server" /> 
    <script src="tools/jq_server.lua" type="server" /> 
    <script src="menu_client.lua" type="client" /> 
    <script src="inventory.lua" type="client" /> 
    <script src="survivorSystem_client.lua" type="client" /> 
    <script src="animals_client.lua" type="client" /> 
    <script src="tools/jq_client.lua" type="client" /> 
    <script src="textlib.lua" type="client" /> 
    <script src="addons.lua" type="server" /> 
    <script src="logsystem.lua" type="server" /> 
    <script src="shader/motion/motion_c.lua" type="client" /> 
    <file src="shader/motion/motion.fx" /> 
    <script src="shader/blackwhite/blackwhite_c.lua" type="client" /> 
    <file src="shader/blackwhite/blackwhite.fx" /> 
    <file src="tools/images/c_info/rand.png" /> 
    <file src="tools/images/background.png" /> 
    <file src="tools/images/imageHolder.png" /> 
    <file src="tools/images/flags/died.png" /> 
    <file src="tools/images/flags/join.png" /> 
    <file src="tools/images/flags/quit.png" /> 
    <script src="group_system/gang_client.lua" type="client" /> 
    <script src="group_system/gang_utils.lua" type="server" /> 
    <script src="group_system/gang_server.lua" type="server" /> 
    <script src="group_system/groupsystem.lua" type="server" /> 
    <script src="group_system/groupsystem_client.lua" type="client" /> 
    <export function="addGang" type="server" /> 
    <!-- Addon: Exported Functions --> 
    <export function="addAddonInfo" type="server" /> 
    <export function="addDayZInfoBox" type="client" /> 
  
    <settings> 
        <setting name="*column_name" value="Group" /> 
        <setting name="*gang_list_command" value="gangs" /> 
        <setting name="*gang_create_command" value="creategang" /> 
    </settings> 
--Models-- 
    <file src="models/players/txd/ghilliesuit.txd" /> 
    <file src="models/players/dff/ghilliesuit.dff" /> 
    <file src="models/players/txd/civilian_male.txd" /> 
    <file src="models/players/dff/civilian_male.dff" /> 
    <file src="models/players/txd/bandit1_male.txd" /> 
    <file src="models/players/dff/bandit1_male.dff" /> 
    <file src="models/players/txd/bandit2_male.txd" /> 
    <file src="models/players/dff/bandit2_male.dff" /> 
    <file src="models/players/txd/bandit3_male.txd" /> 
    <file src="models/players/dff/bandit3_male.dff" /> 
    <file src="models/players/txd/standard_male.txd" /> 
    <file src="models/players/dff/standard_male.dff" /> 
    <file src="models/players/txd/civilian_female.txd" /> 
    <file src="models/players/dff/civilian_female.dff" /> 
    <file src="models/players/txd/bandit1_female.txd" /> 
    <file src="models/players/dff/bandit1_female.dff" /> 
    <file src="models/players/txd/bandit2_female.txd" /> 
    <file src="models/players/dff/bandit2_female.dff" /> 
    <file src="models/players/txd/standard_female.txd" /> 
    <file src="models/players/dff/standard_female.dff" /> 
    <file src="models/players/txd/hero_male.txd" /> 
    <file src="models/players/dff/hero_male.dff" /> 
    <file src="models/players/txd/army_male.txd" /> 
    <file src="models/players/dff/army_male.dff" /> 
-- 
    <file src="images/scrollmenu_1.png" /> 
    <file src="images/background_scoreboard.png" /> 
    <file src="images/white.png" /> 
    <file src="images/window_bg.png" /> 
    <file src="images/dead.jpg" /> 
    <file src="images/dayzicons/bandit.png" /> 
    <file src="images/dayzicons/blood.png" /> 
    <file src="images/dayzicons/brokenbone.png" /> 
    <file src="images/dayzicons/eye.png" /> 
    <file src="images/dayzicons/food.png" /> 
    <file src="images/dayzicons/sound.png" /> 
    <file src="images/dayzicons/temperature.png" /> 
    <file src="images/dayzicons/thirsty.png" /> 
    <file src="images/dayzicons/medic.png" /> 
    <file src="images/dayzicons/level_2.png" /> 
    <file src="images/dayzicons/level_3.png" /> 
    <file src="images/dayzicons/level_4.png" /> 
    <file src="images/dayzicons/level_5.png" /> 
    <file src="mods/sniper.txd" /> 
    <file src="mods/sniper.dff" /> 
    <file src="mods/civilian.txd" /> 
    <file src="mods/civilian.dff" /> 
    <file src="mods/bandit1.txd" /> 
    <file src="mods/bandit1.dff" /> 
    <file src="mods/bandit2.txd" /> 
    <file src="mods/bandit2.dff" /> 
    <file src="mods/bandit3.txd" /> 
    <file src="mods/bandit3.dff" /> 
    <file src="mods/standart.txd" /> 
    <file src="mods/standart.dff" /> 
    <file src="mods/femalestandard.dff" /> 
    <file src="mods/femalestandard.txd" /> 
    <file src="mods/hero.txd" /> 
    <file src="mods/hero.dff" /> 
    <file src="mods/bear.txd" /> 
    <file src="mods/bear.dff" /> 
    <file src="mods/fox.txd" /> 
    <file src="mods/fox.dff" /> 
    <file src="mods/wolf.txd" /> 
    <file src="mods/wolf.dff" /> 
    <file src="skins/22.txd" /> 
    <file src="skins/56.txd" /> 
    <file src="skins/67.txd" /> 
    <file src="skins/68.txd" /> 
    <file src="skins/69.txd" /> 
    <file src="skins/70.txd" /> 
    <file src="skins/84.txd" /> 
    <file src="skins/92.txd" /> 
    <file src="skins/97.txd" /> 
    <file src="skins/105.txd" /> 
    <file src="skins/107.txd" /> 
    <file src="skins/108.txd" /> 
    <file src="skins/111.txd" /> 
    <file src="skins/126.txd" /> 
    <file src="skins/127.txd" /> 
    <file src="skins/128.txd" /> 
    <file src="skins/152.txd" /> 
    <file src="skins/162.txd" /> 
    <file src="skins/167.txd" /> 
    <file src="skins/188.txd" /> 
    <file src="skins/192.txd" /> 
    <file src="skins/195.txd" /> 
    <file src="skins/206.txd" /> 
    <file src="skins/209.txd" /> 
    <file src="skins/212.txd" /> 
    <file src="skins/229.txd" /> 
    <file src="skins/230.txd" /> 
    <file src="skins/258.txd" /> 
    <file src="skins/264.txd" /> 
    <file src="skins/274.txd" /> 
    <file src="skins/277.txd" /> 
    <file src="skins/280.txd" /> 
    <file src="skins/287.txd" /> 
    <file src="sounds/mgroan1.ogg" /> 
    <file src="sounds/mgroan2.ogg" /> 
    <file src="sounds/mgroan3.ogg" /> 
    <file src="sounds/mgroan4.ogg" /> 
    <file src="sounds/mgroan5.ogg" /> 
    <file src="sounds/mgroan6.ogg" /> 
    <file src="sounds/mgroan7.ogg" /> 
    <file src="sounds/mgroan8.ogg" /> 
    <file src="sounds/mgroan9.ogg" /> 
    <file src="sounds/mgroan10.ogg" /> 
    <file src="sounds/hit1.mp3" /> 
    <file src="sounds/hit2.mp3" /> 
    <file src="sounds/hit3.mp3" /> 
    <file src="items/assault_ammo.txd" /> 
    <file src="items/assault_ammo.dff" /> 
    <file src="items/army_clothes.txd" /> 
    <file src="items/army_clothes.dff" /> 
    <file src="items/backpack_alice.txd" /> 
    <file src="items/backpack_alice.dff" /> 
    <file src="items/backpack_coyote.txd" /> 
    <file src="items/backpack_coyote.dff" /> 
    <file src="items/beans_can.txd" /> 
    <file src="items/beans_can.dff" /> 
    <file src="items/civilian_clothes.txd" /> 
    <file src="items/civilian_clothes.dff" /> 
    <file src="items/first_aid_kit.txd" /> 
    <file src="items/first_aid_kit.dff" /> 
    <file src="items/heat_pack.txd" /> 
    <file src="items/heat_pack.dff" /> 
    <file src="items/katana.txd" /> 
    <file src="items/katana.dff" /> 
    <file src="items/pain_killers.txd" /> 
    <file src="items/pain_killers.dff" /> 
    <file src="items/pasta_can.txd" /> 
    <file src="items/pasta_can.dff" /> 
    <file src="items/pistol_ammo.txd" /> 
    <file src="items/pistol_ammo.dff" /> 
    <file src="items/shotgun_ammo.txd" /> 
    <file src="items/shotgun_ammo.dff" /> 
    <file src="items/backpack_small.txd" /> 
    <file src="items/backpack_small.dff" /> 
    <file src="items/backpack_czech.txd" /> 
    <file src="items/backpack_czech.dff" /> 
    <file src="items/backpack_army.txd" /> 
    <file src="items/backpack_army.dff" /> 
    <file src="items/smg_ammo.txd" /> 
    <file src="items/smg_ammo.dff" /> 
    <file src="items/sniper_ammo.txd" /> 
    <file src="items/sniper_ammo.dff" /> 
    <file src="items/sniper_clothes.txd" /> 
    <file src="items/sniper_clothes.dff" /> 
    <file src="items/soda_can.txd" /> 
    <file src="items/soda_can.dff" /> 
    <file src="items/water_bottle.txd" /> 
    <file src="items/water_bottle.dff" /> 
    <file src="items/standard_clothes.txd" /> 
    <file src="items/standard_clothes.dff" /> 
    <file src="items/tent.txd" /> 
    <file src="items/tent.dff" /> 
    <file src="items/wirefence.txd" /> 
    <file src="items/wirefence.dff" /> 
    <file src="items/camera.txd" /> 
    <file src="items/camera.dff" /> 
    <script src="bone_attach/bone_attach.lua" /> 
    <script src="bone_attach/bone_attach_c.lua" type="client" /> 
    <script src="bone_attach/attach_func.lua" /> 
    <script src="bone_attach/attach_func.lua" type="client" /> 
    <script src="bone_attach/bone_pos_rot.lua" type="client" /> 
</meta> 
  

Y esta es la meta del script:

  
<meta> 
    <info author='Dokitoh' version='1.0' name='FiendlyFire' description='FiendlyFire' type='script' /> 
    <script src='client.lua' type='client' /> 
</meta> 
  

Link to comment
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")) 

No me tira error, ya se que supuestamente me tendría que salir el gang en el chat, pero no pasa absolutamente nada.

Quizás sea problema del propio evento? aunque esto si que me parece lo menos probable.

Link to comment
Con quién pruebas el script?, quién te hace daño o te dispara? para comprobarlo?

Un jugador, con el que estoy testeando.

Solemos probar ambas partes, por si tiene algo que ver tener permisos de administrador.

También probamos a matarnos estando sin "gang" y creando posteriormente una "gang".

El resultado es el mismo.

Link to comment

Hola buenas noches compañeros, al fín lo conseguí.

¿Cómo lo hice?

Pues he puesto la función dentro de survivorSystem_client.lua, sustituyendo cancelEvent() por return.

Supongo que me ha funcionado porque he cambiado por completo todo el archivo survirvorSystem_client.lua, asique quiero creer que en ese survivorSystem_client.lua había algo que no cuadraba.

Gracias por vuestra paciencia, un saludo.

Link to comment
  • 3 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...