Jump to content

تعديل على كود


Recommended Posts

addEvent("Armor",true) 
addEventHandler("Armor",root, 
function() 
local PlayerMoney = getPlayerMoney(source) 
    if ( PlayerMoney >= 50) then 
    takePlayerMoney(source,50)     
    giveWeapon ( source ,  33,50 )           
        setPedArmor ( source, 25 ) 
    outputChatBox ("#330079" .. name .. " #00FF00 Has Bought  weapon Armor",source,255,0,0) 
    else 
    outputChatBox("أنت لاتملك المال", source, 255, 0, 0, true) 
  
    end 
end 

الكود هذا اذا اشرتيت يزيد درعي 25 % واذا اشتريت ثاني مرة من نفس الزر يبقى الدرع 25 % والفلوس تنقص

ابغاه يزيد يصير 50 % ياليت فهمتوني

يعني 25% ظغتطت على زر مرتين يصير درعي 50 % اسنى ردكم

Link to comment
addEvent("Armor",true) 
addEventHandler("Armor",root, 
function() 
local PlayerMoney = getPlayerMoney(source) 
    if ( PlayerMoney >= 50) then 
    takePlayerMoney(source,50)     
    giveWeapon ( source ,  33,50 )           
        setPedArmor ( source, 50 ) 
    outputChatBox ("#330079" .. name .. " #00FF00 Has Bought  weapon Armor",source,255,0,0) 
    else 
    outputChatBox("أنت لاتملك المال", source, 255, 0, 0, true) 
  
    end 
end 

Link to comment
addEvent("Armor",true) 
addEventHandler("Armor",root, 
function() 
local PlayerMoney = getPlayerMoney(source) 
    if ( PlayerMoney >= 50) then 
    takePlayerMoney(source,50)     
    giveWeapon ( source ,  33,50 )           
        setPedArmor ( source, getPedArmor ( source ) + 25 ) 
    outputChatBox ("#330079" .. name .. " #00FF00 Has Bought  weapon Armor",source,255,0,0) 
    else 
    outputChatBox("أنت لاتملك المال", source, 255, 0, 0, true) 
  
    end 
end 

Link to comment

طيب حاولت ممكن تعلمني خطأي

  
addEvent("ee",true) 
  
addEventHandler("ee",root, 
  
function() 
  
local PlayerMoney = getPlayerMoney(source) 
  
    if ( PlayerMoney >= 200) then 
  
    takePlayerMoney(source,200)     
  
    giveWeapon ( source ,  0,200 )           
  
         getElementHealth ( source,  getElementHealth ( source ) + 100 ) 
  
    outputChatBox ("#330079" .. name .. " #00FF00 Has Bought  weapon Health",source,255,0,0) 
  
    else 
  
    outputChatBox("أنت لاتملك المال", source, 255, 0, 0, true) 
  
  
  
    end 
  
end 
) 

Link to comment
طيب حاولت ممكن تعلمني خطأي
  
addEvent("ee",true) 
  
addEventHandler("ee",root, 
  
function() 
  
local PlayerMoney = getPlayerMoney(source) 
  
    if ( PlayerMoney >= 200) then 
  
    takePlayerMoney(source,200)     
  
    giveWeapon ( source ,  0,200 )           
  
         getElementHealth ( source,  getElementHealth ( source ) + 100 ) 
  
    outputChatBox ("#330079" .. name .. " #00FF00 Has Bought  weapon Health",source,255,0,0) 
  
    else 
  
    outputChatBox("أنت لاتملك المال", source, 255, 0, 0, true) 
  
  
  
    end 
  
end 
) 

الخطأ هنا

  getElementHealth ( source,  getElementHealth ( source ) + 100 ) 

حاط getElementHealth

يصير كذا

addEvent("ee",true) 
  
addEventHandler("ee",root, 
  
function() 
  
local PlayerMoney = getPlayerMoney(source) 
  
    if ( PlayerMoney >= 200) then 
  
    takePlayerMoney(source,200)     
  
    giveWeapon ( source ,  0,200 )           
  
         setElementHealth ( source,  getElementHealth ( source ) + 100 ) 
  
    outputChatBox ("#330079" .. name .. " #00FF00 Has Bought  weapon Health",source,255,0,0) 
  
    else 
  
    outputChatBox("أنت لاتملك المال", source, 255, 0, 0, true) 
  
  
  
    end 
  
end 
) 

Link to comment
addEvent("Armor",true) 
addEventHandler("Armor",root, 
function() 
local PlayerMoney = getPlayerMoney(source) 
    if ( PlayerMoney >= 50) then 
    takePlayerMoney(source,50)     
    giveWeapon ( source ,  33,50 )           
        setPedArmor ( source, getPedArmor ( source ) + 25 ) 
    outputChatBox ("#330079" .. name .. " #00FF00 Has Bought  weapon Armor",source,255,0,0) 
    else 
    outputChatBox("أنت لاتملك المال", source, 255, 0, 0, true) 
  
    end 
end 

مهو معرف بسطر 9 name ناقصكـ قوس + المتغير

+ root مخرج النص حق الشراء بسطر 9 مابيظهر غير عند اللاعب الي شرا الدرع .. مفروض تخليه

الخطأ هنا
  getElementHealth ( source,  getElementHealth ( source ) + 100 ) 

حاط getElementHealth

يصير كذا

addEvent("ee",true) 
  
addEventHandler("ee",root, 
  
function() 
  
local PlayerMoney = getPlayerMoney(source) 
  
    if ( PlayerMoney >= 200) then 
  
    takePlayerMoney(source,200)     
  
    giveWeapon ( source ,  0,200 )           
  
         setElementHealth ( source,  getElementHealth ( source ) + 100 ) 
  
    outputChatBox ("#330079" .. name .. " #00FF00 Has Bought  weapon Health",source,255,0,0) 
  
    else 
  
    outputChatBox("أنت لاتملك المال", source, 255, 0, 0, true) 
  
  
  
    end 
  
end 
) 

باقي بالكود اخطاء كثير ، شوفها بالرد حقي على اقتباس صاحب الموضوع

طيب حاولت ممكن تعلمني خطأي
  
addEvent("ee",true) 
  
addEventHandler("ee",root, 
  
function() 
  
local PlayerMoney = getPlayerMoney(source) 
  
    if ( PlayerMoney >= 200) then 
  
    takePlayerMoney(source,200)     
  
    giveWeapon ( source ,  0,200 )           
  
         getElementHealth ( source,  getElementHealth ( source ) + 100 ) 
  
    outputChatBox ("#330079" .. name .. " #00FF00 Has Bought  weapon Health",source,255,0,0) 
  
    else 
  
    outputChatBox("أنت لاتملك المال", source, 255, 0, 0, true) 
  
  
  
    end 
  
end 
) 

ليه تجيب صحة اللاعب وتزيد لها 100 دام تبي تخليها 100 اصلاً؟

+ بقس وهو يكون معه بالأصل دائماً ؟/Fist ليه تعطي اللاعب سلاح

غير معرّف، وظهور النص ليه مخليه للاعب نفسه ؟ name وعندكـ متغير

واضح إنه شغلك نسخ ولصق مع احترامي لكـ وصدقني مارح يفيدكـ ، المهم كودك يصير كذا

addEvent ( "ee", true ) 
addEventHandler ( "ee", root, 
    function ( ) 
        if ( getPlayerMoney ( source ) >= 200) then 
            takePlayerMoney ( source, 200 ) 
            setElementHealth ( source, 100 ) 
            outputChatBox ( "#330079" .. getPlayerName ( source ) .. " #00FF00Has Bought  weapon Health", root, 255, 0, 0 ) 
        else 
            outputChatBox ( "أنت لاتملك المال", source, 255, 0, 0, true ) 
        end 
    end 
) 

Link to comment

فالنهاية الكود كذااا يصير ياكنق

صح ؟

  
  
addEvent ( "ee", true ) 
  
addEventHandler ( "ee", root, 
  
    function ( ) 
  
        if ( getPlayerMoney ( source ) >= 2) then 
  
            takePlayerMoney ( source, 2 ) 
 setElementHealth ( source,  getElementHealth ( source ) + 25 ) 
  
            outputChatBox ( "#330079" .. getPlayerName ( source ) .. " #00FF00Has Bought  weapon Health", root, 255, 0, 0 ) 
  
        else 
  
            outputChatBox ( "أنت لاتملك المال", source, 255, 0, 0, true ) 
  
        end 
  
    end 
  
) 

Link to comment
كنق رجعنا في المشكلة الاولى خخخخخخ اضغط على زر مرتين اشتري مرتين مثلن دم 25 % مايصير 50 %زز

!! :mrgreen: انت تقول ابي الدم 100 ؟ والحين تبيه يزيد عليه لما يشري 25 .. عجيب أمركـ

فالنهاية الكود كذااا يصير ياكنق

صح ؟

  
  
addEvent ( "ee", true ) 
  
addEventHandler ( "ee", root, 
  
    function ( ) 
  
        if ( getPlayerMoney ( source ) >= 2) then 
  
            takePlayerMoney ( source, 2 ) 
 setElementHealth ( source,  getElementHealth ( source ) + 25 ) 
  
            outputChatBox ( "#330079" .. getPlayerName ( source ) .. " #00FF00Has Bought  weapon Health", root, 255, 0, 0 ) 
  
        else 
  
            outputChatBox ( "أنت لاتملك المال", source, 255, 0, 0, true ) 
  
        end 
  
    end 
  
) 

. ايه .. صح عليكـ

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...