botshara Posted March 7, 2014 Share Posted March 7, 2014 -- client side function antiCarDM() if weapon == 0 and getElementType(hitElement)=="vehicle" then outputChatBox("(( CAR DM IS NOT ALLOWED ))", thePlayer, 255,0,0 ) cancelEvent() end end addEventHandler("onClientPlayerWeaponFire", getRootElement(), antiCarDM) script doesnt work.. And someone can please answer me what need write between function brackets. I cant understand it Link to comment
DNL291 Posted March 7, 2014 Share Posted March 7, 2014 Try this: function antiCarDM(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if getElementType(hitElement)=="vehicle" then outputChatBox("(( CAR DM IS NOT ALLOWED ))", 255, 0, 0) cancelEvent() end end addEventHandler("onClientPlayerWeaponFire", localPlayer, antiCarDM) Link to comment
Moderators IIYAMA Posted March 7, 2014 Moderators Share Posted March 7, 2014 addEventHandler("onClientVehicleDamage", root, function (attacker,weapon) if attacker == localPlayer then outputChatBox("(( CAR DM IS NOT ALLOWED ))", 255,0,0 ) end if attacker then cancelEvent() end end) It is clientside and that("onClientPlayerWeaponFire") event can't be cancelled. Link to comment
botshara Posted March 7, 2014 Author Share Posted March 7, 2014 addEventHandler("onClientVehicleDamage", root, function (attacker,weapon) if attacker == localPlayer then outputChatBox("(( CAR DM IS NOT ALLOWED ))", 255,0,0 ) end if attacker then cancelEvent() end end) It is clientside and that("onClientPlayerWeaponFire") event can't be cancelled. It works, but how set it only work to fist ? Link to comment
Castillo Posted March 7, 2014 Share Posted March 7, 2014 Check if weapon is equal to 0. 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