Jump to content

[HELP] Unlimited oxygen DAYZ


Recommended Posts

 

I want to do something that if we have a skin id == 200, we can swim as much as we want, and I did something that works for freeroam, but I do DayZ server and on DayZ server i get damage

 

function stopDrown ( attacker, damage_type)
if ( getElementType(source) == "player" ) then 
        skin = getPedSkin(localPlayer)
        if skin == 200 and damage_type == 53 then
		cancelEvent() 
	end
	end
end
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDrown )

 

Link to comment
  • Moderators
6 hours ago, LOOah said:

and I did something that works for freeroam, but I do DayZ server and on DayZ server i get damage

Either the anti cheat (DayZ) or a custom damage script (DayZ).

Try to search for getPedOxygenLevel inside of all the scripts from DayZ. Or search for isElementInWater instead.

And try to disable it there.

With notepad++ you can search in directories instead of file by file. (But make sure to filter on .Lua files only, else you will also be searching inside of binary files like images and mods, which takes long...)

Edited by IIYAMA
  • Like 1
Link to comment
3 hours ago, Spakye said:

Hello, i dont think you need to use getElementType since the source of the event will always be the player that got dammaged.

Also use getElementModel() instead of getPedSkin.

any error ?

No there is no erros as i said that script is working on freeroam/play but on dayz isn't 
 

 

2 hours ago, IIYAMA said:

Either the anti cheat (DayZ) or a custom damage script (DayZ).

Try to search for getPedOxygenLevel inside of all the scripts from DayZ. Or search for isElementInWater instead.

And try to disable it there.

With notepad++ you can search in directories instead of file by file. (But make sure to filter on .Lua files only, else you will also be searching inside of binary files like images and mods, which takes long...)

when i was searching getPedOxygenLevel there is 0 hits but when i was searching isElementInWater was 1 hit with that 

addEventHandler("onPlayerRefillWaterBottle", root, function(itemName)
	if isElementInWater(source) then
if getElementData(source,itemName)<=0 then return end
		setElementData(source, "Water Bottle", getElementData(source, "Water Bottle") + 1);
		setElementData(source, itemName, getElementData(source, itemName) - 1);
		triggerClientEvent(source, "displayClientInfo", source, "You filled 1 x "..itemName, 22, 255, 0);
		triggerClientEvent(source, "refreshInventoryManual", source);
	else
		triggerClientEvent(source, "displayClientInfo", source, "You must be in water!", 255, 22, 0);
	end 
end);

 

Link to comment

In core_client.Lua (survivorSystem_client.Lua) you may find the event onClientPlayerDamage and there you will see what happens when in water as if you add another that may create conflicts within the scripts.

Also remplace getPedSkin with getElementModel as getPedSkin it's no longer a supported function.

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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