Jump to content

طلب كود بسيط


Gomez10

Recommended Posts

addCommandHandler( "giveAll", function(  )  ---- اضافة امر جديد بـ الكونسل 
  for _,p in ipairs( getElementsByType( "player" ) ) do   ---- نقوم بجلب جميع اللاعبين 
        setElementHealth ( p, 100 ) --- نضع الدم 100 لكل اللاعبين اللي جلبناهم 
        givePlayerMoney ( p, 500 ) --- نعطي جميع اللاعبين اللي جلبناهم فلوس 
        setPedArmor( p, 100 ) --- نحط لجميع اللاعبين اللي جلبناهم درع 
      end 
end ) 
Link to comment
والله افدتني لكن ما فهمت

ذي طبعا كل عاده كل مشاكلي بل جداول وانت تعرف وش الي ما فهمته ذذ

for _,p in ipairs

ولي p موجوده بكل مكان

هذي تسمى اللوب وهذي تستخدم لجلب جميع العناصر الموجودة بالجدول اللي حددته .. طبعا هنا تقولي مو جدول اقلك هنا جبت كل اللاعبين لانه هنا يقول :

Returns a table containing all the elements of the specified type. Returns an empty table if there are no elements of the specified type. Returns false if the string specified is invalid (or not a string). 
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...