• Announcements

    • jhxp

      Forums are online again after a maintenance.   18/03/17

      MTA Forums maintenance is completed, although some automatic time-heavy tasks are still in process and will be finished eventually in background. Expect some features such as Forum Search to not display all results until all processes are finished. Please let us know if you spot a forum feature that worked correctly before the maintenance but does not work anymore now. Thanks. --MTA Team
Sign in to follow this  
Followers 0
Russian#37

[مساعدة] !

9 posts in this topic

Posted (edited)

جيت اضيف 

addEventHandler("onPlayerWasted",root,function(_,killer)
 local num = math.random(1000,2500) 
     if ( killer ) and ( killer ~= source ) then
        givePlayerMoney(killer,tonumber(num)) 
        outputChatBox ( "You Got "..tostring(num).." ! ",killer,0,255,0)
     end
 end )

 

عشان لما اقتل لاعب يعطيني فلوس وماظبط وش الخطأ

Edited by Russian#37

Share this post


Link to post

يا ليت تستخدم <> عشان نقدر نقرأ الاكواد .

اشوف الكود تمام  .. شوف الديبوق في اي اخطاء من السكربت !

+ tostring - tonumber ما يحتاج تستخدم

1 person likes this

Share this post


Link to post
1 hour ago, #_iMr.[E]coo said:

addEventHandler ( 'onPlayerWasted' , root ,
  function( _ , aAttacker_ )
    if ( aAttacker_ ) and ( aAttacker_ ~= source ) then
      if ( getElementType ( source ) == 'player' and getElementType ( aAttacker_ ) == 'player' ) then
        givePlayerMoney ( aAttacker_ , math.random ( 1000 , 2500 )  ) 
      end
    end
  end 
)

 

 

ماظبط اخي , للعلم السيرفر دايز

Share this post


Link to post
4 minutes ago, Russian#37 said:

ماظبط اخي , للعلم السيرفر دايز

حاطه بملف سيرفر 

Share this post


Link to post
1 hour ago, #_iMr.[E]coo said:

حاطه بملف سيرفر 

خلاص , شكرا اخوي حليت المشكلة :x

Share this post


Link to post
3 hours ago, #_iMr.[E]coo said:

addEventHandler ( 'onPlayerWasted' , root ,
  function( _ , aAttacker_ )
    if ( aAttacker_ ) and ( aAttacker_ ~= source ) then
      if ( getElementType ( source ) == 'player' and getElementType ( aAttacker_ ) == 'player' ) then
        givePlayerMoney ( aAttacker_ , math.random ( 1000 , 2500 )  ) 
      end
    end
  end 
)

 

 

getElementType ( source ) == 'player'

'onPlayerWasted

 

 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

1 person likes this

Share this post


Link to post
1 hour ago, #_iMr.[E]coo said:

ذذ خلنا نتحقق اكثر :D

مو شرط لان الحدث للاعبين بس -_-

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  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.