Jump to content

Recommended Posts

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

  
team = createTeam ( "team", 0, 255, 0 ) 
  
addEvent ( "setTeam", true ) 
addEventHandler( "setTeam", root, 
    function ( ) 
        spawnPlayer ( source, x, y, z, 0, skinID, 0, 0, team ) 
    end 
) 
-- x,y,z = إحداثيات 
-- skinID = الشخصية 
  

Link to comment

نفس الا محطوطين في الموضوع

cilent

Image = guiCreateStaticImage(500, 450, 200, 200, "w.png", false) 
showCursor(true) 
  
function onImageClick() 
     triggerServerEvent("setTeam", localPlayer) 
     guiSetVisible(Image, false) 
     showCursor(false) 
end 
addEventHandler("onClientGUIClick", Image, onImageClick) 
  
bindKey("F4", "down", 
function() 
     if not guiGetVisible(Image) then 
          guiSetVisible(Image, true) 
          showCursor(true) 
     end 
end) 
  
  

server

team = createTeam ( "police", 0, 255, 0 ) 
  
addEvent ( "setTeam", true ) 
addEventHandler( "setTeam", root, 
    function ( ) 
        spawnPlayer ( source, 1473.8627929688, -2228.2980957031, 13.3828125, 0, 2, 0, 0, team ) 
        fadeCamera (source, true) 
        setCameraTarget (source, source) 
  giveWeapon ( source, 31, 200 )    end 
) 
  

server

team = createTeam ( "grove", 0, 255, 0 ) 
  
addEvent ( "setTeam", true ) 
addEventHandler( "setTeam", root, 
    function ( ) 
        spawnPlayer ( source, 1473.8627929688, -2228.2980957031, 13.3828125, 0, 2, 0, 0, team ) 
        fadeCamera (source, true) 
        setCameraTarget (source, source) 
  giveWeapon ( source, 31, 200 )    end 
) 
  

cilent

Image = guiCreateStaticImage(0, 450, 200, 200, "s.png", false) 
showCursor(true) 
  
function onImageClick() 
     triggerServerEvent("setTeam", localPlayer) 
     guiSetVisible(Image, false) 
     showCursor(false) 
end 
addEventHandler("onClientGUIClick", Image, onImageClick) 
  
bindKey("F4", "down", 
function() 
     if not guiGetVisible(Image) then 
          guiSetVisible(Image, true) 
          showCursor(true) 
     end 
end) 
  
  

    "setTeams" author="ha7soon" type="gamemode" /> 
        

Link to comment

-- Client Side --

PoliceImage = guiCreateStaticImage(500, 450, 200, 200, "w.png", false) 
GroveImage = guiCreateStaticImage(0, 450, 200, 200, "s.png", false) 
  
showCursor(true) 
  
function onImageClick() 
    if source == PoliceImage then 
        triggerServerEvent("setTeam", localPlayer, "Police") 
    elseif source == GroveImage then 
         triggerServerEvent("setTeam", localPlayer, "Grove") 
    end 
    guiSetVisible(PoliceImage, false) 
    guiSetVisible(GroveImage, false) 
    showCursor(false) 
end 
addEventHandler("onClientGUIClick", resourceRoot, onImageClick) 
  
bindKey("F4", "down", 
function() 
    if not guiGetVisible(PoliceImage) then 
        guiSetVisible(PoliceImage, true) 
        guiSetVisible(GroveImage, true) 
        showCursor(true) 
    end 
end) 

-- Server Side --

PoliceTeam = createTeam("Police", 0, 255, 0) 
GroveTeam = createTeam("Grove", 0, 255, 0) 
  
addEvent("setTeam", true ) 
addEventHandler("setTeam", root, 
function(Team) 
    if Team == "Police" then 
        spawnPlayer(source, 1473.86, -2228.3, 13.4, 0, 2, 0, 0, PoliceTeam) 
        giveWeapon(source, 31, 200) 
    elseif Team == "Grove" then 
        spawnPlayer(source, 1473.86, -2228.3, 13.4, 0, 2, 0, 0, GroveTeam) 
        giveWeapon(source, 31, 200) 
    end 
    fadeCamera(source, true) 
    setCameraTarget(source) 
end) 

-- Meta.xml --

    "setTeams" author="ha7soon" type="gamemode" /> 
        

Link to comment
انا جربت هاذي الاكواد

المشكلة اذا مات الاعب مايصير يختار فريق ابغيه اذا مات يطلع له الصور

ويختار فريق من جديد

جرب .. سويته على السريع

addEventHandler ( 'onClientPlayerWasted', getLocalPlayer ( ), 
    function ( ) 
        guiSetVisible ( PoliceImage, true ); 
        guiSetVisible ( GroveImage, true ); 
        showCursor ( true ); 
    end 
) 

Link to comment
-- Client Side --
PoliceImage = guiCreateStaticImage(500, 450, 200, 200, "w.png", false) 
GroveImage = guiCreateStaticImage(0, 450, 200, 200, "s.png", false) 
  
showCursor(true) 
  
function onImageClick() 
    if source == PoliceImage then 
        triggerServerEvent("setTeam", localPlayer, "Police") 
    elseif source == GroveImage then 
         triggerServerEvent("setTeam", localPlayer, "Grove") 
    end 
    guiSetVisible(PoliceImage, false) 
    guiSetVisible(GroveImage, false) 
    showCursor(false) 
end 
addEventHandler("onClientGUIClick", resourceRoot, onImageClick) 
  
bindKey("F4", "down", 
function() 
    if not guiGetVisible(PoliceImage) then 
        guiSetVisible(PoliceImage, true) 
        guiSetVisible(GroveImage, true) 
        showCursor(true) 
    end 
end) 

-- Server Side --

PoliceTeam = createTeam("Police", 0, 255, 0) 
GroveTeam = createTeam("Grove", 0, 255, 0) 
  
addEvent("setTeam", true ) 
addEventHandler("setTeam", root, 
function(Team) 
    if Team == "Police" then 
        spawnPlayer(source, 1473.86, -2228.3, 13.4, 0, 2, 0, 0, PoliceTeam) 
        giveWeapon(source, 31, 200) 
    elseif Team == "Grove" then 
        spawnPlayer(source, 1473.86, -2228.3, 13.4, 0, 2, 0, 0, GroveTeam) 
        giveWeapon(source, 31, 200) 
    end 
    fadeCamera(source, true) 
    setCameraTarget(source) 
end) 

-- Meta.xml --

    "setTeams" author="ha7soon" type="gamemode" /> 
        

تابل انا الحين ضفت اياه

friendly fire

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

Link to comment
local allTeams = getElementsByType ( "team" ) 
for index, theTeam in ipairs(allTeams) do 
    if ( getTeamFriendlyFire ( theTeam ) == false ) then 
        setTeamFriendlyFire ( theTeam, true ) 
    end 
end 

من الويكي

for _, v in ipairs ( getElementsByType 'team' ) do 
    setTeamFriendlyFire ( v, false ) 
end 

جرب

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