Jump to content

استفسار


Recommended Posts

Posted

السلام عليكم شباب اريد طريقة يعني لما شخص يكون دمه على سبيل المثال 40% واريده لما يشتري دم حقة 

40% 

يصير دمه

80%

؟؟؟

Posted
function giveH(p,per)
  local currentHealth = getPlayerHealth(p)
  setPlayerHealth(p, currentHealth+per)
end
-- مثال للكود حقي
giveH(source,50) -- source= اللاعب
-- 50 = كم بيزيد الدم حقه

 

Posted
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-- الصحة الي تعطيها اياه

Posted
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 = كم بيزيد الدم حقه

 

مشكورين ماقصرتوا

Posted
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-- الصحة الي تعطيها اياه

عطيني مثال -

ممكن كودك غلط

Posted
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

Posted (edited)
14 minutes ago, mahmod3 said:

addEventHandler("onClientGUIClick",root,
function  ( ) 
  if source == dm10 then 
    setElementHealth ( localPlayer, (getElementHealth(localPlayer)) + 40 )
  end
  end
)

 

@_Kinan فهمته خطا ، صديقي :)

Edited by #_iMr.[E]coo
Posted
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:

 

؟؟

 

Posted
1 minute ago, mahmod3 said:

اريد اسوي نفس الشي على الدرع

طيب اذا كان معه 60 و يكبس يزيد 10 و تصير 70

صحيح؟

Posted
23 hours ago, _Kinan said:

طيب اذا كان معه 60 و يكبس يزيد 10 و تصير 70

صحيح؟

اي انا عملتها ع الدم الحين اريدها ع الدرع

Posted
1 minute ago, mahmod3 said:

اي انا عملتها ع الدم الحين اريدها ع الدرع

اولاً كودي صح تماماً

+

بدل setPlayerHealth

سوي setPlayerArmor

و بيظبط الدرع

 

Posted
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
)

لالالا

 

وش الحل

Posted
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)

كذا يزود درع

اهم شي ذا الكود اللي فوق

تحطه بالسيرفر

واستخدامك بيكون بجانب السيرفر

Posted
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
)

وهي طويله كتيير انا اريدها قصيره مت ل الدم فوق

Posted
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)

 

Posted
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)

 

ما اشتغل

 

Posted

addEventHandler("onClientGUIClick",root,
function  () 
  if source == dr310 then 
 local m1 = getPlayerMoney(getLocalPlayer()) 
    if ( m1 >=110 ) then 
        takePlayerMoney(110)
		triggerServerEvent("ss",localPlayer)
  end
  end
  end
)

 

Posted

ما بيشتغل اصلا عشان سطر 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)

جرب

Posted
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
)

 

ما اشتغل

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