Jump to content

,,,مساعده


LOAM

Recommended Posts

2 minutes ago, LOAM said:

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

لما تكون صحتو ناقصه

وشكرا

getPlayerTeam
getTeamName

"onClientPlayerWeaponFire"

getElementHealth
setElementHealth


-- عن طريق اطلاق النار بسلاح معين

 

Edited by Killer Project
Link to comment
local marker={}
function markerfunc(p)
  setElementHealth(p,100)
  givePlayerMoney(getElementData(source,'creator'),1000)
  end
addCommandHandler('sethel',function(p)
if isElement(marker[p]) then destroyElement(marker[p]) return end
local x,y,z=getElementPosition(p)

local marker[p]=createMarker(x,y,z....)
setElementData(marker[p],'creator',p)
addEventHandler('onMarkerHit',marker[p],markerfunc)

end)

عطيتك مثال بسيط حاول بنفسك انت

Link to comment
8 minutes ago, Killer Project said:

getPlayerTeam
getTeamName
createMarker
setElementPosition
"onMarkerHit"
setElementHealth

 

 

3 minutes ago, Master_MTA said:

local marker={}
function markerfunc(p)
  setElementHealth(p,100)
  givePlayerMoney(getElementData(source,'creator'),1000)
  end
addCommandHandler('sethel',function(p)
if isElement(marker[p]) then destroyElement(marker[p]) return end
local x,y,z=getElementPosition(p)

local marker[p]=createMarker(x,y,z....)
setElementData(marker[p],'creator',p)
addEventHandler('onMarkerHit',marker[p],markerfunc)

end)

عطيتك مثال بسيط حاول بنفسك انت

شكرا شباب

Link to comment
12 minutes ago, LOAM said:

 

شكرا شباب

بصراحة ماني متأكد لكن يمديك تجرب

 

function Command ( Player )

local playerTeam = getPlayerTeam ( Player )
local teamName = getTeamName ( playerTeam )

if teamName == "team" then

x, y, z = getElementPosition ( Player )

if mMarker then
destroyElement ( mMarker )
mMarker = createMarker ( x, y, z, "cylinder", 1.5, 0, 255, 0, 150 )
else
mMarker = createMarker ( x, y, z, "cylinder", 1.5, 0, 255, 0, 150 )
end

end

end

addCommandHandler ( "CreateM", Command )

function onHit ( Hiter )

if source == mMarker then
setElementHealth ( Hiter, 200 )
takePlayerMoney ( Hiter, 200 )
givePlayerMoney ( Player, 200 )
end

end

addEventHandler ( "onMarkerHit", root, onHit )

 

  • Like 1
Link to comment
31 minutes ago, Killer Project said:

بصراحة ماني متأكد لكن يمديك تجرب

 


function Command ( Player )

local playerTeam = getPlayerTeam ( Player )
local teamName = getTeamName ( playerTeam )

if teamName == "team" then

x, y, z = getElementPosition ( Player )

if mMarker then
destroyElement ( mMarker )
mMarker = createMarker ( x, y, z, "cylinder", 1.5, 0, 255, 0, 150 )
else
mMarker = createMarker ( x, y, z, "cylinder", 1.5, 0, 255, 0, 150 )
end

end

end

addCommandHandler ( "CreateM", Command )

function onHit ( Hiter )

if source == mMarker then
setElementHealth ( Hiter, 200 )
takePlayerMoney ( Hiter, 200 )
givePlayerMoney ( Player, 200 )
end

end

addEventHandler ( "onMarkerHit", root, onHit )

 

شكرا اخى بجرب الان

Link to comment

ما بيصلح يقلبي لو سوا اي شخص اخر

ماركر بيروح من عند الشخص الاول

36 minutes ago, Killer Project said:

بصراحة ماني متأكد لكن يمديك تجرب

 


function Command ( Player )

local playerTeam = getPlayerTeam ( Player )
local teamName = getTeamName ( playerTeam )

if teamName == "team" then

x, y, z = getElementPosition ( Player )

if mMarker then
destroyElement ( mMarker )
mMarker = createMarker ( x, y, z, "cylinder", 1.5, 0, 255, 0, 150 )
else
mMarker = createMarker ( x, y, z, "cylinder", 1.5, 0, 255, 0, 150 )
end

end

end

addCommandHandler ( "CreateM", Command )

function onHit ( Hiter )

if source == mMarker then
setElementHealth ( Hiter, 200 )
takePlayerMoney ( Hiter, 200 )
givePlayerMoney ( Player, 200 )
end

end

addEventHandler ( "onMarkerHit", root, onHit )

 

 

Link to comment
2 minutes ago, Master_MTA said:

ارسلت لك كودي فوق؟

شكرا اخى بس بيطلع خطاء لما بركبه فى ملف الكلنت  معا التيم 

سطرl  local marker[p]=createMarker(x,y,z....)

local markerSF2 = createMarker (-2675.5,634.5,14.5,"cylinder", 1.5, 25, 112, 255, 0 )

addEventHandler("onClientMarkerHit",markerSF2, --عند لمس الماركر المحدد
function()--وظيفة
           addEventHandler("onClientRender",root,dxpanel)--تفتح اللوحة
         guiSetVisible( memo,true)
      guiSetVisible(Close,true)
   guiSetVisible(Join,true)
showCursor(true) --نظهر الماوس
end --نهاية الوظيفة
)--نهاية قوس الحدث

---------------------------------------------------------
local marker={}
function markerfunc(p)
  setElementHealth(p,100)
  givePlayerMoney(getElementData(source,'creator'),1000)
  end
addCommandHandler('sethel',function(p)
if isElement(marker[p]) then destroyElement(marker[p]) return end
local x,y,z=getElementPosition(p)

local marker[p]=createMarker(x,y,z....)
setElementData(marker[p],'creator',p)
addEventHandler('onMarkerHit',marker[p],markerfunc)

end)


addEventHandler("onClientGUIClick",root, --عند الضغط على زر
function()--وظيفة
    if source == Join then 
         triggerServerEvent("JoinDoctor",localPlayer)
	        outputChatBox("Now you Are A Doctor",0,255,255)
                removeEventHandler("onClientRender",root, dxpanel)--اغلاق اللوحة
				      guiSetVisible(Close,false)
                          guiSetVisible(Join,false)
						    guiSetVisible( memo,false)
                              showCursor(false)--اخفاء الماوس

elseif (source == Close) then--ان كان الزر = زر الاغلاق
   removeEventHandler("onClientRender",root, dxpanel) --اغلاق اللوحة
      guiSetVisible(Close,false)
         guiSetVisible(Join,false)
            guiSetVisible( memo,false)
                showCursor(false)--اخفاء الماوس
                    end--نهاية التحقق
                       end--نهاية الوظيفة
 )--نهاية قوس الحدث
    

5

11 minutes ago, Master_MTA said:

ارسلت لك كودي فوق؟

??

Link to comment
21 minutes ago, LOAM said:

شكرا اخى بس بيطلع خطاء لما بركبه فى ملف الكلنت  معا التيم 

سطرl  local marker[p]=createMarker(x,y,z....)


local markerSF2 = createMarker (-2675.5,634.5,14.5,"cylinder", 1.5, 25, 112, 255, 0 )

addEventHandler("onClientMarkerHit",markerSF2, --عند لمس الماركر المحدد
function()--وظيفة
           addEventHandler("onClientRender",root,dxpanel)--تفتح اللوحة
         guiSetVisible( memo,true)
      guiSetVisible(Close,true)
   guiSetVisible(Join,true)
showCursor(true) --نظهر الماوس
end --نهاية الوظيفة
)--نهاية قوس الحدث

---------------------------------------------------------
local marker={}
function markerfunc(p)
  setElementHealth(p,100)
  givePlayerMoney(getElementData(source,'creator'),1000)
  end
addCommandHandler('sethel',function(p)
if isElement(marker[p]) then destroyElement(marker[p]) return end
local x,y,z=getElementPosition(p)

local marker[p]=createMarker(x,y,z....)
setElementData(marker[p],'creator',p)
addEventHandler('onMarkerHit',marker[p],markerfunc)

end)


addEventHandler("onClientGUIClick",root, --عند الضغط على زر
function()--وظيفة
    if source == Join then 
         triggerServerEvent("JoinDoctor",localPlayer)
	        outputChatBox("Now you Are A Doctor",0,255,255)
                removeEventHandler("onClientRender",root, dxpanel)--اغلاق اللوحة
				      guiSetVisible(Close,false)
                          guiSetVisible(Join,false)
						    guiSetVisible( memo,false)
                              showCursor(false)--اخفاء الماوس

elseif (source == Close) then--ان كان الزر = زر الاغلاق
   removeEventHandler("onClientRender",root, dxpanel) --اغلاق اللوحة
      guiSetVisible(Close,false)
         guiSetVisible(Join,false)
            guiSetVisible( memo,false)
                showCursor(false)--اخفاء الماوس
                    end--نهاية التحقق
                       end--نهاية الوظيفة
 )--نهاية قوس الحدث
    

5

??

اعذرني

local marker[p]=createMarker(x,y,z....)

اولا شيل كلمة

local +

كمل بدال

....

طبيعي زي اي ماركر؟

بس لو سويته بكلنت مافي غير لاعب 1 اللي بيشوفه فسويه في جانب السيرفر

Edited by Master_MTA
Link to comment
17 minutes ago, Master_MTA said:

اعذرني

local marker[p]=createMarker(x,y,z....)

اولا شيل كلمة

local +

كمل بدال

....

طبيعي زي اي ماركر؟

local marker={}
function markerfunc(p)
  setElementHealth(p,100)
  givePlayerMoney(getElementData(source,'creator'),1000)
  end
addCommandHandler('sethel',function(p)
if isElement(marker[p]) then destroyElement(marker[p]) return end
local x,y,z=getElementPosition(p)

 marker[p]=createMarker(x,y,z,1.5, 0, 255, 255, 150 )
setElementData(marker[p],'creator',p)
addEventHandler('onMarkerHit',marker[p],markerfunc)

end)

بكتب

sethel

مش بيظهر ماركر ولا حاجا اخى

Link to comment
11 minutes ago, LOAM said:

local marker={}
function markerfunc(p)
  setElementHealth(p,100)
  givePlayerMoney(getElementData(source,'creator'),1000)
  end
addCommandHandler('sethel',function(p)
if isElement(marker[p]) then destroyElement(marker[p]) return end
local x,y,z=getElementPosition(p)

 marker[p]=createMarker(x,y,z,1.5, 0, 255, 255, 150 )
setElementData(marker[p],'creator',p)
addEventHandler('onMarkerHit',marker[p],markerfunc)

end)

بكتب


sethel

مش بيظهر ماركر ولا حاجا اخى

سويته سيرفر سايد؟

+وش يطلع بالديبق

+كذا غلط

الصحيح

marker[p]=createMarker(x,y,z-1,'cylinder ',1.5, 0, 255, 255, 150 )

 

Edited by Master_MTA
  • Like 1
Link to comment

اي واحد يخش المنتدى ويطلب مساعدة يعطوه الفنكشنات وبعدين يجيك واحد يعطيه كود جاهز 

ويطلع معاه كود ماسوي فيه لو 1% , ظاهره منتشره

انا افضل ان الاخوه لاجت تساعد اول شي تعطيه الفنكشنات وبعدين محاولته 

وبعدين نصححله , ومانت مجبور تطبق كلامي , بالاخير انت الي تتعب ماهو انا

 

  • Like 2
Link to comment

Client

function dxDrawFramedText(message, left, top, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, frameColor)
color = color or tocolor(255, 255, 255, 255)
frameColor = frameColor or tocolor(0, 0, 0, 255)
scale = scale or 1.1
font = font or "default"
alignX = alignX or "left"
alignY = alignY or "top"
clip = clip or false
wordBreak = wordBreak or false
postGUI = postGUI or false
dxDrawText(message, left + 1, top + 1, width + 1, height + 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left + 1, top - 1, width + 1, height - 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left - 1, top + 1, width - 1, height + 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left - 1, top - 1, width - 1, height - 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left, top, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI)
end

Rnoteam = 255
Gnoteam = 0
bnoteam = 0
local x, y = guiGetScreenSize()

function MedicRender()
if getTeamName(getPlayerTeam(localPlayer)) == "Medic" then
if getElementDimension(localPlayer) == 55 then return end
if getElementData(localPlayer, "LegalStatus")== "Jailed" then return end
if getElementData(localPlayer, "LegalStatus")== "Arrested" then return end
if getElementData(localPlayer, "Kidnapped") then return end
if getElementData(localPlayer, "bag") then return end
if isPedInVehicle(localPlayer)  then return end
if (isPedDead (localPlayer)) then return end
if not isPedOnGround(localPlayer) then return end
if getElementData(localPlayer, "MStat") == "Open" then
dxDrawFramedText("Press : [R] To Delete The Healing Marker Matker !!",x*0.01, y*0.640, x*0.99, y*0.97, tocolor(255, 0, 0, 255), 1, "default-bold", "left", "top", false, false, true, false, false)
else
dxDrawFramedText("Press : [R] To Create The Healing Marker Matker !!",x*0.01, y*0.640, x*0.99, y*0.97, tocolor(0, 255, 0, 255), 1, "default-bold", "left", "top", false, false, true, false, false)
end
end
end
addEventHandler("onClientRender", getRootElement(), MedicRender)
-------------------------------
addEventHandler("onClientPlayerDamage", root,
function(attacker, weapon)
	if attacker and getElementType(attacker) == "player" and attacker ~= source then
		local Model = getElementModel(attacker)
		local Team = getPlayerTeam(attacker)
		if Team and (getTeamName(Team) == "Medic") then
			cancelEvent()
			if not isTimer(waitTimer[source]) then
				triggerServerEvent("healPlayer", attacker, source, attacker)
				waitTimer[source] = setTimer(function(p) waitTimer[p] = nil end, 1500, 1, source)
			end
		end
	end
end)

function onCompleteKid()
triggerServerEvent ("Medic",localPlayer )
end
bindKey("R", "down", onCompleteKid)

 

local healAmount = 75
local medicMarker = {}
local medicTimer = {}

function heal(helled, heller)
	local money = getElementData(helled, "Money") or 0
	if (healAmount <= money) then
		local health = getElementHealth(helled)
		local maxHealth = getPlayerMaxHealth(helled) or 100
		if (health <= (maxHealth - 25)) then
			setElementHealth(helled, health + 25)
			payTheMoney(heller, helled)
		elseif (health <= (maxHealth - 5)) and (health > (maxHealth - 25)) and (health < maxHealth) then
			setElementHealth(helled, health + (maxHealth - health))
			payTheMoney(heller, helled)
		end
	end
end
addEvent("healPlayer", true)
addEventHandler("healPlayer", root, heal)

function getPlayerMaxHealth(player)
	local currentHealth = math.ceil(getElementHealth(player))
	setElementHealth(player, 200)
	local MaxHealth = math.ceil(getElementHealth(player))
	setElementHealth(player, currentHealth)
	return MaxHealth
end

function payTheMoney(heller, helled)
	setElementData(helled, "Money", (getElementData(helled, "Money") or 0) - healAmount)
	setElementData(heller, "Money", (getElementData(heller, "Money") or 0) + healAmount)
	exports["guimessages"]:outputServer(heller, "#00FFFF[Medic Job] :#00FF00 You have earned $"..healAmount, 0, 255, 0)
	exports["guimessages"]:outputServer(helled, "#00FFFF[Medic Job] :#FF9900 You've paid $"..healAmount.." for medical services.", 255, 125, 0)
end

addEvent("Medic", true)
addEventHandler("Medic", root,
function()
	local team = getPlayerTeam(source)
	local medicTeam = getTeamFromName("Medic")
	if team and medicTeam and team == medicTeam then
		if isElement(medicMarker[source]) then
			destroyElement(medicMarker[source])
			medicMarker[source] = nil
			setElementFrozen(source, false)
			toggleAllControls(source, true)
			exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 Medic marker unloaded successfully.", 255, 255, 0)
			setElementData(source, "MStat", "Destroy")
		else
			if (getElementData(source, "WantLvl") or 0) > 0 then
				exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 Your wanted level prevent you from doing this action.", 255, 0, 0)
			elseif isPedDead(source) then
				exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 What are you trying to do?!?! only alives can do this action!", 255, 0, 0)
			elseif getElementData(source, "LegalStatus")== "Jailed" then
				exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 You Are Jailed you Can't do this Action!", 255, 0, 0)
			elseif getElementData(source, "LegalStatus")== "Arrested" then
			exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 You Are Arrested you Can't do this Action!", 255, 0, 0)
			elseif isPedInVehicle(source) then
				exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 You must be on foot to do this action.", 255, 0, 0)
			elseif not isPedOnGround(source) then
				exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 You must be on the ground to do this action.", 255, 0, 0)
			else
				setElementFrozen(source, true)
				toggleAllControls(source, false, true, false)
				if isTimer(medicTimer[source]) then killTimer(medicTimer[source]) end
				medicTimer[source] = setTimer(function(source)
					local x, y, z = getElementPosition(source)
					if isElement(medicMarker[source]) then destroyElement(medicMarker[source]) medicMarker[source] = nil end
					medicMarker[source] = createMarker(x, y, z-1, "cylinder", 2.2, 100, 100, 255, 125)
					setElementInterior(medicMarker[source], getElementInterior(source))
					setElementDimension(medicMarker[source], getElementDimension(source))
					exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#00FF00 Medic marker created successfully.", 0, 255, 0)
					setElementData(source, "MStat", "Open")
					--exports["guimessages"]:outputServer(source, "Do /"..cmd.." again to unload.", 100, 100, 255)
				end, 200, 1, source)
			end
		end
	end
end)

function eventCheck()
	if isElement(medicMarker[source]) then
		destroyElement(medicMarker[source])
		medicMarker[source] = nil
		setElementFrozen(source, false)
		toggleAllControls(source, true)
	end
end
addEventHandler("onPlayerQuit", root, eventCheck)
addEventHandler("onPlayerWasted", root, eventCheck)

addEventHandler("onElementDataChange", getRootElement(),
function(Date)
if Date == "Money" then
setPlayerMoney(getElementData(source, "Money"))
 end
end)


setTimer(function()
	for heller, marker in pairs(medicMarker) do
		for i, helled in ipairs(getElementsWithinColShape(getElementColShape(marker), "player")) do
			if helled ~= heller then
				heal(helled, heller)
			end
		end
	end
end, 3000, 0)

Server

Edited by #bazooka
  • Like 1
Link to comment
20 minutes ago, Abdul KariM said:

اي واحد يخش المنتدى ويطلب مساعدة يعطوه الفنكشنات وبعدين يجيك واحد يعطيه كود جاهز 

ويطلع معاه كود ماسوي فيه لو 1% , ظاهره منتشره

انا افضل ان الاخوه لاجت تساعد اول شي تعطيه الفنكشنات وبعدين محاولته 

وبعدين نصححله , ومانت مجبور تطبق كلامي , بالاخير انت الي تتعب ماهو انا

 

يعطيك العافيه المره الجايه بحاول +_+

 

  • Like 1
Link to comment
17 minutes ago, #bazooka said:

Client


function dxDrawFramedText(message, left, top, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, frameColor)
color = color or tocolor(255, 255, 255, 255)
frameColor = frameColor or tocolor(0, 0, 0, 255)
scale = scale or 1.1
font = font or "default"
alignX = alignX or "left"
alignY = alignY or "top"
clip = clip or false
wordBreak = wordBreak or false
postGUI = postGUI or false
dxDrawText(message, left + 1, top + 1, width + 1, height + 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left + 1, top - 1, width + 1, height - 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left - 1, top + 1, width - 1, height + 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left - 1, top - 1, width - 1, height - 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left, top, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI)
end

Rnoteam = 255
Gnoteam = 0
bnoteam = 0
local x, y = guiGetScreenSize()

function MedicRender()
if getTeamName(getPlayerTeam(localPlayer)) == "Medic" then
if getElementDimension(localPlayer) == 55 then return end
if getElementData(localPlayer, "LegalStatus")== "Jailed" then return end
if getElementData(localPlayer, "LegalStatus")== "Arrested" then return end
if getElementData(localPlayer, "Kidnapped") then return end
if getElementData(localPlayer, "bag") then return end
if isPedInVehicle(localPlayer)  then return end
if (isPedDead (localPlayer)) then return end
if not isPedOnGround(localPlayer) then return end
if getElementData(localPlayer, "MStat") == "Open" then
dxDrawFramedText("Press : [R] To Delete The Healing Marker Matker !!",x*0.01, y*0.640, x*0.99, y*0.97, tocolor(255, 0, 0, 255), 1, "default-bold", "left", "top", false, false, true, false, false)
else
dxDrawFramedText("Press : [R] To Create The Healing Marker Matker !!",x*0.01, y*0.640, x*0.99, y*0.97, tocolor(0, 255, 0, 255), 1, "default-bold", "left", "top", false, false, true, false, false)
end
end
end
addEventHandler("onClientRender", getRootElement(), MedicRender)
-------------------------------
addEventHandler("onClientPlayerDamage", root,
function(attacker, weapon)
	if attacker and getElementType(attacker) == "player" and attacker ~= source then
		local Model = getElementModel(attacker)
		local Team = getPlayerTeam(attacker)
		if Team and (getTeamName(Team) == "Medic") then
			cancelEvent()
			if not isTimer(waitTimer[source]) then
				triggerServerEvent("healPlayer", attacker, source, attacker)
				waitTimer[source] = setTimer(function(p) waitTimer[p] = nil end, 1500, 1, source)
			end
		end
	end
end)

function onCompleteKid()
triggerServerEvent ("Medic",localPlayer )
end
bindKey("R", "down", onCompleteKid)

 


local healAmount = 75
local medicMarker = {}
local medicTimer = {}

function heal(helled, heller)
	local money = getElementData(helled, "Money") or 0
	if (healAmount <= money) then
		local health = getElementHealth(helled)
		local maxHealth = getPlayerMaxHealth(helled) or 100
		if (health <= (maxHealth - 25)) then
			setElementHealth(helled, health + 25)
			payTheMoney(heller, helled)
		elseif (health <= (maxHealth - 5)) and (health > (maxHealth - 25)) and (health < maxHealth) then
			setElementHealth(helled, health + (maxHealth - health))
			payTheMoney(heller, helled)
		end
	end
end
addEvent("healPlayer", true)
addEventHandler("healPlayer", root, heal)

function getPlayerMaxHealth(player)
	local currentHealth = math.ceil(getElementHealth(player))
	setElementHealth(player, 200)
	local MaxHealth = math.ceil(getElementHealth(player))
	setElementHealth(player, currentHealth)
	return MaxHealth
end

function payTheMoney(heller, helled)
	setElementData(helled, "Money", (getElementData(helled, "Money") or 0) - healAmount)
	setElementData(heller, "Money", (getElementData(heller, "Money") or 0) + healAmount)
	exports["guimessages"]:outputServer(heller, "#00FFFF[Medic Job] :#00FF00 You have earned $"..healAmount, 0, 255, 0)
	exports["guimessages"]:outputServer(helled, "#00FFFF[Medic Job] :#FF9900 You've paid $"..healAmount.." for medical services.", 255, 125, 0)
end

addEvent("Medic", true)
addEventHandler("Medic", root,
function()
	local team = getPlayerTeam(source)
	local medicTeam = getTeamFromName("Medic")
	if team and medicTeam and team == medicTeam then
		if isElement(medicMarker[source]) then
			destroyElement(medicMarker[source])
			medicMarker[source] = nil
			setElementFrozen(source, false)
			toggleAllControls(source, true)
			exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 Medic marker unloaded successfully.", 255, 255, 0)
			setElementData(source, "MStat", "Destroy")
		else
			if (getElementData(source, "WantLvl") or 0) > 0 then
				exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 Your wanted level prevent you from doing this action.", 255, 0, 0)
			elseif isPedDead(source) then
				exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 What are you trying to do?!?! only alives can do this action!", 255, 0, 0)
			elseif getElementData(source, "LegalStatus")== "Jailed" then
				exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 You Are Jailed you Can't do this Action!", 255, 0, 0)
			elseif getElementData(source, "LegalStatus")== "Arrested" then
			exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 You Are Arrested you Can't do this Action!", 255, 0, 0)
			elseif isPedInVehicle(source) then
				exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 You must be on foot to do this action.", 255, 0, 0)
			elseif not isPedOnGround(source) then
				exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#FF0000 You must be on the ground to do this action.", 255, 0, 0)
			else
				setElementFrozen(source, true)
				toggleAllControls(source, false, true, false)
				if isTimer(medicTimer[source]) then killTimer(medicTimer[source]) end
				medicTimer[source] = setTimer(function(source)
					local x, y, z = getElementPosition(source)
					if isElement(medicMarker[source]) then destroyElement(medicMarker[source]) medicMarker[source] = nil end
					medicMarker[source] = createMarker(x, y, z-1, "cylinder", 2.2, 100, 100, 255, 125)
					setElementInterior(medicMarker[source], getElementInterior(source))
					setElementDimension(medicMarker[source], getElementDimension(source))
					exports["guimessages"]:outputServer(source, "#00FFFF[Medic Job] :#00FF00 Medic marker created successfully.", 0, 255, 0)
					setElementData(source, "MStat", "Open")
					--exports["guimessages"]:outputServer(source, "Do /"..cmd.." again to unload.", 100, 100, 255)
				end, 200, 1, source)
			end
		end
	end
end)

function eventCheck()
	if isElement(medicMarker[source]) then
		destroyElement(medicMarker[source])
		medicMarker[source] = nil
		setElementFrozen(source, false)
		toggleAllControls(source, true)
	end
end
addEventHandler("onPlayerQuit", root, eventCheck)
addEventHandler("onPlayerWasted", root, eventCheck)

addEventHandler("onElementDataChange", getRootElement(),
function(Date)
if Date == "Money" then
setPlayerMoney(getElementData(source, "Money"))
 end
end)


setTimer(function()
	for heller, marker in pairs(medicMarker) do
		for i, helled in ipairs(getElementsWithinColShape(getElementColShape(marker), "player")) do
			if helled ~= heller then
				heal(helled, heller)
			end
		end
	end
end, 3000, 0)

Server

شكرا جدا اخى

  • Like 1
Link to comment
27 minutes ago, Abdul KariM said:

اي واحد يخش المنتدى ويطلب مساعدة يعطوه الفنكشنات وبعدين يجيك واحد يعطيه كود جاهز 

ويطلع معاه كود ماسوي فيه لو 1% , ظاهره منتشره

انا افضل ان الاخوه لاجت تساعد اول شي تعطيه الفنكشنات وبعدين محاولته 

وبعدين نصححله , ومانت مجبور تطبق كلامي , بالاخير انت الي تتعب ماهو انا

انا اسوي كدة لكن بعد ما غيري يعطي مثال :lol:

  • Like 1
Link to comment
8 minutes ago, Abdul KariM said:

الكلام موب بس لكم والله للجميع يعني اخش موضوع ماتصير 5 دقايق الا انه طالع بكود وهو ماتعب

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

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