Sign in to follow this  
LOOah

[HELP] Trying to do bullet proof skin

Recommended Posts

Hello so as you can see in topic, I trying to do bullet proof skin and i was trying something like this but it  not working

 

function dmg ( attacker )
    skin = getPedSkin(localPlayer)
    if skin == 285
    cancelEvent() 
end
addEventHandler ( "onClientDamage", getRootElement(), dmg )

 

Share this post


Link to post
Posted (edited)
addEventHandler("onClientPlayerDamage",root,function()
    if ( getElementModel ( source ) == 285 ) then
      cancelEvent()
      end
    end );

 

Edited by -Ilker.

Share this post


Link to post
3 minutes ago, -Ilker. said:

Client side ??

 

yes client side

but maybe i did something wrong look all c-side 


 

function informPlayerOnModelChange(oldModel, newModel)
    if ( getElementType(source) == "player" ) then 
        skin = getPedSkin(localPlayer)
        if skin == 285 
            setPedWalkingStyle(localPlayer,59) 
        else 
            setPedWalkingStyle(localPlayer,0) 
        end
    end
end
addEventHandler("onClientElementModelChange", root, informPlayerOnModelChange)


addEventHandler("onClientPlayerDamagr",root,function()
    if ( getElementModel ( source ) == 285 ) then
      cancelEvent()
      end
    end );

 

Share this post


Link to post
addEventHandler ( "onClientElementModelChange" , root , function ( _ , newSkin ) 
if ( getElementType ( source ) == "player" ) then 
setPedWalkingStyle ( source , newSkin == 285 and 59 or 0 ) 
end
end ) ; 

addEventHandler ( "onClientPlayerDamage" , root , function ( ) 
if ( getElementModel ( source ) == 285 ) then 
cancelEvent ( ) ; 
end 
end ) ; 

 

Share this post


Link to post

I assume you are using dayz gamemode so you will find an event in the client side that manages the blod loss so all you hace to do is to put this at the very top of the event just after cancelEvent()

If getElementModel(source) == 285 then return; end 

if getElementModel(source) == 285 then return; end

 

  • Thanks 1

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.