Jump to content

استفسار


Recommended Posts

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

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

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