Jump to content

تعديل الكود


Recommended Posts

Client
local blipColours = {
	{ 255, 0, 0, "Red", false },
	{ 0, 255, 0, "Green", false },
	{ 0, 0, 255, "Blue", false },
	{ 255, 255, 0, "Yellow", false },
	{ 255, 0, 255, "Pink", false },
	{ 0, 255, 255, "Light-Blue", false },
	{ 255, 255, 255, "White", false }
}
----------
server
				local teams = {
					getTeamFromName("Los Santos Police Department"),
				}

             local x, y, z = getElementPosition(source)


function player_Wasted ( ammo, attacker, weapon, bodypart )
	if ( attacker ) then
		local tempString
		if ( getElementType ( attacker ) == "player" ) then
			tempString = getPlayerName ( attacker ).." killed "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")"
		elseif ( getElementType ( attacker ) == "vehicle" ) then
			tempString = getPlayerName ( getVehicleController ( attacker ) ).." killed "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")"
		end
		
		
		
			local theTeam = getPlayerTeam(thePlayer)

		local teamID = tonumber(getElementData(theTeam, "id"))

		if (teamID==1) then
		
		if ( bodypart == 9 ) then
			tempString = tempString.." (HEADSHOT!)"
		else
			tempString = tempString.." ("..getBodyPartName ( bodypart )..")"
		end
		outputChatBox ( tempString )
	else
		outputChatBox ( getPlayerName ( source ).." died. ("..getWeaponNameFromID ( weapon )..") ("..getBodyPartName ( bodypart )..")" )
		
		
		
        local x, y, z = getElementPosition(source)


		setBlipColor ( blipValue, 255, 255, 255, 255 )
end
         blip = getElementsByType ( "blip" )
        for blipKey, blipValue in blips do
	blipIcon = getBlipIcon ( blipValue )
	if ( blipIcon ~= 23 ) then
		setBlipIcon ( blipValue, 0 )

        end
    end
end
addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted )
end

ليه لمن اشغله و اقتل شخص ما يطلع شي؟

Edited by Ghost-Gamer
Link to comment
2 minutes ago, Ghost-Gamer said:

Client
local blipColours = {
	{ 255, 0, 0, "Red", false },
	{ 0, 255, 0, "Green", false },
	{ 0, 0, 255, "Blue", false },
	{ 255, 255, 0, "Yellow", false },
	{ 255, 0, 255, "Pink", false },
	{ 0, 255, 255, "Light-Blue", false },
	{ 255, 255, 255, "White", false }
}
----------
server
				local teams = {
					getTeamFromName("Los Santos Police Department"),
				}

             local x, y, z = getElementPosition(source)


function player_Wasted ( ammo, attacker, weapon, bodypart )
	if ( attacker ) then
		local tempString
		if ( getElementType ( attacker ) == "player" ) then
			tempString = getPlayerName ( attacker ).." killed "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")"
		elseif ( getElementType ( attacker ) == "vehicle" ) then
			tempString = getPlayerName ( getVehicleController ( attacker ) ).." killed "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")"
		end
		
		
		
			local theTeam = getPlayerTeam(thePlayer)

		local teamID = tonumber(getElementData(theTeam, "id"))

		if (teamID==1) then
		
		if ( bodypart == 9 ) then
			tempString = tempString.." (HEADSHOT!)"
		else
			tempString = tempString.." ("..getBodyPartName ( bodypart )..")"
		end
		outputChatBox ( tempString )
	else
		outputChatBox ( getPlayerName ( source ).." died. ("..getWeaponNameFromID ( weapon )..") ("..getBodyPartName ( bodypart )..")" )
		
		
		
        local x, y, z = getElementPosition(source)


		setBlipColor ( blipValue, 255, 255, 255, 255 )
end
         blip = getElementsByType ( "blip" )
        for blipKey, blipValue in blips do
	blipIcon = getBlipIcon ( blipValue )
	if ( blipIcon ~= 23 ) then
		setBlipIcon ( blipValue, 0 )

        end
    end
end
addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted )
end

ليه لمن اشغله و اقتل شخص ما يطلع شي؟

لأن كودك هريس بأختصار : )

  • Like 1
Link to comment
Just now, Ghost-Gamer said:

عربي وش يعني هريس؟

 

Spoiler
  1. رِيسٌ
    • [ هـ ر س ]. :- تَحَوَّلَ الْحَبُّ إِلَى هَرِيسٍ :- : الْحَبُّ الْمَدْقُوقُ بِالْمِهْرَاسِ .

    المعجم: الغني

  2. هَريس
    • هَريس :- 
      1 - حَبٌّ مهروس بالمِهراس قبل طبخه ، المدقوق عنيفًا . 
      2 - طعام يُصنع من الجريش .

    المعجم: اللغة العربية المعاصر

  3. هَريس
    • هريس 
      1 - هريس : مدقوق بعنف . 2 - هريس : حب مدقوق . 3 - هريس : طعام يطبخ من الحب المدقوق واللحم .

    المعجم: الرائد

  4. الهَرِيسُ
    • الهَرِيسُ : الحَبُّ المدقوقُ بالمهراس من قبل أَن يطبخ .

    المعجم: المعجم الوسيط

  5. هرس
    • " الهَرْسُ : الدَّق ، ومنه الهَرِيسَة . 
      وهَرَسَ الشيء يَهْرُسُه هَرْساً : دقَّه وكسره ، وقيل : الهَرْس دقك الشيء وبينه وبين الأَرض وقاية ، وقيل : هو دقُّك إِياه بالشيء العريض كماتُهْرَسُ الهَرِيسَةُ بالمِهْراس . 
      والمِهْراس : الآلة المَهْرُوس بها . 
      والهَرِيسُ : ما هُرِسَ ، وقيل : الهَرِيس الحب المهْروس قبل أَن يُطْبَخ ، فإِذا طبخ فهو الهَريسة ، وسميت الهَريسَةُ هَرِيسَةً لأَن البُرَّ الذي هي منه يدق ثم يطبخ ، ويسمى صانعُه هَرَّاساً . 
      وأَسد هَرَّاسٌ : يَهْرُس كل...
      المزيد

    المعجم: لسان العرب

كلمات قريبة

  1. انهرسَ
    • انهرسَ ينهرس ، انهراسًا ، فهو مُنهرِس :- 
      • انهرست تفَّاحةٌ تشوَّهت عند سقوطها . 
      • انهرست أصابعُه : مُطاوع هرَسَ : جُرحت جروحًا كثيرة نتيجة صدمة ، أو الضَّغط عليها .

    المعجم: اللغة العربية المعاصر

  2. هرس
    • " الهَرْسُ : الدَّق ، ومنه الهَرِيسَة . 
      وهَرَسَ الشيء يَهْرُسُه هَرْساً : دقَّه وكسره ، وقيل : الهَرْس دقك الشيء وبينه وبين الأَرض وقاية ، وقيل : هو دقُّك إِياه بالشيء العريض كماتُهْرَسُ الهَرِيسَةُ بالمِهْراس . 
      والمِهْراس : الآلة المَهْرُوس بها . 
      والهَرِيسُ : ما هُرِسَ ، وقيل : الهَرِيس الحب المهْروس قبل أَن يُطْبَخ ، فإِذا طبخ فهو الهَريسة ، وسميت الهَريسَةُ هَرِيسَةً لأَن البُرَّ الذي هي منه يدق ثم يطبخ ، ويسمى صانعُه هَرَّاساً . 
      وأَسد هَرَّاسٌ : يَهْرُس كل...
      المزيد

    المعجم: لسان العرب

  3. تَهْرِيسٌ
    • [ هـ ر س ]. ( مصدر هَرَّسَ ). :- تَهْرِيسُ الذُّرَةِ :- : دَقُّهَا دَقّاً شَدِيداً .

    المعجم: الغني

  4. هرَسَ
    • هرَسَ يهرُس ، هَرْسًا ، فهو هارس ، والمفعول مَهْروس :- 
       هرَس الشَّيءَ 
      1 - دقَّه وبينه وبين الأرض وقاية . 
      2 - دقَّه بشيء عريض . 
      3 - دقَّه دقًّا شديدًا :- هرَس القمح . 
       هرَس الطَّعامَ : أكله بعنف :- هرَس تفّاحة . 
       هرَس إصبعَه : أصابه بجروج كثيرة نتيجة ضغط قويّ أو صدمة عنيفة . 
      • هرَست عربةُ القطار رأسَ فلان : سحقته ودهسته .

^^ : )
باختصار كودك فيه اخطاء كثيرة 

Link to comment
1 minute ago, Ghost-Gamer said:

اجل ب debugscript ليه ما يطلع لي شي؟

وش الاغلاط؟

الاند بعد الحدث ,
الفاصلة الزايدة في الجدول حق التيمس ,
وسطر 53 

و54

عرفت شيء وكتبته غير

ماقدر اعدد لك كلهالاغلاط انصحك تعيد كتابة الكود

  • Like 1
Link to comment

المود ذا للحياة واقعية و كل سيرفرات تشتغل عليه و محد  قدر يسويه  انه الشخص لمن يموت يطلع علامة لللاسعاف انه في شخص ميت 

طبعا بالحياة واقعية ناس تبلغ اما اللعبة محد يعطي اهتمام و محد يبي يصير اسعاف لانه ماله عمل و انا ابي اسويه و بضل احاول  و احاول 

Client

local teams = {
					getTeamFromName("Los Santos Fire Department"),
				}

addEvent("createBlip", true)
addEvent("destroyBlip", true)

addEventHandler( "onPlayerWasted", getRootElement( ),
    
        function createBlip( availableColourIndex, colourArray )
	triggerEvent("destroyBlip", source, availableColourIndex)
	
	local x, y, z = getElementPosition(source)
	local tempBlip = createBlip(x, y, z, 0, 3, colourArray[1], colourArray[2], colourArray[3], 255, 255, 32767)
	attachElements(tempBlip, source)	
	blipHolder[availableColourIndex] = tempBlip
	table.insert(arr, tempBlip)
end
addEventHandler("createpBlip", getRootElement(), createBlip)

function destroyBlip( availableColourIndex )
	if blipHolder[availableColourIndex] and isElement(blipHolder[availableColourIndex] ) then
		for a, b in ipairs(arr) do
			if b == blipHolder[availableColourIndex] then
				table.remove(arr,a)
				break
			end
		end
		
		destroyElement( blipHolder[availableColourIndex] )
		blipHolder[availableColourIndex] = false
	end
end
addEventHandler("destroyBlip", getRootElement(), destroypBlip)
    
		local teamID = tonumber(getElementData(theTeam, "id"))

		if (teamID==1)
	end
)
  
  
  ---serverside
  local blipColours = {
	{ 255, 0, 0, "Red", false },
	{ 0, 255, 0, "Green", false },
	{ 0, 0, 255, "Blue", false },
	{ 255, 255, 0, "Yellow", false },
	{ 255, 0, 255, "Pink", false },
	{ 0, 255, 255, "Light-Blue", false },
	{ 255, 255, 255, "White", false }
}

الحين كذا كود صح؟

Link to comment
1 hour ago, Ghost-Gamer said:

المود ذا للحياة واقعية و كل سيرفرات تشتغل عليه و محد  قدر يسويه  انه الشخص لمن يموت يطلع علامة لللاسعاف انه في شخص ميت 

الكود ذا سهل جداً بس انت مبتدئ ومابتقدر تسويه بسرعة ,
فحاول ماتقارن مستواك بسيرفرات الاخرى .. 
( اما بالنسبة للكود فهو مهرس ( فيه اخطاء واجد 

Link to comment

طيب بضل احاول و احاول وش يعني مبتدا؟ عيب؟ فيها شي؟ كل شخص كان مبتدا و صار محترف 

و انا جاي هنا عشان تساعدوني مو عشان واحد يقول ذا سهل و انت مبتدا و مدري وشو

 

    x, y, z = getElementPosition(source)
	    local theBlip = createBlip( x, y, z)

  اكيد احتاج الكود ذا صح؟

 

اصلن شكلي ما بنجح  بضل كذا !

Link to comment
1 hour ago, Ghost-Gamer said:

طيب بضل احاول و احاول وش يعني مبتدا؟ عيب؟ فيها شي؟ كل شخص كان مبتدا و صار محترف 

و انا جاي هنا عشان تساعدوني مو عشان واحد يقول ذا سهل و انت مبتدا و مدري وشو

هاذي كلمتك بنفسك قلت ماحد قدر يسويها وفي كثير يسوونها بأسرع وقت بخلافك : ) .. هذا الي ابي اوضحه ,
والمفروض تعيد كتابة كودك لأن هريسة بأختصار ..

( بشرح لك طريقة العمل عشان تختصر اكوادك )
انت تبي ببساطة يصنع بلب لما اللاعب يموت صح ؟

وتظهرها لتيم معين ؟

"onPlayerWasted"
getElementPosition
createBlip
setElementVisibleTo -- 1x
for getPlayersInTeam getTeamFromName
setElementVisibleTo -- 2x
setTimer 
destroyElement -- blip

^ الفنكشنات المطلوبة لأعادة كتابة الكود : )

Link to comment

الا ابي اخفي العلامة يعني تطلع ل تيم محدد و بأستخدام 

				local teams = {
					getTeamFromName("Los Santos Fire Department"),
				}

يصير استخدم الكود ذا؟

local theTeam = getTeamFromName ( teamName )

او ذا احسن؟

نفس الشي اصلن

 

addEventHandler( "onPlayerWasted", getRootElement( ),
	function()
		setTimer( spawnPlayer, 60000, 1, source, 0, 0, 3 )
		
local Colours = {
	{ 255, 0, 0, "Red", false },
	{ 0, 255, 0, "Green", false },
	{ 0, 0, 255, "Blue", false },
	{ 255, 255, 0, "Yellow", false },
	{ 255, 0, 255, "Pink", false },
	{ 0, 255, 255, "Light-Blue", false },
	{ 255, 255, 255, "White", false }
}

         blip = getElementsByType ( "blip" )
for blipKey, blipValue in ipairs(blips) do
	blipIcon = getBlipIcon ( blipValue )
	if ( blipIcon ~= 0 ) then
		setBlipIcon ( blipValue, 0 )
	end
end		
		
local x, y, z getElementPosition ( thePlayer )
		
local blip = createBlip ( x, y, z, )

        setElementVisibleTo ( blip, thePlayer, true )
		
				local teams = {
					getTeamFromName("Los Santos Fire Department"),
				}
		
		destroyElement ( blip )			
		
	end
)

شكلة الكود هريس مرة ثانية 

Link to comment
local teamname = "Staff" ; 
local Blip = { } ;

addEventHandler ( "onPlayerWasted" , root , function ( )   
if ( getTeamFromName ( teamname ) ) then 
if ( isElement ( Blip [ source ] ) ) then 
destroyElement ( Blip[source] )
Blip[source] = nil
end
if ( #getPlayersInTeam(getTeamFromName(teamname)) ~= 0 ) then
for i,v in ipairs ( getPlayersInTeam ( getTeamFromName ( teamname ) ) ) do 
--if ( v ~= source ) then
local pos = { getElementPosition ( source ) } ; 
Blip[source] = createBlip ( pos[1] , pos[2] , pos[3] ) ;
setElementVisibleTo ( Blip[source] , v , true ) ; 
setTimer ( function (player)
destroyElement ( Blip[player] );
Blip[player] = nil 
outputChatBox("* تم إزالة علامتك",player,0,255,0,true)
end,5000,1,source);
--end
end
end
end
end
)

addEventHandler ( "onPlayerQuit" , root , function () 
if ( isElement ( Blip [ source ] ) ) then 
destroyElement ( Blip[source] )
Blip[source] = nil
end
end ) ;

شوف جربه

  • Like 1
Link to comment

شف هو اشتغل بس ثانية و العلامة تروح 

و لمن الشخص يسوي ريسباون  العلامة ما تروح من خريطه الي تحت على يسار

 ابي اسويها العلامة تروح لمن الشخص يسوي ريسباون

 

و اي شخص يقدر يشوف العلامة 

خلص غيرت الوقت بس التيم بعد

 

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