Sisqo0

[ Help ] Dayz Skin on hitmarker

Recommended Posts

Guys, i made a marker in dayz that when i get in it i got new skin in dayz and the skin worked and all things fine but when i get the new skin after 10-15 second  my last skin back and my new skin has gone . how to fix that ?

 

newskin = createMarker ( 1856.0751, 851.0827, 9.408, "cylinder", 1.5, 255, 255, 0, 170 )

function skin(hitPlayer)
    if getElementType(hitPlayer) == "player" then
       setPlayerSkin ( hitPlayer, 211 )
    end
end
addEventHandler ( "onMarkerHit", newskin, skin )

Share this post


Link to post

This is because DayZ gamemode has a protection, you should look for a timer in your gamemode that does something like this

local skin = getElementData(player,"skin")
if (skin ~= getElementModel(player) then
    setElementModel(player,skin)
end

if you find this, check the element data, and just add

setElementData(player,"DATANAME",YOURSKINID)

example, if your DayZ protection dataname is "DayZSkin", and the skin you set is 150

setElementData(player,"DayZSkin",150)

 

FULL CODE With dataname "DayZSkin":

newskin = createMarker ( 1856.0751, 851.0827, 9.408, "cylinder", 1.5, 255, 255, 0, 170 )

function skin(hitPlayer)
    if getElementType(hitPlayer) == "player" then
       setPlayerSkin ( hitPlayer, 211 )
       setElementData( hitPlayer, "DayZSkin",211) --this is what you must add.
    end
end
addEventHandler ( "onMarkerHit", newskin, skin )

 

Edited by knightscript
added full code example

Share this post


Link to post

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.