YourMind Posted March 30, 2016 Share Posted March 30, 2016 يمكن المشكلة انك لازم تزييد قيمة الدم للاعب عن 1 Link to comment
taha201100 Posted March 30, 2016 Author Share Posted March 30, 2016 اشتغل بس كودك صار غير مفهوم وش غيرت وليه Link to comment
taha201100 Posted March 30, 2016 Author Share Posted March 30, 2016 يمكن المشكلة انك لازم تزييد قيمة الدم للاعب عن 1 يب انا غيرت الدم من+1 الى 1.5 واشتغلوا ههههههههه بجوز مشان ما ينفع يتكرر ارقام ولا انا غلطان Link to comment
#|_oskar_|# Posted March 30, 2016 Share Posted March 30, 2016 اشتغل بس كودك صار غير مفهوم وش غيرت وليه ماغيرت شئ فيه بس ضفت تحقق وقتل الوقت لو اللاعب ضغط اكثر من مره على الزر مايكرر التايمر والدم ماينفع تزوده 1 لازم يكون اكثر من ال 1 عشان يزيد Link to comment
taha201100 Posted March 30, 2016 Author Share Posted March 30, 2016 addEvent ("armor", true) addEventHandler ("armor", root, function () l = source ti = setTimer ( function () if getElementHealth ( 1 ) == 100 then killTimer ( ti ) setPedArmor ( l, getPedArmor ( l) + 1 ) setElementHealth( l, getElementHealth ( l ) + 1.6) end,1000, 0) end end ) طيب انا بنهي الوقت لما يصير الدم فل يقولي غلط سطر 9 فيه شي؟ Link to comment
Me[Z]oO Posted March 30, 2016 Share Posted March 30, 2016 addEvent ("armor", true) addEventHandler ("armor", root, function () l = source ti = setTimer ( function () if getElementHealth ( 1 ) == 100 then killTimer ( ti ) setPedArmor ( l, getPedArmor ( l) + 1 ) setElementHealth( l, getElementHealth ( l ) + 1.6) end,1000, 1) end end ) Link to comment
YourMind Posted March 30, 2016 Share Posted March 30, 2016 (edited) ti = {} 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 ("armor", true) addEventHandler ("armor", root, function () l = source ti[source] = setTimer ( function () if getElementHealth ( l ) == getPedMaxHealth(l) then return killTimer ( ti[l] ) end setPedArmor ( l, getPedArmor ( l) + 1.6 ) setElementHealth( l, getElementHealth ( l ) + 1.6) end,1000, 0) end ) Edited March 30, 2016 by Guest Link to comment
Me[Z]oO Posted March 30, 2016 Share Posted March 30, 2016 ti = {} 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 ("armor", true) addEventHandler ("armor", root, function () l = source ti[source] = setTimer ( function () if getElementHealth ( l ) == getPedMaxHealth(l) then return killTimer ( ti[source] ) end setPedArmor ( l, getPedArmor ( l) + 1 ) setElementHealth( l, getElementHealth ( l ) + 1.6) end,1000, 0) end ) ليه م تتحق ان الدم 100؟ بدل اليوسفل فنكشم Link to comment
YourMind Posted March 30, 2016 Share Posted March 30, 2016 ti = {} 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 ("armor", true) addEventHandler ("armor", root, function () l = source ti[source] = setTimer ( function () if getElementHealth ( l ) == getPedMaxHealth(l) then return killTimer ( ti[source] ) end setPedArmor ( l, getPedArmor ( l) + 1 ) setElementHealth( l, getElementHealth ( l ) + 1.6) end,1000, 0) end ) ليه م تتحق ان الدم 100؟ بدل اليوسفل فنكشم طيب لو دمك الكامل اعلي من 100 ؟ هو دة المفيد في الفنكشن دة Link to comment
ivor Posted March 30, 2016 Share Posted March 30, 2016 لو تبحث بالمنتدي والويكي وتفهم انقلش ماراح تحتاج لنا لكن مب كل ساعه موضوع Link to comment
#Soking Posted March 30, 2016 Share Posted March 30, 2016 Error404 الرجال حاط موضوع وبده مساعده تبي تساعده تفضل , مابدنا ازعاج كل موضوع تتدخل تتفلسف مادري ليه Link to comment
ivor Posted March 30, 2016 Share Posted March 30, 2016 مالك دخل ؟ تسمح انصح الرجال يجمع كل طلباته بموضوع مب كل ساعه ويوم موضوع Link to comment
#|_oskar_|# Posted March 31, 2016 Share Posted March 31, 2016 يوقف الوقت بعد التعبئه ملاحظه : انا حاطت كلام يظهر بالشات كتوضيح فقط اذا كنت تبي تشيله براحتك بس عندي احساس راح تقول كودك صعب ومدرى ايش بس يلا اذا ماكنت راح تستخدمه يمكن يفيد غيرك healthTimer = {} addEvent ("armor", true) addEventHandler ("armor", root,function () if healthTimer[source] and isTimer(healthTimer[source]) then killTimer(healthTimer[source]) end healthTimer[source] = setTimer ( function (source) Health = getElementHealth (source) Armor = getPlayerArmor (source) if Health < 100 or Armor < 100 then if isElement(source) then setPlayerArmor (source ,Armor+1) setElementHealth (source,Health+1.5) outputChatBox ("Your Heath ["..math.ceil(Health)..'] Your Armor ['..math.ceil(Armor).. ']',source,255,0,0,true) end elseif isElement(source) then killTimer(healthTimer[source]) healthTimer[source] = nil outputChatBox ('تمت التعبئه',source,255,0,0,true) end end,1000,0,source) end) Link to comment
taha201100 Posted March 31, 2016 Author Share Posted March 31, 2016 لو تبحث بالمنتدي والويكي وتفهم انقلش ماراح تحتاج لنا لكن مب كل ساعه موضوع معلش مو كل موضوع تيجي تقولي اجمع ومدري بالله تبيني اتنبىء لك بكل طلباتي المستقبلية؟؟ +اوسكار كودك ما هو صعب بس فيه شي اثنين ما فهمته من كودك healthTimer = {} القوسين ذول وش بالضبط وظيفتهم؟؟ isTimer ذا وش يسوي +isElement ذا ومشكورين ما قصرتوا Link to comment
Abdul KariM Posted March 31, 2016 Share Posted March 31, 2016 لو تبحث بالمنتدي والويكي وتفهم انقلش ماراح تحتاج لنا لكن مب كل ساعه موضوع معلش مو كل موضوع تيجي تقولي اجمع ومدري بالله تبيني اتنبىء لك بكل طلباتي المستقبلية؟؟ +اوسكار كودك ما هو صعب بس فيه شي اثنين ما فهمته من كودك healthTimer = {} القوسين ذول وش بالضبط وظيفتهم؟؟ isTimer ذا وش يسوي +isElement ذا ومشكورين ما قصرتوا 1 - هذا عشان يسوي التيبل " جدول " ء 2 - هذا يتحقق من وجود التايمر 3 - وهذا يتحقق من وجود الالمنت 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