John Smith Posted October 26, 2014 Share Posted October 26, 2014 hi function customDamage(attacker,weapon,bodypart,loss) if not attacker then outputDebugString("player got damage,no attacker") return end if weapon == 38 or weapon == 35 or weapon == 36 then killPed(source,attacker,bodypart,false) outputDebugString("weapon was 38 or 36 or 35 and player got killed.") end end addEventHandler("onPlayerDamage",root,customDamage) this thing doesnt work at all i tried also making similiar thingy on client side and didnt work as well anyone knows why? Link to comment
Saml1er Posted October 26, 2014 Share Posted October 26, 2014 killPed(source,weapon,attacker,bodypart,false) Btw do you see any outputs in debug? Link to comment
#DRAGON!FIRE Posted October 26, 2014 Share Posted October 26, 2014 killPed function must be : killPed(source,attacker,_,bodypart,false) Link to comment
John Smith Posted October 26, 2014 Author Share Posted October 26, 2014 doesnt work and no errors Link to comment
Price. Posted October 26, 2014 Share Posted October 26, 2014 function customDamage(attacker,attackerweapon,bodypart,loss) if attacker and getElementType(attacker) == "player" then if not attacker then outputDebugString("player got damage,no attacker") return end if attackerweapon == 38 or attackerweapon == 35 or attackerweapon == 36 then killPed(source,attacker,bodypart,false) outputDebugString("weapon was 38 or 36 or 35 and player got killed.") end end end end addEventHandler("onPlayerDamage",root,customDamage) try this and tell me if there is any error /debugscript 3 Link to comment
John Smith Posted October 26, 2014 Author Share Posted October 26, 2014 doesnt work and no errors Link to comment
Saml1er Posted October 26, 2014 Share Posted October 26, 2014 function customDamage(attacker,attacker,weapon,bodypart,loss) outputDebugString("player got damage") if attacker and getElementType(attacker) == "player" then outputDebugString("player check") if attackerweapon == 38 or attackerweapon == 35 or attackerweapon == 36 then killPed(source,attacker,weapon,bodypart,false) outputDebugString("weapon was 38 or 36 or 35 and player got killed.") end end end addEventHandler("onPlayerDamage",root,customDamage) No errors???? There was a missing end..... Test this code and tell me what does it output. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now