Jump to content

وظائف لعملية شراء


Recommended Posts

GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {}, 
    label = {} 
} 
        GUIEditor.window[1] = guiCreateWindow(613, 300, 258, 307, "متجر", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible ( GUIEditor.window[1], false) 
  
        GUIEditor.staticimage[1] = guiCreateStaticImage(10, 70, 34, 34, ":guieditor/images/11.png", false, GUIEditor.window[1]) 
        GUIEditor.staticimage[2] = guiCreateStaticImage(10, 167, 34, 34, ":guieditor/images/7.png", false, GUIEditor.window[1]) 
        GUIEditor.label[1] = guiCreateLabel(46, 70, 78, 23, "درع", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[1], "default-bold-small") 
        guiLabelSetColor(GUIEditor.label[1], 207, 209, 45) 
        GUIEditor.label[2] = guiCreateLabel(46, 168, 78, 23, "طعام", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[2], "default-bold-small") 
        guiLabelSetColor(GUIEditor.label[2], 207, 209, 45) 
        GUIEditor.label[3] = guiCreateLabel(44, 87, 90, 17, "+20Armour", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[3], "default-small") 
        GUIEditor.label[4] = guiCreateLabel(44, 184, 90, 17, "+20Health", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[4], "default-small") 
        GUIEditor.button[1] = guiCreateButton(114, 77, 58, 28, "شراء", false, GUIEditor.window[1]) 
        mezo = guiCreateStaticImage(9, 86, 34, 34, "images/11.png", false, WindowAr) 
        GUIEditor.button[2] = guiCreateButton(114, 174, 58, 28, "شراء", false, GUIEditor.window[1]) 
        mezo = guiCreateStaticImage(9, 86, 34, 34, "images/7.png", false, WindowAr) 
        GUIEditor.button[3] = guiCreateButton(9, 274, 239, 23, "أغلاق", false, GUIEditor.window[1]) 
        GUIEditor.button[4] = guiCreateButton(9, 241, 239, 23, "قريبا", false, GUIEditor.window[1])     
  
Marker = createMarker (215.71916,1911.35266,18.64063,"arrow",1,255,255,225) 
addEventHandler("onClientMarkerHit", root, 
function (Marker) 
if ( source == Marker ) and ( Marker == localPlayer ) then 
showCursor(true) 
guiSetVisible(GUIEditor.window[1],true) 
end 
end 
) 
  
addEventHandler ("onClientGUIClick", root, 
function() 
if ( source == GUIEditor.button[1] ) then 
   setElementHealth(localPlayer,20) 
   elseif ( source == GUIEditor.button[3] ) then   
   showCursor(false) 
   guiSetVisible(GUIEditor.window[1],false) 
   end 
   end 
  ) 

وش سبب لما المس الماركر ما يطلع لي اللوحة

سطر 24 و 26 مالهمش لازمة امسحهم

mezo = guiCreateStaticImage(9, 86, 34, 34, "images/7.png", false, WindowAr) 

--

Marker = createMarker (215.71916,1911.35266,18.64063,"arrow",1,255,255,225,255)  

عرف الشفافية انا ردي مش شفاف فوق

--

في الجزء دة

addEventHandler("onClientMarkerHit", root, 
function (Marker) 
if ( source == Marker ) and ( Marker == localPlayer ) then 
showCursor(true) 
guiSetVisible(GUIEditor.window[1],true) 
end 
end 
) 

الخطأ في

function (Marker)

و اللي تحتيه

بدله بـ

addEventHandler("onClientMarkerHit", Marker, 
function (plr) 
if getElementType (plr) == "player" and plr == localPlayer then 
showCursor(true) 
guiSetInputEnabled (true) 
guiSetVisible(GUIEditor.window[1],true) 
end 
end 
) 

--

و في الجزء دة

addEventHandler ("onClientGUIClick", root, 
function() 
if ( source == GUIEditor.button[1] ) then 
   setElementHealth(localPlayer,20) 
   elseif ( source == GUIEditor.button[3] ) then   
   showCursor(false) 
   guiSetVisible(GUIEditor.window[1],false) 
   end 
   end 
  ) 

لو البوتون اللي انضغط عليه هو البوتون رقم 1

يديله دم بس الدم هايكون وهمي و كدة غلط

بدله بـ

addEventHandler ("onClientGUIClick", root, 
function() 
if ( source == GUIEditor.button[1] ) then 
triggerServerEvent ("Health20",localPlayer) 
   elseif ( source == GUIEditor.button[3] ) then   
   guiSetVisible(GUIEditor.window[1],false) 
      showCursor(false) 
      guiSetInputEnabled (false) 
   end 
   end 
  ) 

و في جزء السيرفر

function getPedMaxHealth(ped) 
    assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") 
    local stat = getPedStat(ped, 24) 
    local maxhealth = 100 + (stat - 569) / 4.31 
    return math.max(1, maxhealth) 
end 
  
addEvent ("Health20",true) 
       addEventHandler ("Health20",root, 
       function () 
if getPlayerMoney (source) >= 200 then 
if getElementHealth (source) < getPedMaxHealth(source) then 
takePlayerMoney (source,200) 
       setElementHealth (source, getElementHealth (source) + 20) 
       else 
outputChatBox ("Your health is full.",source,255,5,5) 
       end 
       else 
outputChatBox ("You don't have enough money.",source,255,5,5) 
       end 
       end 
       ) 
  
Link to comment
  • Replies 92
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

+هناك خطأ بسطر 31 غيرت فيه دون فايدة

لا يجيني واحد يعطيني جاهز لانه وقتها عمري ما راح استفيد

قولوا بس وش الخطأ الي مسوية+وش اخليه+ليه خليته كذا

Marker = createMarker (-2397.73120,-591.99969,131.64844,"cylinder",1,255,255,225,1) 
GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {}, 
    label = {} 
} 
  
        GUIEditor.window[1] = guiCreateWindow(551, 271, 197, 312, "مطعم", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible ( GUIEditor.window[1], false) 
        GUIEditor.staticimage[1] = guiCreateStaticImage(10, 58, 34, 34, ":guieditor/images/8.png", false, GUIEditor.window[1]) 
        GUIEditor.label[1] = guiCreateLabel(48, 57, 102, 25, "..", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[1], "default-bold-small") 
        guiLabelSetColor(GUIEditor.label[1], 100, 53, 35) 
        GUIEditor.label[2] = guiCreateLabel(46, 77, 104, 15, "+20Health", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[2], "default-small") 
        GUIEditor.button[1] = guiCreateButton(131, 58, 56, 34, "شراء", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(9, 279, 178, 23, "أغلاق", false, GUIEditor.window[1])     
  
  
addEventHandler("onClientMarkerHit", Root, 
    function(ss) 
    if ( source == Marker ) and ( ss == localPlayer ) then 
    guiSetVisible(GUIEditor.window[1],true) 
    showCursor(true) 
    end 
end 
) 
  
    addEventHandler("onClientGUIClick", Root, 
     
    function () 
    if ( source == GUIEditor.button[1] ) then 
     setElementHealth(localPlayer,20) 
      
     elseif ( source == GUIEditor.button[2] ) then   
     guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
    end 
    end 
    ) 

Link to comment
ممكن افهم ليه لما المس الماركر ما تتطلع اللوحة مع انه التحقق موجود

+هناك خطأ بسطر 31 غيرت فيه دون فايدة

لا يجيني واحد يعطيني جاهز لانه وقتها عمري ما راح استفيد

قولوا بس وش الخطأ الي مسوية+وش اخليه+ليه خليته كذا

Marker = createMarker (-2397.73120,-591.99969,131.64844,"cylinder",1,255,255,225,1) 
GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {}, 
    label = {} 
} 
  
        GUIEditor.window[1] = guiCreateWindow(551, 271, 197, 312, "مطعم", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible ( GUIEditor.window[1], false) 
        GUIEditor.staticimage[1] = guiCreateStaticImage(10, 58, 34, 34, ":guieditor/images/8.png", false, GUIEditor.window[1]) 
        GUIEditor.label[1] = guiCreateLabel(48, 57, 102, 25, "..", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[1], "default-bold-small") 
        guiLabelSetColor(GUIEditor.label[1], 100, 53, 35) 
        GUIEditor.label[2] = guiCreateLabel(46, 77, 104, 15, "+20Health", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[2], "default-small") 
        GUIEditor.button[1] = guiCreateButton(131, 58, 56, 34, "شراء", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(9, 279, 178, 23, "أغلاق", false, GUIEditor.window[1])     
  
  
addEventHandler("onClientMarkerHit", Root, 
    function(ss) 
    if ( source == Marker ) and ( ss == localPlayer ) then 
    guiSetVisible(GUIEditor.window[1],true) 
    showCursor(true) 
    end 
end 
) 
  
    addEventHandler("onClientGUIClick", Root, 
     
    function () 
    if ( source == GUIEditor.button[1] ) then 
     setElementHealth(localPlayer,20) 
      
     elseif ( source == GUIEditor.button[2] ) then   
     guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
    end 
    end 
    ) 

الشفافية مش متعرفة في كود صنع الماركر بتاعك

Marker = createMarker (-2397.73120,-591.99969,131.64844,"cylinder",1.5,1,255,255,225) 

Link to comment
Marker = createMarker (215.71916,1911.35266,18.64063,"arrow",1,255,255,225,255) 
addEventHandler('onClientMarkerHit',root, 
function (Marker) 
if ( source == Marker ) then  
if ( Marker == localPlayer ) then 
guiSetVisible (GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) 
showCursor(guiGetVisible(GUIEditor.window[1] )) 
end 
end 
end 
) 
  

جرب استبدل الكود هاي بي الي عندك

ملاحظة :- تم تعديل الكود

Link to comment
Marker = createMarker (215.71916,1911.35266,18.64063,"arrow",1,255,255,225,255) 
addEventHandler('onClientMarkerHit',root, 
function (Marker) 
if ( source == Marker ) and ( Marker == localPlayer ) then 
showCursor(true) 
guiSetVisible(GUIEditor.window[1],true) 
end 
end 
) 

جرب استبدل الكود هاي بي الي عندك

X

alpha الشفافية هي ال

يعني تحدد الماركر يكون ظاهر ولا لأ تدريجياً من صفر الي 255

لو صفر او مش موجودة او مش متعرفة يكون الماركر شفاف

انما لو 100 مثلاً يكون ظاهر شوية و خفيف

لو 200 يكون ظاهر اكتر

لو 255 يكون ظاهر تماماً

لازم تحدد للماركر شفافية عشان يكون ظاهر و تعرف مكانه

بالنسبة لكودك هاعرفك غلطك

addEventHandler("onClientMarkerHit", Root,

function(ss)

if ( source == Marker ) and ( ss == localPlayer ) then

guiSetVisible(GUIEditor.window[1],true)

showCursor(true)

end

end

)

--

Root المفروض اول حرف يكون سمول *small*

function (ss) -- للي لمس الماركر سواء كان لاعب او بيد او اي شئ parameter | ممكن تسميه اي حاجة انت عايزها

if (source == Marker) -- دي تحقق بأن الماركر نفسه اللي اتلمس في الحدث هو الماركر اللي انت صانعه و مفيهاش مشكلة

او اي ماركر انت عايز تضيفه لحدث اللمس و تريح نفسك Marker بـ root و ممكن تبدل

and ( ss == localPlayer ) -- هنا عشان مايحصلش مشاكل

للي لمس الماركر بأنه لاعب getElementType اعمل تحقق بفنكشن

و ان الاعب دة هو الاعب المحلي

لازم الاعب المحلي عشان لو من غيرها

هايكون كودك يفتح النافذة للكل

guiSetInputEnabled و ضيف

guiSetInputEnabled 

??

لما تحطها علي الوحة binds ذي بتطفي او بتشغل الـ

حقت الشات وانت فاتح الوحة مابيجيك الشات T بمعنى لو ضغطت على

و لو مش فاهم حاجة سيب تعليق

Link to comment

اخوي تم مشان الرووت اشتغل لكن لما جيت اضيف ما يقدر يتكلم واللوحة شغاله ما تضبط

شوفه صح كذا؟؟

Marker = createMarker (-2396.31543,-594.40619,133.64844,"cylinder",1,255,255,225,49) 
GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {}, 
    label = {} 
} 
  
        window1 = guiCreateWindow(551, 271, 197, 312, "مطعم", false) 
        guiWindowSetSizable(window1, false) 
        guiSetVisible ( window1, false) 
        images = guiCreateStaticImage(10, 58, 34, 34, ":guieditor/images/8.png", false, window1) 
        GUIEditor.label[1] = guiCreateLabel(48, 57, 102, 25, "..", false, window1) 
        guiSetFont(GUIEditor.label[1], "default-bold-small") 
        guiLabelSetColor(GUIEditor.label[1], 100, 53, 35) 
        GUIEditor.label[2] = guiCreateLabel(46, 77, 104, 15, "+20Health", false, window1) 
        guiSetFont(GUIEditor.label[2], "default-small") 
        GUIEditor.button[1] = guiCreateButton(131, 58, 56, 34, "شراء", false, window1) 
        GUIEditor.button[2] = guiCreateButton(9, 279, 178, 23, "أغلاق", false, window1)     
  
  
  
    addEventHandler('onClientMarkerHit',root, 
    function (ss) 
    if ( source == Marker ) and ( ss == localPlayer ) then 
    elseif guiSetInputEnabled(Enabled) 
    showCursor(true) 
    guiSetVisible(window1,true) 
     
    end 
    end 
    ) 
  
    addEventHandler("onClientGUIClick", root, 
    function () 
     if ( source == GUIEditor.button[1] ) then 
     setElementHealth(localPlayer,20) 
     elseif ( source == GUIEditor.button[2] ) then   
     guiSetVisible(window1,false) 
    showCursor(false) 
    end 
    end 
    ) 

+يقولي في خطأ بسطر 12 وش هوه يخوي معلش غلبتك

+مشكورين الباقي ما قصروا

Link to comment
Marker = createMarker (215.71916,1911.35266,18.64063,"arrow",1,255,255,225,255) 
addEventHandler('onClientMarkerHit',root, 
function (Marker) 
if ( source == Marker ) and ( Marker == localPlayer ) then 
showCursor(true) 
guiSetVisible(GUIEditor.window[1],true) 
end 
end 
) 

جرب استبدل الكود هاي بي الي عندك

X

alpha الشفافية هي ال

يعني تحدد الماركر يكون ظاهر ولا لأ تدريجياً من صفر الي 255

لو صفر او مش موجودة او مش متعرفة يكون الماركر شفاف

انما لو 100 مثلاً يكون ظاهر شوية و خفيف

لو 200 يكون ظاهر اكتر

لو 255 يكون ظاهر تماماً

لازم تحدد للماركر شفافية عشان يكون ظاهر و تعرف مكانه

بالنسبة لكودك هاعرفك غلطك

addEventHandler("onClientMarkerHit", Root,

function(ss)

if ( source == Marker ) and ( ss == localPlayer ) then

guiSetVisible(GUIEditor.window[1],true)

showCursor(true)

end

end

)

--

Root المفروض اول حرف يكون سمول *small*

function (ss) -- للي لمس الماركر سواء كان لاعب او بيد او اي شئ parameter | ممكن تسميه اي حاجة انت عايزها

if (source == Marker) -- دي تحقق بأن الماركر نفسه اللي اتلمس في الحدث هو الماركر اللي انت صانعه و مفيهاش مشكلة

او اي ماركر انت عايز تضيفه لحدث اللمس و تريح نفسك Marker بـ root و ممكن تبدل

and ( ss == localPlayer ) -- هنا عشان مايحصلش مشاكل

للي لمس الماركر بأنه لاعب getElementType اعمل تحقق بفنكشن

و ان الاعب دة هو الاعب المحلي

لازم الاعب المحلي عشان لو من غيرها

هايكون كودك يفتح النافذة للكل

guiSetInputEnabled و ضيف

guiSetInputEnabled 

??

لما تحطها علي الوحة binds ذي بتطفي او بتشغل الـ

حقت الشات وانت فاتح الوحة مابيجيك الشات T بمعنى لو ضغطت على

و لو مش فاهم حاجة سيب تعليق

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

+ انا عدلت علي كوده ما صنعت كود جديد ؟

Edited by Guest
Link to comment
اخوي تم مشان الرووت اشتغل لكن لما جيت اضيف ما يقدر يتكلم واللوحة شغاله ما تضبط

شوفه صح كذا؟؟

Marker = createMarker (-2396.31543,-594.40619,133.64844,"cylinder",1,255,255,225,49) 
GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {}, 
    label = {} 
} 
  
        window1 = guiCreateWindow(551, 271, 197, 312, "مطعم", false) 
        guiWindowSetSizable(window1, false) 
        guiSetVisible ( window1, false) 
        images = guiCreateStaticImage(10, 58, 34, 34, ":guieditor/images/8.png", false, window1) 
        GUIEditor.label[1] = guiCreateLabel(48, 57, 102, 25, "..", false, window1) 
        guiSetFont(GUIEditor.label[1], "default-bold-small") 
        guiLabelSetColor(GUIEditor.label[1], 100, 53, 35) 
        GUIEditor.label[2] = guiCreateLabel(46, 77, 104, 15, "+20Health", false, window1) 
        guiSetFont(GUIEditor.label[2], "default-small") 
        GUIEditor.button[1] = guiCreateButton(131, 58, 56, 34, "شراء", false, window1) 
        GUIEditor.button[2] = guiCreateButton(9, 279, 178, 23, "أغلاق", false, window1)     
  
  
  
    addEventHandler('onClientMarkerHit',root, 
    function (ss) 
    if ( source == Marker ) and ( ss == localPlayer ) then 
    elseif guiSetInputEnabled(Enabled) 
    showCursor(true) 
    guiSetVisible(window1,true) 
     
    end 
    end 
    ) 
  
    addEventHandler("onClientGUIClick", root, 
    function () 
     if ( source == GUIEditor.button[1] ) then 
     setElementHealth(localPlayer,20) 
     elseif ( source == GUIEditor.button[2] ) then   
     guiSetVisible(window1,false) 
    showCursor(false) 
    end 
    end 
    ) 

+يقولي في خطأ بسطر 12 وش هوه يخوي معلش غلبتك

+مشكورين الباقي ما قصروا

images = guiCreateStaticImage(10, 58, 34, 34, ":guieditor/images/8.png", false, window1) 

":guieditor/images/8.png"

ليش مسوي الكود هيك سهله علي نفسك وضع الصورة بي المود وعرفه في الميتا واكتب هيك فقط

8.png

لان مود جيوي ايديتور لو اتمسح منك او اي شئ حصل له

الصوره ما راح تكون موجوده وهاي ممكن يخرب كودك

Link to comment

الصورة اصلن معرفها بالميتا وحاطط لها فولدر بس ما تظهر

+ DTC12يا ريت

تشوف الكود الاخير الي اعطيتني اياه الي ما ينفع يكتب واللوحة فاتحه صح ولا لا ولو غلط قولي السبب اهم شي ما تعطيني جاهز :]

Link to comment
اخوي تم مشان الرووت اشتغل لكن لما جيت اضيف ما يقدر يتكلم واللوحة شغاله ما تضبط

شوفه صح كذا؟؟

Marker = createMarker (-2396.31543,-594.40619,133.64844,"cylinder",1,255,255,225,49) 
GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {}, 
    label = {} 
} 
  
        window1 = guiCreateWindow(551, 271, 197, 312, "مطعم", false) 
        guiWindowSetSizable(window1, false) 
        guiSetVisible ( window1, false) 
        images = guiCreateStaticImage(10, 58, 34, 34, ":guieditor/images/8.png", false, window1) 
        GUIEditor.label[1] = guiCreateLabel(48, 57, 102, 25, "..", false, window1) 
        guiSetFont(GUIEditor.label[1], "default-bold-small") 
        guiLabelSetColor(GUIEditor.label[1], 100, 53, 35) 
        GUIEditor.label[2] = guiCreateLabel(46, 77, 104, 15, "+20Health", false, window1) 
        guiSetFont(GUIEditor.label[2], "default-small") 
        GUIEditor.button[1] = guiCreateButton(131, 58, 56, 34, "شراء", false, window1) 
        GUIEditor.button[2] = guiCreateButton(9, 279, 178, 23, "أغلاق", false, window1)     
  
  
  
    addEventHandler('onClientMarkerHit',root, 
    function (ss) 
    if ( source == Marker ) and ( ss == localPlayer ) then 
    elseif guiSetInputEnabled(Enabled) 
    showCursor(true) 
    guiSetVisible(window1,true) 
     
    end 
    end 
    ) 
  
    addEventHandler("onClientGUIClick", root, 
    function () 
     if ( source == GUIEditor.button[1] ) then 
     setElementHealth(localPlayer,20) 
     elseif ( source == GUIEditor.button[2] ) then   
     guiSetVisible(window1,false) 
    showCursor(false) 
    end 
    end 
    ) 

+يقولي في خطأ بسطر 12 وش هوه يخوي معلش غلبتك

+مشكورين الباقي ما قصروا

بالنسبة للصورة

حطها كدة

        images = guiCreateStaticImage(10, 58, 34, 34, "images/8.png", false, window1)

و هنا

addEventHandler('onClientMarkerHit',root,

    function (ss)

if ( source == Marker ) and ( ss == localPlayer ) then

    elseif guiSetInputEnabled(Enabled)

    showCursor(true)

    guiSetVisible(window1,true)

    end

end

    )

هو لاعب (ss) بأن اللي لمس الماركر getElementType لازم تحقق بأستخدام الفنكشن

(localPlayer) هو الاعب المحلي (ss) و ان الاعب دة

elseif مالهاش لازمة عندك امسحها

guiSetInputEnabled(true شغال, false مطفي)

--

@1XxCr{o}sS

كودك مازال خطأ :mrgreen:

Link to comment
يب معك حق انا غلطان انه حطيت اكمال تحقق لانه فعلن استفدت

بس الماوس تعلق ليه

انا مقفلها مع قفل اللوحة ليه تعلق وش سالفتها هههه

guiSetInputEnabled منا قولتلك ضيف :D

ضيفه في كودك

guiSetInputEnabled(false) 

دة لو هاتقفل اللوحة

guiSetInputEnabled(true) 

دة لو هاتفتح اللوحة

Link to comment

بس مشان ما ابي افتح موضوع ثاني ممكن فنكشن مثلن الحين لما يكون دمي 100% واشتري دم 20% ينقص يصير 20

ابيه لو كان دمي 80 وشريت 20 يصير 100 ممكن فنكشن التحقق حقه وانا اسوية

+شكرا

DTC12

+

1XxCr{o}sS

+الي حاولوا يساعدوني

شكرا من كل قلبي صدق :]

Link to comment

هابسطهالك بس يارب تفهم قصدي :mrgreen:

استخدم فنكشن

setElementHealth 

لما تيجي تفتح القوسين في الفنكشن

جيب دم الاعب بأستخدام

getElementHealth 

و اجمع دمه الحالي اللي انت جبته

ب 20 او اي رقم انت عايزه

كدة اداله دم 20 علي دمه

Link to comment
بس مشان ما ابي افتح موضوع ثاني ممكن فنكشن مثلن الحين لما يكون دمي 100% واشتري دم 20% ينقص يصير 20

ابيه لو كان دمي 80 وشريت 20 يصير 100 ممكن فنكشن التحقق حقه وانا اسوية

+شكرا

DTC12

+

1XxCr{o}sS

+الي حاولوا يساعدوني

شكرا من كل قلبي صدق :]

سيرفر

addEvent("Health",true) 
addEventHandler("Health",root, 
function() 
local PlayerMoney = getPlayerMoney(source) 
    if ( PlayerMoney >= 1000) then 
    takePlayerMoney(source,1000)     
setPedArmor(source,100)           
    local name = getPlayerName(source) 

كلينت

addEventHandler ("onClientGUIClick", root, 
        function() 
        if (source == اسم زرك) then 
         guiSetVisible(GUIEditor.window[1], false) 
         showCursor(false) 
         guiSetInputEnabled(false) 
        end 
    end 
) 
  
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  اسم زرك الثاني ) then 
    triggerServerEvent("Health",getLocalPlayer())   
    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...