mahmod3 Posted March 1, 2017 Share Posted March 1, 2017 السلام عليكم شباب اريد طريقة يعني لما شخص يكون دمه على سبيل المثال 40% واريده لما يشتري دم حقة 40% يصير دمه 80% ؟؟؟ Link to comment
_Kinan Posted March 1, 2017 Share Posted March 1, 2017 function giveH(p,per) local currentHealth = getPlayerHealth(p) setPlayerHealth(p, currentHealth+per) end -- مثال للكود حقي giveH(source,50) -- source= اللاعب -- 50 = كم بيزيد الدم حقه Link to comment
^iiEcoo'x_) Posted March 1, 2017 Share Posted March 1, 2017 function shopPlayerHealth ( player , GH , H) local Health = getElementHealth ( player ) if ( Health == GH ) then setElementHealth ( player , H ) end end حطه باول الكود shopPlayerHealth ( player , GH , H) حطه لما تشتري الدم player بدله للتعريف الاعب عندك GH -- اذا معه الصحة الي تبيها H-- الصحة الي تعطيها اياه Link to comment
mahmod3 Posted March 1, 2017 Author Share Posted March 1, 2017 23 hours ago, #_iMr.[E]coo said: function shopPlayerHealth ( player , GH , H) local Health = getElementHealth ( player ) if ( Health == GH ) then setElementHealth ( player , H ) end end حطه باول الكود shopPlayerHealth ( player , GH , H) حطه لما تشتري الدم player بدله للتعريف الاعب عندك GH -- اذا معه الصحة الي تبيها H-- الصحة الي تعطيها اياه 23 hours ago, _Kinan said: function giveH(p,per) local currentHealth = getPlayerHealth(p) setPlayerHealth(p, currentHealth+per) end -- مثال للكود حقي giveH(source,50) -- source= اللاعب -- 50 = كم بيزيد الدم حقه مشكورين ماقصرتوا Link to comment
_Kinan Posted March 1, 2017 Share Posted March 1, 2017 1 hour ago, #_iMr.[E]coo said: function shopPlayerHealth ( player , GH , H) local Health = getElementHealth ( player ) if ( Health == GH ) then setElementHealth ( player , H ) end end حطه باول الكود shopPlayerHealth ( player , GH , H) حطه لما تشتري الدم player بدله للتعريف الاعب عندك GH -- اذا معه الصحة الي تبيها H-- الصحة الي تعطيها اياه عطيني مثال - ممكن كودك غلط Link to comment
^iiEcoo'x_) Posted March 1, 2017 Share Posted March 1, 2017 ليش المثال ؟ طلب اذا يكون معه دم 40 بالزبط يعطيه دم 80 Link to comment
mahmod3 Posted March 1, 2017 Author Share Posted March 1, 2017 addEventHandler("onClientGUIClick",root, function ( GH , H) if source == dm10 then local Health = getElementHealth ( localPlayer ) if ( Health == GH ) then setElementHealth ( localPlayer , H ) setElementHealth (localPlayer , 40) end end end ) ماصار شي شكلكم ما فهمتون قصدي انا ابيه لو كان دمه 30 او 50 او الخ وانا عامل بوتون يعطيه دم 10 يعني لما يضغط ع البوتون يضير دمه 60 فهمتون ولما يزيد يضغط يزيد ياخد 10 ويصير 70 Link to comment
^iiEcoo'x_) Posted March 1, 2017 Share Posted March 1, 2017 (edited) 14 minutes ago, mahmod3 said: addEventHandler("onClientGUIClick",root, function ( ) if source == dm10 then setElementHealth ( localPlayer, (getElementHealth(localPlayer)) + 40 ) end end ) @_Kinan فهمته خطا ، صديقي Edited March 1, 2017 by #_iMr.[E]coo Link to comment
mahmod3 Posted March 1, 2017 Author Share Posted March 1, 2017 33 minutes ago, #_iMr.[E]coo said: @_Kinan فهمته خطا ، صديقي بعمله سيرفر افضل ؟ addEvent( "11", true ) addEventHandler( "11", root, function (thePlayer) local money = getPlayerMoney(thePlayer) if (money > 1000) then if takePlayerMoney(thePlayer,1000) then setElementHealth ( thePlayer, getElementHealth(thePlayer) + 40 ) end end end end ) #Edit: ؟؟ Link to comment
mahmod3 Posted March 1, 2017 Author Share Posted March 1, 2017 23 hours ago, #_iMr.[E]coo said: @_Kinan فهمته خطا ، صديقي اريد اسوي نفس الشي على الدرع Link to comment
_Kinan Posted March 1, 2017 Share Posted March 1, 2017 1 minute ago, mahmod3 said: اريد اسوي نفس الشي على الدرع طيب اذا كان معه 60 و يكبس يزيد 10 و تصير 70 صحيح؟ Link to comment
mahmod3 Posted March 1, 2017 Author Share Posted March 1, 2017 23 hours ago, _Kinan said: طيب اذا كان معه 60 و يكبس يزيد 10 و تصير 70 صحيح؟ اي انا عملتها ع الدم الحين اريدها ع الدرع Link to comment
_Kinan Posted March 1, 2017 Share Posted March 1, 2017 1 minute ago, mahmod3 said: اي انا عملتها ع الدم الحين اريدها ع الدرع اولاً كودي صح تماماً + بدل setPlayerHealth سوي setPlayerArmor و بيظبط الدرع Link to comment
mahmod3 Posted March 1, 2017 Author Share Posted March 1, 2017 23 hours ago, _Kinan said: اولاً كودي صح تماماً + بدل setPlayerHealth سوي setPlayerArmor و بيظبط الدرع addEventHandler("onClientGUIClick",root, function () if source == dr310 then local m1 = getPlayerMoney(getLocalPlayer()) if ( m1 >=110 ) then takePlayerMoney(110) setPlayerArmor ( localPlayer, getPlayerArmor(localPlayer) + 90 ) end end end ) لالالا وش الحل Link to comment
Master_MTA Posted March 1, 2017 Share Posted March 1, 2017 function setplus10(player,type) if isElement(player)then if type then if type==1 then local plhel=getElementHealth(player) if plhel >= 100 then outputChatBox('Your Health is 100',player) return end setPlayerHealth(player,plhel+10) elseif type==2 then local plrarm=getPedArmor(player) if plrarm >= 100 then outputChatBox('Your Armor is 100',player) return end setPedArmor(player,plrarm+10) end end else outputChatBox('Type at argument 1 got nil',player) end else outputChatBox('Player at argument 1 got nil',player) end ) سويتلك الكود كامل يا غالي تحطه بجانب سيرفر فقط ما يصلح الطريقه بسيطه لو تبي صحه بتكون كذا setplus10(player,1) player اللاعب اللي تبي تزودله 1 النوع لو حطيته 1 بيزود دم ولو حطيته 2 بيزود درع setplus10(player,2) كذا يزود درع اهم شي ذا الكود اللي فوق تحطه بالسيرفر واستخدامك بيكون بجانب السيرفر Link to comment
Master_MTA Posted March 1, 2017 Share Posted March 1, 2017 Just now, mahmod3 said: ما نفع هات ملف السيرفر حقك الله يهديك Link to comment
mahmod3 Posted March 1, 2017 Author Share Posted March 1, 2017 Spoiler حل يا شباب addEvent( "ss", true ) addEventHandler( "ss", root, function (player,type) if isElement(player)then if type then if type==1 then local plhel=getElementHealth(player) if plhel >= 100 then outputChatBox('Your Health is 100',player) return end setPlayerHealth(player,plhel+10) elseif type==2 then local plrarm=getPedArmor(player) if plrarm >= 100 then outputChatBox('Your Armor is 100',player) return end setPedArmor(player,plrarm+10) end end else outputChatBox('Type at argument 1 got nil',player) end else outputChatBox('Player at argument 1 got nil',player) end ) وهي طويله كتيير انا اريدها قصيره مت ل الدم فوق Link to comment
Master_MTA Posted March 1, 2017 Share Posted March 1, 2017 3 minutes ago, mahmod3 said: Reveal hidden contents حل يا شباب addEvent( "ss", true ) addEventHandler( "ss", root, function (player,type) if isElement(player)then if type then if type==1 then local plhel=getElementHealth(player) if plhel >= 100 then outputChatBox('Your Health is 100',player) return end setPlayerHealth(player,plhel+10) elseif type==2 then local plrarm=getPedArmor(player) if plrarm >= 100 then outputChatBox('Your Armor is 100',player) return end setPedArmor(player,plrarm+10) end end else outputChatBox('Type at argument 1 got nil',player) end else outputChatBox('Player at argument 1 got nil',player) end ) وهي طويله كتيير انا اريدها قصيره مت ل الدم فوق عشان كذا قلتلك function setplus10(player,type) if isElement(player)then if type then if type==1 then local plhel=getElementHealth(player) if plhel >= 100 then outputChatBox('Your Health is 100',player) return end setPlayerHealth(player,plhel+10) elseif type==2 then local plrarm=getPedArmor(player) if plrarm >= 100 then outputChatBox('Your Armor is 100',player) return end setPedArmor(player,plrarm+10) end end else outputChatBox('Type at argument 1 got nil',player) end else outputChatBox('Player at argument 1 got nil',player) end ) addEvent('ss',true)-----------------هذا دم addEventHandler('ss',root,function() setplus10(source,1) end) addEvent('s1',true)----------------هذا يعطي درع addEventHandler('s1',root,function() setplus10(source,2) end) Link to comment
mahmod3 Posted March 1, 2017 Author Share Posted March 1, 2017 23 hours ago, Master_MTA said: عشان كذا قلتلك function setplus10(player,type) if isElement(player)then if type then if type==1 then local plhel=getElementHealth(player) if plhel >= 100 then outputChatBox('Your Health is 100',player) return end setPlayerHealth(player,plhel+10) elseif type==2 then local plrarm=getPedArmor(player) if plrarm >= 100 then outputChatBox('Your Armor is 100',player) return end setPedArmor(player,plrarm+10) end end else outputChatBox('Type at argument 1 got nil',player) end else outputChatBox('Player at argument 1 got nil',player) end ) addEvent('ss',true)-----------------هذا دم addEventHandler('ss',root,function() setplus10(source,1) end) addEvent('s1',true)----------------هذا يعطي درع addEventHandler('s1',root,function() setplus10(source,2) end) ما اشتغل Link to comment
Master_MTA Posted March 1, 2017 Share Posted March 1, 2017 Just now, mahmod3 said: ما اشتغل الله يهديك اعرض الكلنت الكود حق الضغط على الزر Link to comment
mahmod3 Posted March 1, 2017 Author Share Posted March 1, 2017 addEventHandler("onClientGUIClick",root, function () if source == dr310 then local m1 = getPlayerMoney(getLocalPlayer()) if ( m1 >=110 ) then takePlayerMoney(110) triggerServerEvent("ss",localPlayer) end end end ) Link to comment
Master_MTA Posted March 1, 2017 Share Posted March 1, 2017 ما بيشتغل اصلا عشان سطر 21 شل القوس منه #Edit: function setplus10(player,type) if isElement(player)then if type then if type==1 then local plhel=getElementHealth(player) if plhel >= 100 then outputChatBox('Your Health is 100',player) return end setPlayerHealth(player,plhel+10) elseif type==2 then local plrarm=getPedArmor(player) if plrarm >= 100 then outputChatBox('Your Armor is 100',player) return end setPedArmor(player,plrarm+10) end end else outputChatBox('Type at argument 1 got nil',player) end else outputChatBox('Player at argument 1 got nil',player) end addEvent('ss',true)-----------------هذا دم addEventHandler('ss',root,function() setplus10(source,1) end) addEvent('s1',true)----------------هذا يعطي درع addEventHandler('s1',root,function() setplus10(source,2) end) جرب Link to comment
mahmod3 Posted March 1, 2017 Author Share Posted March 1, 2017 Quote addEventHandler("onClientGUIClick",root, function () if source == dr310 then local m1 = getPlayerMoney(getLocalPlayer()) if ( m1 >=110 ) then takePlayerMoney(110) triggerServerEvent("ss",localPlayer) end end end ) ما اشتغل Link to comment
Master_MTA Posted March 1, 2017 Share Posted March 1, 2017 Just now, mahmod3 said: ما اشتغل دي بق وش يطلعلك؟ debugscript 3 اكتب ذي الكلمه باف 8 وانتر Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now