Jump to content

مساعده في كود (جوب)


Recommended Posts

فكره السكربت 

  Terroristsيصبح في تيمacceptبلمس الماركر يظهر له نافذه اذا ضغط عليTerroristsاذا قام الاعب من جروب 

واذا قام لاعب من تيم Terrorists

قتل لاعب اخر يجصل  علي 1000

--Client Side

marker1 = createMarker(2485.00000, -1667.00000, 12.34375,"cylinder",3,210, 105, 30)

addEventHandler("onClientMarkerHit", marker1,
    function(hitElement)
	
        window = guiCreateWindow(467, 213, 475, 179, "Terrorists Job", false)
        guiWindowSetSizable(window, false)

        accept = guiCreateButton(9, 126, 139, 43, "Accept", false, window)
        close1 = guiCreateButton(321, 126, 139, 43, "Close", false, window)
guiSetVisible(window,false)
outputChatBox("your are not part of this Team")	
if getTeamName(getPlayerTeam(hitElement)) == "Player" and getElementData(hitElement, "Group") == "Terrorists" then
outputChatBox("Welcome Terrorist")
guiSetVisible(window,true)
showCursor(true)
end
end  )

addEventHandler("onClientGUIClick",guiRoot,
function()
if ( source == close1 ) then
guiSetVisible(window,false)
showCursor(false)
else
if ( source == accept ) then
guiSetVisible(window,true)
showCursor(false)
triggerServerEvent ("getTeam",player)
end
end
end
)
--Server Side
team1 = createTeam("Terrorist",210, 105, 30)

addEvent("getTeam",true)
addEventHandler("getTeam",resourceRoot,
function()
setPlayerTeam(team1)
end
)

addEventHandler ( "onPlayerWasted", root, function ( _, attacker )
if ( attacker and attacker ~= source and  getPlayerTeam(attacker) and getTeamName(getPlayerTeam(attacker)) == "Terrorists" ) then 
givePlayerMoney(attacker,1000)
end
end 
)

 

Link to comment
4 minutes ago, iMr.WiFi..! said:

في سطر 31

في الكلاينت

عدل

player

الى

localPlayer

وسطر 8 الى 12

خرجهم من الحدث

 

4 minutes ago, iMr.WiFi..! said:

في سطر 31

في الكلاينت

عدل

player

الى

localPlayer

وسطر 8 الى 12

خرجهم من الحدث

فقط ؟

Link to comment
53 minutes ago, Tarek1 said:

فكره السكربت 

  Terroristsيصبح في تيمacceptبلمس الماركر يظهر له نافذه اذا ضغط عليTerroristsاذا قام الاعب من جروب 

واذا قام لاعب من تيم Terrorists

قتل لاعب اخر يجصل  علي 1000


--Client Side

marker1 = createMarker(2485.00000, -1667.00000, 12.34375,"cylinder",3,210, 105, 30)

addEventHandler("onClientMarkerHit", marker1,
    function(hitElement)
	
        window = guiCreateWindow(467, 213, 475, 179, "Terrorists Job", false)
        guiWindowSetSizable(window, false)

        accept = guiCreateButton(9, 126, 139, 43, "Accept", false, window)
        close1 = guiCreateButton(321, 126, 139, 43, "Close", false, window)
guiSetVisible(window,false)
outputChatBox("your are not part of this Team")	
if getTeamName(getPlayerTeam(hitElement)) == "Player" and getElementData(hitElement, "Group") == "Terrorists" then
outputChatBox("Welcome Terrorist")
guiSetVisible(window,true)
showCursor(true)
end
end  )

addEventHandler("onClientGUIClick",guiRoot,
function()
if ( source == close1 ) then
guiSetVisible(window,false)
showCursor(false)
else
if ( source == accept ) then
guiSetVisible(window,true)
showCursor(false)
triggerServerEvent ("getTeam",player)
end
end
end
)

--Server Side
team1 = createTeam("Terrorist",210, 105, 30)

addEvent("getTeam",true)
addEventHandler("getTeam",resourceRoot,
function()
setPlayerTeam(team1)
end
)

addEventHandler ( "onPlayerWasted", root, function ( _, attacker )
if ( attacker and attacker ~= source and  getPlayerTeam(attacker) and getTeamName(getPlayerTeam(attacker)) == "Terrorists" ) then 
givePlayerMoney(attacker,1000)
end
end 
)

 

-- client side
function marker ()
marker1 = createMarker(2485.00000, -1667.00000, 12.34375,"cylinder",3,210, 105, 30)
end
addEventHandler("onClientResourceStart", getRootElement(), marker)

addEventhandler("onClientMarkerHit", getRootElement(), function (hitElement)
    if ( source == marker1 ) and ( getElementType(hitElement) == "player" ) and ( getElementData(hitElement, 'Group') == 'Terrorists' ) then
      
        window = guiCreateWindow(467, 213, 475, 179, "Terrorists Job", false)
        guiWindowSetSizable(window, false)

        accept = guiCreateButton(9, 126, 139, 43, "Accept", false, window)
        close1 = guiCreateButton(321, 126, 139, 43, "Close", false, window)
      showCursor(true)
      outputChatBox("Welcome Terrorist", 255, 255, 255, true)
      end
    end)

addEventHandler("onClientGUIClick", getRootElement(), function ()
    if ( source == close1 ) then
      guiSetVisible(window,false)
      showCursor(false)
      end
    end)

addEventHandler("onClientGUIClick", getRootElement(), function ()
    if ( source == accept ) then
      guiSetVisible(window,false)
      showCursor(false)
      triggerServerEvent("getteam", getLocalPlayer())
      end
    end)


-- server side

team1 = createTeam("Terrorist",210, 105, 30)

addEvent("getteam",true)
addEventHandler("getteam", root, 
  function ()
    setPlayerTeam(source, team1)
    end)

function reward (ammo, attacker, weapon, bodypart)
  if ( attacker ) and ( attacker ~= source ) and ( getPlayerTeam(attacker) ) and ( getTeamName(getPlayerTeam(attacker)) == "Terrorists" ) then
    givePlayerMoney(attacker, 1000)
    end
  end
addEventHandler("onPlayerWasted", getRootElement(), reward)
    

 

انا عدلتههء لك ع ححسب طلبك ,, اذا طلعت فكرتك فيها خطأ ( وانا أشك صرآحةة ) فـ أنا آخلي مسؤوليتي ..

Edited by #F9SoOoL
  • 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...