Jump to content

مساعدة في كود | isPlayerInTeam


Recommended Posts

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

Useful function

رحلة العناء :lol::lol:

يحطون كود ومايشرحونه : (

,, ابيكم تساعدوني في الكود هذا ., بس بعرف وين الخطأ :mrgreen:

function isPlayerInTeam(player, team) 
    assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") 
    assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") 
    return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) 
end 
  
addEventHandler("onClientGUIClick", root, 
function (player, team) 
    if ( source == Button ) then 
      if isPlayerInTeam(player, "MyTeam") then 
        setElementPosition 
        guiSetVisible( 
        showCursor 
      else 
      outputChatBox 
    end 
   end 
 end    
 ) 
  

Wiki --

isPlayerInTeam

:cry::?:shock::wink::x:lol:

Link to comment

addEventHandler("onClientGUIClick", root, 
function (player, team) 
    if ( source == Button ) then 
      if isPlayerInTeam(player, "MyTeam") then 
        setElementPosition 
        guiSetVisible( 
        showCursor 
      else 
      outputChatBox 
    end 
   end 
 end   
 ) 
  

showCursor +guiSetVisible( + outputChatBox -- مش مكمل الوظيفة

function (player, team) -- مالهم داعي

if isPlayerInTeam(player, "MyTeam") then

player = غير معرف

يغني هاد كله غلط

Link to comment

حبيبي شوايكي ذذ

انا مو غبي لدرجة اني ما اكمل الفنكشنات زي

outputChatBox

انا بس كتبتها عشان تعرف وش الي داخل الوظيفة

في الحقيقه انا اصلا حاطها في النوت باد وكامله

بس يطلعلي في الديبوق

Bad argument 1 @ isPlayerInTeam [player expected, got left]

Link to comment
-- # Client Side ! 
function isPlayerInTeam(player, team) 
    assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") 
    assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") 
    return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) 
end 
  
addEventHandler("onClientGUIClick", root, 
    function ( ) 
        if ( source == Button ) then 
            if ( isPlayerInTeam ( localPlayer, "MyTeam" ) ) then 
               -- # Your Code 
            else 
               -- # Your Code 
            end 
        end 
     end   
) 

Link to comment
السلآلآم عليكم ورحمة الله وبركاته

Useful function

رحلة العناء :lol::lol:

يحطون كود ومايشرحونه : (

,, ابيكم تساعدوني في الكود هذا ., بس بعرف وين الخطأ :mrgreen:

function isPlayerInTeam(player, team) 
    assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") 
    assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") 
    return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) 
end 
  
addEventHandler("onClientGUIClick", root, 
function (player, team) 
    if ( source == Button ) then 
      if isPlayerInTeam(player, "MyTeam") then 
        setElementPosition 
        guiSetVisible( 
        showCursor 
      else 
      outputChatBox 
    end 
   end 
 end    
 ) 
  

Wiki --

isPlayerInTeam

:cry::?:shock::wink::x:lol:

على اي اساس

addEventHandler("onClientGUIClick", root, 
function (player, team) 

:lol:

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