Jump to content

الوان عشوائية للسيارة + تظليل


Recommended Posts

سلام عليكم

كيف اخلي السيارة الوانها تكون عشوائية بس هادية 

يعني مثلا مب اصفر احمر ازرق كذا

لا ابيها اصفر درجات بعدين تقلب احمر درجات بعدين ازرق 

زي سيرفرات الشوتر مثلا 

ـــــ

2-

+ كيف اضيف تظليل للسيارة ؟ 

ـــــ

3 -

هادا الكود يخلي السيارة ما تدمج ودايما تكون ال health حقها

1000

لكن لما اصدم تضل 1000 لكن الهيكل الخارجي يخرب حق السيارة , كيف اخليه ما يخرب؟

function handleVehicleDamage(attacker, weapon, loss, x, y, z, tire)
	if getElementData(source,"mostafaCar") == true then
		outputChatBox("d")
        cancelEvent()
    end
end
addEventHandler("onClientVehicleDamage", root, handleVehicleDamage)

 

Edited by Mr.Mostafa
Link to comment
On 22/08/2017 at 00:10, coNolel said:

طريقتك عجيبة

لكن وش رآيك ب حقتي :P


function RGBToHex(red, green, blue, alpha)
  if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then
    return nil
  end
  if(alpha) then
    return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
  else
    return string.format("#%.2X%.2X%.2X", red,green,blue)
  end
end
function rainbowString(text)
  local noColors = string.gsub(text, "#%x%x%x%x%x%x", "")
  local endString = {}
  for i=1,string.len(noColors) do
    local r = math.sin(0.3*i)*(math.cos(co.tick/25)*127)+128 
    local g = math.sin(0.3*i+(2*math.pi/3))*(math.sin(co.tick/25)*127)+128
    local b = math.sin(0.3*i+(4*math.pi/3))*(math.cos(co.tick/25)*127)+128
    local h = RGBToHex(r,g,b)
    local s = noColors:sub(i,i)
    endString[i] = h..s
  end
  return table.concat(endString,"")
end

الأكواد مو كاملة ، ادري

@killerProject

  • Like 1
Link to comment
5 hours ago, N3xT said:
On 21/08/2017 at 22:10, coNolel said:

طريقتك عجيبة

لكن وش رآيك ب حقتي :P



function RGBToHex(red, green, blue, alpha)
  if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then
    return nil
  end
  if(alpha) then
    return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
  else
    return string.format("#%.2X%.2X%.2X", red,green,blue)
  end
end
function rainbowString(text)
  local noColors = string.gsub(text, "#%x%x%x%x%x%x", "")
  local endString = {}
  for i=1,string.len(noColors) do
    local r = math.sin(0.3*i)*(math.cos(co.tick/25)*127)+128 
    local g = math.sin(0.3*i+(2*math.pi/3))*(math.sin(co.tick/25)*127)+128
    local b = math.sin(0.3*i+(4*math.pi/3))*(math.cos(co.tick/25)*127)+128
    local h = RGBToHex(r,g,b)
    local s = noColors:sub(i,i)
    endString[i] = h..s
  end
  return table.concat(endString,"")
end

الأكواد مو كاملة ، ادري

@killerProject

تسلم 

6 hours ago, Mr.Mostafa said:

2-

+ كيف اضيف تظليل للسيارة ؟ 

ـــــ

3 -

هادا الكود يخلي السيارة ما تدمج ودايما تكون ال health حقها

1000

لكن لما اصدم تضل 1000 لكن الهيكل الخارجي يخرب حق السيارة , كيف اخليه ما يخرب؟


function handleVehicleDamage(attacker, weapon, loss, x, y, z, tire)
	if getElementData(source,"mostafaCar") == true then
		outputChatBox("d")
        cancelEvent()
    end
end
addEventHandler("onClientVehicleDamage", root, handleVehicleDamage)

 

وعندي استفسار كمان

كيف اغير لون الكفرات ؟

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