Jump to content

مشكلة في السكرب ياليت تساعدوني


Recommended Posts


--revive script by: sRT, Richard C' Lugovoi
function revivePlayerFromPK(thePlayer, commandName, targetPlayer)
	--local theTeam = getPlayerTeam(thePlayer)

		--if (teamID==1 or teamID==2 or teamID==3 or teamID==47 or teamID==59) then
							--	if exports.global:hasItem(thePlayer, 70) then
                     --   exports.global:takeItem(thePlayer, 70)
					--	outputChatBox("You have revived And Take From You 500$", thePlayer, 0, 255, 0)
		if getPlayerTeam( thePlayer ) == getTeamFromName( "وزارة صحة بون كونتري" ) then
		if not (targetPlayer) then
			outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Name / ID]", thePlayer, 255, 194, 14)
		else
			local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)
		    	if getElementData(targetPlayer, "dead") == 1 then  -- هاذي الي انا ظفت 
				if exports.global:hasMoney(targetPlayer, 500) then -- سعرالمعالجة
                     exports.global:takeMoney(targetPlayer, 500)  -- سعر المعالجة
					 else 
					   outputChatBox("لايوجد لديك المال الكافي لي علاجك", targetPlayer, 0, 255, 0)
					triggerClientEvent(targetPlayer,"es-system:closeRespawnButton",targetPlayer end 
						if targetPlayer then
					--fadeCamera(thePlayer, true)
					--outputChatBox("Respawning...", thePlayer)
					if isTimer(changeDeathViewTimer) == true then
						killTimer(changeDeathViewTimer)
					end
					
					
					local x,y,z = getElementPosition(targetPlayer)
					local int = getElementInterior(targetPlayer)
					local dim = getElementDimension(targetPlayer)
					local skin = getElementModel(targetPlayer)
					local team = getPlayerTeam(targetPlayer)
					
					setPedHeadless(targetPlayer, false)
					setCameraInterior(targetPlayer, int)
					setCameraTarget(targetPlayer, targetPlayer)
					setElementData(targetPlayer, "dead", 0)	 
					spawnPlayer(targetPlayer, x, y, z, 0)--, team)
					--(team ~= "Los Santos Emergency Services")
					
					setElementModel(targetPlayer,skin)
					setPlayerTeam(targetPlayer, team)
					setElementInterior(targetPlayer, int)
					setElementDimension(targetPlayer, dim)
					triggerEvent("updateLocalGuns", targetPlayer)
					--local adminTitle = tostring(exports.global:getPlayerAdminTitle(thePlayer))
					outputChatBox("المسعف"..tostring(getPlayerName(thePlayer):gsub("_"," ")).." قد قام بمعالجتك بنجاح", targetPlayer, 0, 255, 0)
					outputChatBox("لقد اسعفت المصاب بنجاح !! "..tostring(getPlayerName(targetPlayer):gsub("_"," "))..".", thePlayer, 0, 255, 0)
                 --  if exports.global:hasMoney(targetPlayer, 200) then -- سعرالمعالجة
                  --   exports.global:takeMoney(targetPlayer, 200)  -- سعر المعالجة
						--outputChatBox("لقد تمت معالجتك واخذ مبلغ $500", targetPlayer, 0, 255, 0)
					exports.global:sendMessageToAdmins("AdmCmd: "..getPlayerName(thePlayer).." mrevived "..tostring(getPlayerName(targetPlayer))..".")
					exports.logs:dbLog(thePlayer, 4, targetPlayer, "REVIVED from PK")
				else
					outputChatBox(tostring(getPlayerName(targetPlayer):gsub("_"," ")).." ليس ميت.", thePlayer, 255, 0, 0)
				end
			end
		end
	end
end
addCommandHandler("mrevive", revivePlayerFromPK, false, false)

-- /mrevive  system by sRT
function adminHeal(thePlayer, commandName, targetPlayer)
		if getPlayerTeam( thePlayer ) == getTeamFromName( "وزارة صحة بون كونتري" ) then  -- اسم الفاكشن
		local health = 100
		local targetPlayerName = getPlayerName(thePlayer):gsub("_", " ")
		if not (targetPlayer) then
			targetPlayer = thePlayer
		else
			targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)
		end

			if exports.global:hasMoney(targetPlayer, 200) then -- سعرالمعالجة
                exports.global:takeMoney(targetPlayer, 200)  -- سعر المعالجة
			    outputChatBox("لقد تمت معالجتك من قبل المسعف واخذ مبلغ $200", targetPlayer, 0, 255, 0) -- رسالةتم اذ منك 200 ومعالجتك 
				else
				outputChatBox("لايوجد لديك المال الكافي لي علاجك", targetPlayer, 0, 255, 0)
		end
		
		if targetPlayer then
			setElementHealth(targetPlayer, tonumber(health))
		--	outputChatBox("The Medic " .. targetPlayerName .. " Has Treat You , Now Your Health : " .. getAlivePlayers .. " Health.", thePlayer, 0, 255, 0)
			outputChatBox("المسعف " .. thePlayer .. " قام بمعالجتك طاقتك الان : " .. health .. " الطاقة.", targetPlayer, 0, 255, 0)
			else
			triggerEvent("onPlayerHeal", targetPlayer, true)
			exports.logs:dbLog(thePlayer, 4, targetPlayer, "AHEAL "..health)
		end
	end
end
addCommandHandler("maheal", adminHeal, false, false) -- ألتكملةالحلقة القادمة sRT, Richard C' Lugovoi

 

 

السلام عليكم ورحمة الله وبركاته 

.. يعطيكم العافيه جميعاَ بعا الكود هذا حصلته في النت .. وكان فيه شوي اخطا وعدلت عليه واشتغل السكربت معاي بدون مشاكل 

من المشاكل الي كانت فيه ان المسعف اذا عالج شخص بي استخدام الامر )

/maheal 

تخصم الفلوس من حساب المسعف بدالَ من حساب المصاب 

وبرضو اذا استخدم الامر 

/mrevive 

ما يتحقق من وجود المال في مع المصاب .. + مايخصم شي منه يعني يسويله ريفايف مجاني  .. حاولت اني اظيف الي  انا حددت فوق والي هي 

exports.global:hasMoney 

+ takemoney 

بي استخدام  

if + than + else + end 

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

او انه لين الححين  متعلق فوق  مو قادر يقرا الكود ويكمل لين امر الريفايف  .. 

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

وشكراَ لكم  

Link to comment
8 minutes ago, [T]|O|[P]George said:

لكن تقدر تعدلها خليها نقطة ولا اكتب

DELETED

 

14 minutes ago, KillerX said:

عشان يشوف الموضوعين ^

يالربع قولو لا اله الى الله  ... 

المشرفين بينتبهون لي الموضوعين وبيحذفون واحد منها 

الي عنده معلومه لي يفيديني  لا يقصر ..  لاهنتمم 

والله كل ما جتني مشكله انزلها هنا ولا احد ساعدني وحلها كل مشاركاتي في 

MTA العربي مسحوب عليها بروح اجرب الانقليزي افضل ... 

Link to comment
27 minutes ago, [T]|O|[P]George said:

طيب لو عندك تاجات ادمجها مع المود خليه لو كتب الكوماند يعطيه الدم و يتحقق من ان دمه اقل من 200 او 100 و ياخذ منه الفلوس

~

المشكلة جوال لفضيت بحاول اساعدك اكثر

انت ما فهمت علي او انا ما فهمت عليك ... 

لي التوضيح بس  .. الحين امر 

/maheal  

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

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

Link to comment
14 minutes ago, SullyDawish said:

انت ما فهمت علي او انا ما فهمت عليك ... 

لي التوضيح بس  .. الحين امر 

/maheal  

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

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

لانك ما دمجته ~

والله الحين اصيف ، و فاتح باقة فمدري اذا انا صح او لا في الي قلته 

انا الي شايفه ان السكريبت ماهو مدموج مع التاجات يعني يوم تكتب الكلمة ما يحصل شيء ذا معناه انه ماهو متعرف 

+ انا كاتب exports.global 

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

Link to comment
3 minutes ago, [T]|O|[P]George said:

لانك ما دمجته ~

والله الحين اصيف ، و فاتح باقة فمدري اذا انا صح او لا في الي قلته 

انا الي شايفه ان السكريبت ماهو مدموج مع التاجات يعني يوم تكتب الكلمة ما يحصل شيء ذا معناه انه ماهو متعرف 

+ انا كاتب exports.global 

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

function revivePlayerFromPK(thePlayer, commandName, targetPlayer)

		if getPlayerTeam( thePlayer ) == getTeamFromName( "Los Santos Fire Department" ) then
		if not (targetPlayer) then
			outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Name / ID]", thePlayer, 255, 194, 14)
		else
			local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)
			
			if targetPlayer then
				if getElementData(targetPlayer, "dead") == 1 then
					triggerClientEvent(targetPlayer,"es-system:closeRespawnButton",targetPlayer)
					--fadeCamera(thePlayer, true)
					--outputChatBox("Respawning...", thePlayer)
					if isTimer(changeDeathViewTimer) == true then
						killTimer(changeDeathViewTimer)
					end
					
					
					local x,y,z = getElementPosition(targetPlayer)
					local int = getElementInterior(targetPlayer)
					local dim = getElementDimension(targetPlayer)
					local skin = getElementModel(targetPlayer)
					local team = getPlayerTeam(targetPlayer)
					
					setPedHeadless(targetPlayer, false)
					setCameraInterior(targetPlayer, int)
					setCameraTarget(targetPlayer, targetPlayer)
					setElementData(targetPlayer, "dead", 0)	 
					spawnPlayer(targetPlayer, x, y, z, 0)--, team)
					--(team ~= "Los Santos Emergency Services")
					
					setElementModel(targetPlayer,skin)
					setPlayerTeam(targetPlayer, team)
					setElementInterior(targetPlayer, int)
					setElementDimension(targetPlayer, dim)
					triggerEvent("updateLocalGuns", targetPlayer)
					--local adminTitle = tostring(exports.global:getPlayerAdminTitle(thePlayer))
					outputChatBox("The medic  "..tostring(getPlayerName(thePlayer):gsub("_"," ")).." has been revived you", targetPlayer, 0, 255, 0)
					outputChatBox("You have revived "..tostring(getPlayerName(targetPlayer):gsub("_"," "))..".", thePlayer, 0, 255, 0)
						--if exports.global:hasItem(thePlayer, 34) then
                      --  exports.global:takeItem(thePlayer, 34)
					--	outputChatBox("You have revived And Take From You 500$", thePlayer, 0, 255, 0)
					exports.global:sendMessageToAdmins("AdmCmd: "..getPlayerName(thePlayer).." mrevived "..tostring(getPlayerName(targetPlayer))..".")
					exports.logs:dbLog(thePlayer, 4, targetPlayer, "REVIVED from PK")
				else
					outputChatBox(tostring(getPlayerName(targetPlayer):gsub("_"," ")).." is not dead.", thePlayer, 255, 0, 0)
				end
			end
		end
	end
end
addCommandHandler("mrevive", revivePlayerFromPK, false, false)

-- /mrevive  system by sRT
function adminHeal(thePlayer, commandName, targetPlayer)
		if getPlayerTeam( thePlayer ) == getTeamFromName( "Los Santos Fire Department" ) then  -- faction name 
		local health = 100
		local targetPlayerName = getPlayerName(thePlayer):gsub("_", " ")
		if not (targetPlayer) then
			targetPlayer = thePlayer
		else
			targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)
		end

			if exports.global:hasMoney(thePlayer, 200) then -- treatment cost
                exports.global:takeMoney(thePlayer, 200)  -- treatment cost 
			    outputChatBox("You have been revived and take from you 200$", targetPlayer, 0, 255, 0) -- output 
				else
				outputChatBox("You dont have money", targetPlayer, 0, 255, 0)
		end
		
		if targetPlayer then
			setElementHealth(targetPlayer, tonumber(health))
		--	outputChatBox("The Medic " .. targetPlayerName .. " Has Treat You , Now Your Health : " .. getAlivePlayers .. " Health.", thePlayer, 0, 255, 0)
			outputChatBox("The medic " .. targetPlayerName .. " has treat you  , now your health is : " .. health .. " health.", thePlayer, 0, 255, 0)
			else
			triggerEvent("onPlayerHeal", targetPlayer, true)
			exports.logs:dbLog(thePlayer, 4, targetPlayer, "AHEAL "..health)
		end
	end
end
addCommandHandler("maheal", adminHeal, false, false) 

طيب هنا قبل الاستخراج من غير مشاكل .. و اشتغل الامر وسوا ريفايف .. 

بس ما سويت تحقق من الحساب ولا خصم الفلوس .. 

 

Link to comment
function ()
  local money = getPlayerMoney (source)
  if ( money >= السعر ) then
    takePlayerMoney (source,السعر )
    outputChatBox ("You Got ~~ For ~~",source,255,255,255,true)
    end
  end

ذا يتحقق من فلوس اللاعب لو اكبر او يساوي السعر 

فبيسحب منه المبلغ و انت عدل الكلام

Link to comment

حليت المشكلة شكرا لي الي حاولو يساعدوني  .. المشكلة كانت في الترتيب بس  .. 

بعد ما رتبت الكود كل شي زبط 

 

هنا الكود بعد ما عدلت عليه لي الي حاب يفهم وين كانت المشكلة .. 

 

--[[ -- ألإصدار القادم سيتم فتح هذا -
---addCommandHandler("alive", getAlivePlayers, false, false)
--function getAlivePlayers( alivePlayersList )
function alivePlayers( getAlivePlayers, alivePlayersList ) --()
if ( alivePlayers ) then -- if we got the table
    alivePlayersList = "none"
    -- Loop through the table
    for playerKey, playerValue in ipairs(alivePlayers) do
        -- add their name to the list
        if ( alivePlayersList == "none" ) then
            alivePlayersList = getPlayerName ( playerValue )
        else
            alivePlayersList = alivePlayersList .. ", " .. getPlayerName ( playerValue )
        end
    end
    outputChatBox ( alivePlayersList .. " : اللاعبين الذين هم على قيد الحياة: ")   -   
end
addCommandHandler("aaa" ,getAlivePlayers, alivePlayersList)
]]
--revive script by: sRT, Richard C' Lugovoi
function revivePlayerFromPK(thePlayer, commandName, targetPlayer)
	--local theTeam = getPlayerTeam(thePlayer)

		--if (teamID==1 or teamID==2 or teamID==3 or teamID==47 or teamID==59) then
							--	if exports.global:hasItem(thePlayer, 70) then
                     --   exports.global:takeItem(thePlayer, 70)
					--	outputChatBox("You have revived And Take From You 500$", thePlayer, 0, 255, 0)
		if getPlayerTeam( thePlayer ) == getTeamFromName( "وزارة صحة بون كونتري" ) then
				if not (targetPlayer) then
			outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Name / ID]", thePlayer, 255, 194, 14)
		else
			local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)
			
			if targetPlayer then
				if getElementData(targetPlayer, "dead") == 1 then
					triggerClientEvent(targetPlayer,"es-system:closeRespawnButton",targetPlayer)
					--fadeCamera(thePlayer, true)
					--outputChatBox("Respawning...", thePlayer)
					if isTimer(changeDeathViewTimer) == true then
						killTimer(changeDeathViewTimer)
					end
					
					
					local x,y,z = getElementPosition(targetPlayer)
					local int = getElementInterior(targetPlayer)
					local dim = getElementDimension(targetPlayer)
					local skin = getElementModel(targetPlayer)
					local team = getPlayerTeam(targetPlayer)
					
					setPedHeadless(targetPlayer, false)
					setCameraInterior(targetPlayer, int)
					setCameraTarget(targetPlayer, targetPlayer)
					setElementData(targetPlayer, "dead", 0)	 
					spawnPlayer(targetPlayer, x, y, z, 0)--, team)
					--(team ~= "Los Santos Emergency Services")
					
					setElementModel(targetPlayer,skin)
					setPlayerTeam(targetPlayer, team)
					setElementInterior(targetPlayer, int)
					setElementDimension(targetPlayer, dim)
					triggerEvent("updateLocalGuns", targetPlayer)
					if exports.global:hasMoney(thePlayer, 200) then -- سعرالمعالجة
					exports.global:takeMoney(thePlayer, 200)  -- سعر المعالجة
					outputChatBox("You have been revived and take from you 200$", thePlayer, 0, 255, 0) -- رسالةتم اذ منك 200 ومعالجتك 
				else
					outputChatBox("You dont have money", thePlayer, 0, 255, 0)
					end
					outputChatBox("The medic  "..tostring(getPlayerName(thePlayer):gsub("_"," ")).." has been revived you", targetPlayer, 0, 255, 0)
					outputChatBox("You have revived "..tostring(getPlayerName(targetPlayer):gsub("_"," "))..".", thePlayer, 0, 255, 0)
					--	if exports.global:hasItem(thePlayer, 34) then
                     --  exports.global:takeItem(thePlayer, 34)
					--	outputChatBox("You have revived And Take From You 500$", thePlayer, 0, 255, 0)
					exports.global:sendMessageToAdmins("AdmCmd: "..getPlayerName(thePlayer).." mrevived "..tostring(getPlayerName(targetPlayer))..".")
					exports.logs:dbLog(thePlayer, 4, targetPlayer, "REVIVED from PK")
				else
					outputChatBox(tostring(getPlayerName(targetPlayer):gsub("_"," ")).." is not dead.", thePlayer, 255, 0, 0)
				end
			end
		end
	end
end
addCommandHandler("mrevive", revivePlayerFromPK, false, false)

-- /mrevive  system by sRT
function adminHeal(thePlayer, commandName, targetPlayer)
		if getPlayerTeam( thePlayer ) == getTeamFromName( "وزارة صحة بون كونتري" ) then  -- اسم الفاكشن
		local health = 100
		local targetPlayerName = getPlayerName(thePlayer):gsub("_", " ")
		if not (targetPlayer) then
			targetPlayer = thePlayer
		else
			targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)
		end

			if exports.global:hasMoney(targetPlayer, 200) then -- سعرالمعالجة
                exports.global:takeMoney(targetPlayer, 200)  -- سعر المعالجة
			    outputChatBox("لقد تمت معالجتك من قبل المسعف واخذ مبلغ $200", targetPlayer, 0, 255, 0) -- رسالةتم اذ منك 200 ومعالجتك 
				else
				outputChatBox("لايوجد لديك المال الكافي لي علاجك", targetPlayer, 0, 255, 0)
		end
		
		if targetPlayer then
			setElementHealth(targetPlayer, tonumber(health))
		--	outputChatBox("The Medic " .. targetPlayerName .. " Has Treat You , Now Your Health : " .. getAlivePlayers .. " Health.", thePlayer, 0, 255, 0)
			outputChatBox("المسعف " .. thePlayer .. " قام بمعالجتك طاقتك الان : " .. health .. " الطاقة.", targetPlayer, 0, 255, 0)
			else
			triggerEvent("onPlayerHeal", targetPlayer, true)
			exports.logs:dbLog(thePlayer, 4, targetPlayer, "AHEAL "..health)
		end
	end
end
addCommandHandler("maheal", adminHeal, false, false) -- ألتكملةالحلقة القادمة sRT, Richard C' Lugovoi

 

 

 

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