Jump to content

حل مشكلة


Recommended Posts

السلام عليكم

addEvent ("+20",true) 
 addEventHandler ("+20",root, 
 function () 
 if getPlayerMoney (source) >= 250 then 
 takePlayerMoney (source,250) 
setElementHealth (source, getElementHealth (source) + 20) 
  
 elseif getElementHealth (source) > 100 then 
 takePlayerMoney (source,0) 
 outputChatBox ("لا تستطيع شراء المزيد.",source,255,5,5) 
  
 elseif getPlayerMoney (source) < 250 then 
 outputChatBox ("لا تملك المال الكافي.",source,255,5,5) 
  
    end 
    end 
    ) 
  

عندي مشكله لما يكون دمه فل ابيه يقوله لا يمكتك شراء المزيد لكن يجيه لا تملك المال الكافي

حتى حاولت اضيف سحب فلوس 0 مو ضابط المسج يظهر نفسه وش الحل؟؟

Link to comment

ذا سويته لك امس

  
-- Client  
local screenW, screenH = guiGetScreenSize() 
window = guiCreateWindow(screenW - 167 - 10, (screenH - 165) / 2, 167, 165, "مطعم", false) 
guiSetVisible(window,false) 
guiWindowSetSizable(window, false) 
guiSetAlpha(window, 1.00) 
guiSetProperty(window, "CaptionColour", "FF566666")     
b1 = guiCreateButton(9, 28, 145, 32, "وجبه سريعه 100 $", false, window) 
b2 = guiCreateButton(9, 64, 145, 32, "دجاج 500 $", false, window) 
b3 = guiCreateButton(9, 100, 145, 32, "بيتزا 1000 $", false, window) 
b4 = guiCreateButton(9, 135, 145, 19, "X اغلاق اللوحه  X", false, window) 
------- لوب لتغيير لون الزرر 
for i,btn in pairs ({b1,b2,b3,b4}) do 
guiSetProperty(btn, "NormalTextColour", "FF066666") 
guiSetFont (btn, "default-bold-small") 
end     
------- حدث عند الضغط الزر 
addEventHandler ("onClientGUIClick", root, 
function() 
if ( source == b1 ) then 
triggerServerEvent ("Health",localPlayer,100,10,'تم انهاء هذه الوجبه من فضلك اختر وجبه اخري') 
-- triggerServerEvent ("Health",localPlayer,amount -- المبلغ, Health -- الدم, 'Text -- الكلام اللى يظهر بالشات') 
elseif ( source == b2 ) then 
triggerServerEvent ("Health",localPlayer,500,40,'تم انهاء هذه الوجبه من فضلك اختر وجبه اخري') 
elseif ( source == b3 ) then 
triggerServerEvent ("Health",localPlayer,1000,90,'دمك الان فل') 
elseif ( source == b4 ) then 
showCursor(false) 
guiSetVisible(window,false) 
end 
end) 
--- 
MyMarker = createMarker (-711,957,12, "cylinder",1,100,255, 0,90) -- الماركر 
--------- فتح اللوحه عند لمس حدث الماركر 
addEventHandler("onClientMarkerHit",MyMarker, 
function (player) 
if (player == localPlayer) then 
showCursor(true) 
guiSetVisible(window,true) 
end 
end) 

--- Server 
addEvent ("Health",true) 
addEventHandler ("Health",root, 
function (amount,Health,Msg) 
local money = getPlayerMoney(source) 
if money >= amount then 
if (getElementHealth (source) <= Health ) then  
takePlayerMoney (source,amount) 
local Health = getElementHealth (source) + 10 
setElementHealth (source,Health) 
outputChatBox (math.ceil(getElementHealth (source)).." #FF0000#066666لقد حصلت على الوجبه ودمك الان",source,255,0,0,true) 
else 
outputChatBox (Msg,source,255,0,0,true) 
end 
else 
outputChatBox ("لايوجد معك مال كافي لشراء الوجبه",source,255,0,0) 
end 
end) 

شوف اكواده يمكن تفيدك

Link to comment

انت ليه مصعبها وهي سهله؟

if getPlayerMoney (source) >= 250 then 
    takePlayerMoney (source,250) 
        setElementHealth (source, getElementHealth (source) + 20) 
   else 
          outputChatBox ("لا تستطيع شراء المزيد.",source,255,5,5) 
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...