botshara Posted March 7, 2014 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
DNL291 Posted March 7, 2014 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)
Moderators IIYAMA Posted March 7, 2014 Moderators 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.
botshara Posted March 7, 2014 Author 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 ?
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