Jump to content

Problem From cancelEvent() | مشكلة بالنسبة للكناسل افنت


Recommended Posts

بسم الله الرحمن الرحيم

اسف على الغياب الطويل بس كان الواحد ساحب على البرمجة فترة بس رجعت من فترة والحمدلله

وصاضفتنى مشكلة

addEventHandler('onPlayerDamage',root, 
function (attacker) 
    if attacker ~= source and getElementType (attacker) == 'player' and getElementData (source,'Group') == groupName and getElementData (attacker,'Group') == groupName then 
    cancelEvent (true) 
    end 
end 
) 

ا

المشكلة ان الكود لا يعمل ولايوجد اخطاء بالديبوق

+

  
addEventHandler('onPlayerDamage',root, 
function (attacker) 
    if attacker ~= source and getElementType (attacker) == 'player' and getElementData (source,'Group') == groupName and getElementData (attacker,'Group') == groupName then 
    killPlayer (attacker) 
    end 
end 
) 
  

لما سويتو يقتل اللاعب بديلن عن ايقاف الحدث لتجربة هل يوجد اخطاء بالكود

عمل الكود بشكل صحيح 100 % هل المشكلة من ان اللعبة مبرمجة على منع ايقاف احداث الضرب والقتل والتصويب ام لا ؟

بانتظار افادتكم وشكرا

Link to comment

addEventHandler('onClientPlayerDamage',root, 
function (attacker) 
if ( attacker and attacker ~= source and getElementType(attacker) == 'player' and getElementData (source,'Group') == groupName and getElementData (attacker,'Group') == groupName ) then 
   cancelEvent ( ) 
     end 
   end 
) 

Canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead.

Link to comment
addEventHandler('onClientPlayerDamage',root, 
function (attacker) 
if ( attacker and attacker ~= source and getElementType(attacker) == 'player' and getElementData (source,'Group') == groupName and getElementData (attacker,'Group') == groupName ) then 
   cancelEvent ( ) 
     end 
   end 
) 

Canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead.

شكرا لك ^_^ الكود يعمل بنجاح

Link to comment

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.
×
×
  • Create New...