Jump to content

استفسار


Recommended Posts

18 hours ago, MR.President said:

في امر تتحقق من ان السياره مصلحه او لا ؟

 


جرب ذا

 

-- Client

function myVehicleHealth ()

	local isVehicle = getPedOccupiedVehicle ( localPlayer )

	if isVehicle then

		local theVehicle = getElementHealth ( isVehicle )
		outputChatBox ( "vehicle's health: "..theVehicle.."." )

		if theVehicle == 1000 then
		outputChatBox ( "vehicle's health: very good." )
		elseif theVehicle < 1000 and theVehicle >= 800 then
		outputChatBox ( "vehicle's health: good." )
		elseif theVehicle < 800 and theVehicle >= 500 then
		outputChatBox ( "vehicle's health: معقولة ض1." )
		elseif theVehicle < 500 and theVehicle >= 0 then
		outputChatBox ( "vehicle's health: bad vehicle." )
		end

		else
		outputChatBox ( "You are not inside vehicle." )

	end

end
addCommandHandler ( "myCarH", myVehicleHealth )

 

Edited by Killer Project
  • Like 1
Link to comment
2 hours ago, Killer Project said:

 


جرب ذا

 


-- Client

function myVehicleHealth ()

	local isVehicle = getPedOccupiedVehicle ( localPlayer )

	if isVehicle then

		local theVehicle = getElementHealth ( isVehicle )
		outputChatBox ( "vehicle's health: "..theVehicle.."." )

		if theVehicle == 1000 then
		outputChatBox ( "vehicle's health: very good." )
		elseif theVehicle < 1000 and theVehicle >= 800 then
		outputChatBox ( "vehicle's health: good." )
		elseif theVehicle < 800 and theVehicle >= 500 then
		outputChatBox ( "vehicle's health: معقولة ض1." )
		elseif theVehicle < 500 and theVehicle >= 0 then
		outputChatBox ( "vehicle's health: bad vehicle." )
		end

		else
		outputChatBox ( "You are not inside vehicle." )

	end

end
addCommandHandler ( "myCarH", myVehicleHealth )

 

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

من قالك ان الرجال يبي يستخدمه بكلنت

Link to comment

الزبده ليه التعب ذا كله

التحقق بيكون كذا

local veh=math.floor(getElementHealth(getPedOccupiedVehicle ( player )))
if  veh~=1000 then return end 

player

بدله باللاعب اللي تبي

بالنسبه للاخ ايكو

math.ceil

تحذف الارقام اللي بعد الفاصله

math.floor

تقرب

Link to comment
1 minute ago, Master_MTA said:

الزبده ليه التعب ذا كله

التحقق بيكون كذا


local veh=math.floor(getElementHealth(getPedOccupiedVehicle ( player )))
if  veh~=1000 then return end 

player

بدله باللاعب اللي تبي

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

Link to comment
7 minutes ago, Killer Project said:

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

الله يهديك وش تقول انت وش دخل التراجر بالموضوع؟

 

getElementHealth

يصلح بالجهتين الله  يهديك

@_@

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

Link to comment
7 minutes ago, Master_MTA said:

الله يهديك وش تقول انت وش دخل التراجر بالموضوع؟

 

getElementHealth

يصلح بالجهتين الله  يهديك

@_@

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


يخي انا اقصد اني ما اعرف اذا يبيه سيرفر او كلينت

وبما انك تقول وش دخل الترايجر

اذا تبيه سيرفر او كلينت اياً كان


 

-- Client
function myVehicleHealth ()

	local isVehicle = getPedOccupiedVehicle ( localPlayer )

	if isVehicle then

		local theVehicle = getElementHealth ( isVehicle )
		outputChatBox ( "vehicle's health: "..theVehicle.."." )

		if theVehicle == 1000 then
		outputChatBox ( "vehicle's health: very good." )
		triggerServerEvent("send1", localPlayer )
		elseif theVehicle < 1000 and theVehicle >= 800 then
		outputChatBox ( "vehicle's health: good." )
		triggerServerEvent("send2", localPlayer )
		elseif theVehicle < 800 and theVehicle >= 500 then
		outputChatBox ( "vehicle's health: معقولة ض1." )
		triggerServerEvent("send3", localPlayer )
		elseif theVehicle < 500 and theVehicle >= 0 then
		outputChatBox ( "vehicle's health: bad vehicle." )
		triggerServerEvent("send4", localPlayer )
		end

		else
		outputChatBox ( "You are not inside vehicle." )

	end

end
addCommandHandler ( "myCarH", myVehicleHealth )
-- Server
addEvent("send1", true)
addEventHandler("send1", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)
addEvent("send2", true)
addEventHandler("send2", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)
addEvent("send3", true)
addEventHandler("send3", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)
addEvent("send4", true)
addEventHandler("send4", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)


تراني احب اطول الاكواد هذا السبب ^_^
للسؤال اللي رح تطرحه

Edited by Killer Project
Link to comment
Just now, Killer Project said:


يخي انا اقصد اني ما اعرف اذا يبيه سيرفر او كلينت

وبما انك تقول وش دخل الترايجر

اذا تبيه سيرفر او كلينت اياً كان


 


-- Client
function myVehicleHealth ()

	local isVehicle = getPedOccupiedVehicle ( localPlayer )

	if isVehicle then

		local theVehicle = getElementHealth ( isVehicle )
		outputChatBox ( "vehicle's health: "..theVehicle.."." )

		if theVehicle == 1000 then
		outputChatBox ( "vehicle's health: very good." )
		triggerServerEvent("send1", localPlayer )
		elseif theVehicle < 1000 and theVehicle >= 800 then
		outputChatBox ( "vehicle's health: good." )
		triggerServerEvent("send2", localPlayer )
		elseif theVehicle < 800 and theVehicle >= 500 then
		outputChatBox ( "vehicle's health: معقولة ض1." )
		triggerServerEvent("send3", localPlayer )
		elseif theVehicle < 500 and theVehicle >= 0 then
		outputChatBox ( "vehicle's health: bad vehicle." )
		triggerServerEvent("send4", localPlayer )
		end

		else
		outputChatBox ( "You are not inside vehicle." )

	end

end
addCommandHandler ( "myCarH", myVehicleHealth )
-- Server
addEvent("send1", true)
addEventHandler("send1", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)
addEvent("send2", true)
addEventHandler("send2", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)
addEvent("send3", true)
addEventHandler("send3", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)
addEvent("send4", true)
addEventHandler("send4", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)


تراني احب اطول الاكواد هذا السبب ^_^
للسؤال اللي رح تطرحه

شف اخوي اعذرني 30 سطر ذا يسوي تحميل على اللاعب اول شي فما انصحك بتطويل الاكواد

+ ليه 3 ايفينتات بالسيرفر الله يهديك

التراقر مال امه داعي هنا ابد ابد

بما ان

getElementHealth

shared function

ليه ليه بس جلطتني الله يهديك

والتراقر كله تخبيص ترا

Link to comment
15 minutes ago, Master_MTA said:

شف اخوي اعذرني 30 سطر ذا يسوي تحميل على اللاعب اول شي فما انصحك بتطويل الاكواد

+ ليه 3 ايفينتات بالسيرفر الله يهديك

التراقر مال امه داعي هنا ابد ابد

بما ان

getElementHealth

shared function

ليه ليه بس جلطتني الله يهديك

والتراقر كله تخبيص ترا

بما انه تخبيص

جربه وشوف بنفسك .. واتأكد اني ما جربت ولا كود من اللي ساعدت بهم الباقيين من زمااااااااااااااان
لأنو بكل بساطة ما اشغل اللعبة

وخصوصاً ان كل ال30 سطر هدول رد فقط على

 

28 minutes ago, Master_MTA said:

الله يهديك وش تقول انت وش دخل التراجر بالموضوع؟

 

Link to comment
35 minutes ago, Killer Project said:


يخي انا اقصد اني ما اعرف اذا يبيه سيرفر او كلينت

وبما انك تقول وش دخل الترايجر

اذا تبيه سيرفر او كلينت اياً كان


 


-- Client
function myVehicleHealth ()

	local isVehicle = getPedOccupiedVehicle ( localPlayer )

	if isVehicle then

		local theVehicle = getElementHealth ( isVehicle )
		outputChatBox ( "vehicle's health: "..theVehicle.."." )

		if theVehicle == 1000 then
		outputChatBox ( "vehicle's health: very good." )
		triggerServerEvent("send1", localPlayer )
		elseif theVehicle < 1000 and theVehicle >= 800 then
		outputChatBox ( "vehicle's health: good." )
		triggerServerEvent("send2", localPlayer )
		elseif theVehicle < 800 and theVehicle >= 500 then
		outputChatBox ( "vehicle's health: معقولة ض1." )
		triggerServerEvent("send3", localPlayer )
		elseif theVehicle < 500 and theVehicle >= 0 then
		outputChatBox ( "vehicle's health: bad vehicle." )
		triggerServerEvent("send4", localPlayer )
		end

		else
		outputChatBox ( "You are not inside vehicle." )

	end

end
addCommandHandler ( "myCarH", myVehicleHealth )
-- Server
addEvent("send1", true)
addEventHandler("send1", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)
addEvent("send2", true)
addEventHandler("send2", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)
addEvent("send3", true)
addEventHandler("send3", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)
addEvent("send4", true)
addEventHandler("send4", root,
function( )
exports["guimessages"]:outputServer(client, "message", 255, 255, 0)
-- eny code
end
)


تراني احب اطول الاكواد هذا السبب ^_^
للسؤال اللي رح تطرحه

 

لا تطولها وهي قصيرة

addCommandHandler ( "myCarH",
	function ()
		local isVehicle = getPedOccupiedVehicle ( localPlayer )
		if isVehicle then
			local theVehicle = math.floor(getElementHealth ( isVehicle ))
			outputChatBox ( "vehicle's health: "..theVehicle.."." )
			if theVehicle == 100 then
				outputChatBox ( "vehicle's health: very good." )
				triggerServerEvent("newMessage", localPlayer, localPlayer, "myMessage." )
			elseif theVehicle < 100 and theVehicle >= 80 then
				outputChatBox ( "vehicle's health: good." )
				triggerServerEvent("newMessage", localPlayer, localPlayer, "myMessage." )
			elseif theVehicle < 80 and theVehicle >= 50 then
				outputChatBox ( "vehicle's health: معقولة ض1." )
				triggerServerEvent("newMessage", localPlayer, localPlayer, "myMessage." )
			elseif theVehicle < 50 and theVehicle >= 0 then
				outputChatBox ( "vehicle's health: bad vehicle." )
				triggerServerEvent("newMessage", localPlayer, localPlayer, "myMessage." )
			end
		else
			outputChatBox ( "You are not inside vehicle." )
		end
	end
)

-- Server

addEvent("newMessage", true)
addEventHandler("newMessage", root,
	function ( player , stringValue )
		if ( player ) and ( getElementType(player) == "player" ) then
			if ( stringValue and stringValue ~= "" ) then
				exports["guimessages"]:outputServer(player, stringValue, 255, 255, 0)
			end
		end
	end
)

 

Link to comment
1 minute ago, N3xT said:

لا تطولها وهي قصيرة


addCommandHandler ( "myCarH",
	function ()
		local isVehicle = getPedOccupiedVehicle ( localPlayer )
		if isVehicle then
			local theVehicle = math.floor(getElementHealth ( isVehicle ))
			outputChatBox ( "vehicle's health: "..theVehicle.."." )
			if theVehicle == 100 then
				outputChatBox ( "vehicle's health: very good." )
				triggerServerEvent("newMessage", localPlayer, localPlayer, "myMessage." )
			elseif theVehicle < 100 and theVehicle >= 80 then
				outputChatBox ( "vehicle's health: good." )
				triggerServerEvent("newMessage", localPlayer, localPlayer, "myMessage." )
			elseif theVehicle < 80 and theVehicle >= 50 then
				outputChatBox ( "vehicle's health: معقولة ض1." )
				triggerServerEvent("newMessage", localPlayer, localPlayer, "myMessage." )
			elseif theVehicle < 50 and theVehicle >= 0 then
				outputChatBox ( "vehicle's health: bad vehicle." )
				triggerServerEvent("newMessage", localPlayer, localPlayer, "myMessage." )
			end
		else
			outputChatBox ( "You are not inside vehicle." )
		end
	end
)

-- Server

addEvent("newMessage", true)
addEventHandler("newMessage", root,
	function ( player , stringValue )
		if ( player ) and ( getElementType(player) == "player" ) then
			if ( stringValue and stringValue ~= "" ) then
				exports["guimessages"]:outputServer(player, stringValue, 255, 255, 0)
			end
		end
	end
)

 


ما يخالف المهم ما يكون فيه اخطاء

Link to comment
25 minutes ago, Killer Project said:

بما انه تخبيص

جربه وشوف بنفسك .. واتأكد اني ما جربت ولا كود من اللي ساعدت بهم الباقيين من زمااااااااااااااان
لأنو بكل بساطة ما اشغل اللعبة

وخصوصاً ان كل ال30 سطر هدول رد فقط على

 

 

الله الله ماشاء الله تبارك الله مبدع يعيال كلر مافي منه 2

اف يسوي وما يشوف اللعبه

افففففف

فنان

يبوي يرحم امك غنتوني تعالي نصور مستعد للحظر لكن ذا غبني صراحه

كيف الرجال بيعرف رقم الصحه حقة السياره

اتوقع بسطت الامر كله في سطرين انا

هو قال يبي يتاكد متصلحه او لا يجيك واحد يتفلسف يحطلك 30 سطر ياخي غبنه اف

اعوذ بالله

نصور

حظر لا هنت

@!#NssoR_)

Link to comment

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

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


وكمان انا احب اتفلسف وحياك الله @Master_MTA

@!#NssoR_)

شوف صاحب الموضوع اذا يبي شي من هذا الموضوع او اغلقه يا نسور

  • Like 1
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...