Jump to content

تصحيح اكودد


Recommended Posts

عندي مشكله و هي كيف نحط اسماء الاعبين الموجودين في التيم و نحطهم في القريد لست

:?:?

    function OpenWin() 
if removeEventHandler("onClientRender",root,Dx) then   
removeEventHandler("onClientRender",root,Dx) 
    guiSetVisible (GUIEditor.button[1], false ) 
guiSetVisible (GUIEditor.edit[1] , false ) 
guiSetVisible(GUIEditor.gridlist[1],false) 
guiSetVisible(GUIEditor.Player,false) 
guiSetVisible(GUIEditor.button[2] ,false) 
guiSetVisible(GUIEditor.label[7] ,false) 
showCursor(false) 
showChat(true) 
else 
addEventHandler("onClientRender",root,Dx)  
    guiSetVisible (GUIEditor.button[1], true ) 
guiSetVisible (GUIEditor.edit[1] , true ) 
guiSetVisible(GUIEditor.gridlist[1],true) 
guiSetVisible(GUIEditor.Player,true) 
guiSetVisible(GUIEditor.button[2] ,true) 
guiSetVisible(GUIEditor.label[7] ,true) 
showCursor(true) 
showChat(false) 
  
guiGridListClear(GUIEditor.gridlist[1]) 
  
  
  
for _,v in ipairs ( getElementsByType ( "player" ) ) do 
  
  
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
  
  
local name1 = getTeamName(getPlayerTeam(v))) 
  
  
  
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName(name1),false,false) 
  
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
  
  
                       end  
  
        end 
  
          
         end 
          
          
bindKey("F4","down",OpenWin) 

Link to comment
function OpenWin() 
if removeEventHandler("onClientRender",root,Dx) then   
removeEventHandler("onClientRender",root,Dx) 
guiSetVisible (GUIEditor.button[1], false ) 
guiSetVisible (GUIEditor.edit[1] , false ) 
guiSetVisible(GUIEditor.gridlist[1],false) 
guiSetVisible(GUIEditor.Player,false) 
guiSetVisible(GUIEditor.button[2] ,false) 
guiSetVisible(GUIEditor.label[7] ,false) 
showCursor(false) 
showChat(true) 
else 
addEventHandler("onClientRender",root,Dx) 
guiSetVisible (GUIEditor.button[1], true ) 
guiSetVisible (GUIEditor.edit[1] , true ) 
guiSetVisible(GUIEditor.gridlist[1],true) 
guiSetVisible(GUIEditor.Player,true) 
guiSetVisible(GUIEditor.button[2] ,true) 
guiSetVisible(GUIEditor.label[7] ,true) 
showCursor(true) 
showChat(false) 
guiGridListClear(GUIEditor.gridlist[1]) 
end 
for _,v in ipairs (getPlayersInTeam(getTeamFromName("TeamName"))) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName(v),false,false) 
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
end 
end 
bindKey("F4","down",OpenWin) 

Link to comment

  
function iis( team ) 
     if isElement( team ) then 
           if getElementType( team ) == "team" then 
                  return true 
           else 
                  return false 
           end 
     end 
     return false 
end 
  
function getPlayersInTeam( teamName ) 
     local t={} 
     if type( teamName ) == "string" then 
          local team=getTeamFromName( teamName ) 
          if iis( team ) then 
                for id,play in ipairs( getElementsByType("player") ) do 
                       if getPlayerTeam( play ) == team then 
                             table.insert( t, play ) 
                       end 
                end 
          else return nil end 
     end 
     return t 
end 
Link to comment
function OpenWin() 
if removeEventHandler("onClientRender",root,Dx) then   
removeEventHandler("onClientRender",root,Dx) 
guiSetVisible (GUIEditor.button[1], false ) 
guiSetVisible (GUIEditor.edit[1] , false ) 
guiSetVisible(GUIEditor.gridlist[1],false) 
guiSetVisible(GUIEditor.Player,false) 
guiSetVisible(GUIEditor.button[2] ,false) 
guiSetVisible(GUIEditor.label[7] ,false) 
showCursor(false) 
showChat(true) 
else 
addEventHandler("onClientRender",root,Dx) 
guiSetVisible (GUIEditor.button[1], true ) 
guiSetVisible (GUIEditor.edit[1] , true ) 
guiSetVisible(GUIEditor.gridlist[1],true) 
guiSetVisible(GUIEditor.Player,true) 
guiSetVisible(GUIEditor.button[2] ,true) 
guiSetVisible(GUIEditor.label[7] ,true) 
showCursor(true) 
showChat(false) 
guiGridListClear(GUIEditor.gridlist[1]) 
end 
for _,v in ipairs (getPlayersInTeam(getTeamFromName("TeamName"))) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName(v),false,false) 
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
end 
end 
bindKey("F4","down",OpenWin) 

اني عندي في سيرفر التكتيك في 2 تيمات ابي تكون في لوحه واحد يعني لــ التيم اول يقدر يرسل الدم لصحابه في لوحه نفسه و التيم تاني نفس شي لكن ضروري مايكون في نفس لوحه فهمت ؟؟

Link to comment
  
function OpenWin() 
if removeEventHandler("onClientRender",root,Dx) then   
removeEventHandler("onClientRender",root,Dx) 
guiSetVisible (GUIEditor.button[1], false ) 
guiSetVisible (GUIEditor.edit[1] , false ) 
guiSetVisible(GUIEditor.gridlist[1],false) 
guiSetVisible(GUIEditor.Player,false) 
guiSetVisible(GUIEditor.button[2] ,false) 
guiSetVisible(GUIEditor.label[7] ,false) 
showCursor(false) 
showChat(true) 
else 
addEventHandler("onClientRender",root,Dx) 
guiSetVisible (GUIEditor.button[1], true ) 
guiSetVisible (GUIEditor.edit[1] , true ) 
guiSetVisible(GUIEditor.gridlist[1],true) 
guiSetVisible(GUIEditor.Player,true) 
guiSetVisible(GUIEditor.button[2] ,true) 
guiSetVisible(GUIEditor.label[7] ,true) 
showCursor(true) 
showChat(false) 
guiGridListClear(GUIEditor.gridlist[1]) 
end 
end 
bindKey("F4","down",OpenWin) 
  
function GetTeam() 
if getPlayerTeam(localPlayer) == "TeamName" then 
for _,v in ipairs (getPlayersInTeam(getTeamFromName("TeamName"))) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName(v),false,false) 
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
end 
if getPlayerTeam(localPlayer) == "TeamName2" then 
for _,i in ipairs (getPlayersInTeam(getTeamFromName("TeamName2"))) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName(i),false,false) 
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
end 
end 
  

Link to comment
  
function OpenWin() 
if removeEventHandler("onClientRender",root,Dx) then   
removeEventHandler("onClientRender",root,Dx) 
guiSetVisible (GUIEditor.button[1], false ) 
guiSetVisible (GUIEditor.edit[1] , false ) 
guiSetVisible(GUIEditor.gridlist[1],false) 
guiSetVisible(GUIEditor.Player,false) 
guiSetVisible(GUIEditor.button[2] ,false) 
guiSetVisible(GUIEditor.label[7] ,false) 
showCursor(false) 
showChat(true) 
else 
addEventHandler("onClientRender",root,Dx) 
guiSetVisible (GUIEditor.button[1], true ) 
guiSetVisible (GUIEditor.edit[1] , true ) 
guiSetVisible(GUIEditor.gridlist[1],true) 
guiSetVisible(GUIEditor.Player,true) 
guiSetVisible(GUIEditor.button[2] ,true) 
guiSetVisible(GUIEditor.label[7] ,true) 
showCursor(true) 
showChat(false) 
guiGridListClear(GUIEditor.gridlist[1]) 
end 
end 
bindKey("F4","down",OpenWin) 
  
function GetTeam() 
if getPlayerTeam(localPlayer) == "TeamName" then 
for _,v in ipairs (getPlayersInTeam(getTeamFromName("TeamName"))) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName(v),false,false) 
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
end 
if getPlayerTeam(localPlayer) == "TeamName2" then 
for _,i in ipairs (getPlayersInTeam(getTeamFromName("TeamName2"))) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName(i),false,false) 
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
end 
end 
  

حبي اسف بس ما اشتغل

Link to comment
  
function GetTeam() 
if getPlayerTeam(localPlayer) == "TeamName" then 
for _,v in ipairs (getPlayersInTeam(getTeamFromName("TeamName"))) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName(v),false,false) 
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
end 
end 
if getPlayerTeam(localPlayer) == "TeamName2" then 
for _,v in ipairs (getPlayersInTeam(getTeamFromName("TeamName2"))) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName(v),false,false) 
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
end 
end 
end 
  

Link to comment

احمد هذا المرة بيشتغل متأكد %100 بأذن الله

+

ممكن توضح لي وش تبي تسوي , لاني مافهمت شي صراحة

يبي يجيب لاعبين تيمه

يعني لما لاعب يكون في تيم Team 1

يجيب كل لاعبين Team 1

واذا كان في Team 2

يجيب كل لاعبين Team 2

Link to comment
  
function GetTeam() 
if getPlayerTeam(localPlayer) == "TeamName" then 
for _,v in ipairs (getPlayersInTeam(getTeamFromName("TeamName"))) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName(v),false,false) 
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
end 
end 
if getPlayerTeam(localPlayer) == "TeamName2" then 
for _,v in ipairs (getPlayersInTeam(getTeamFromName("TeamName2"))) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName(v),false,false) 
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
end 
end 
end 
  

NOT WORK

Link to comment

جرب ذا , ااذا ماضبط اطرح اكوادك كاملة

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 
  
function refreshGrid () 
  
guiGridListClear(GUIEditor.gridlist[1]) 
  
local theTeam = getTeamFromName ( "Team1" ) 
  
if ( theTeam ) then 
  
if isPlayerInTeam ( localPlayer , "Team1" ) then 
  
for i , players_ in ipairs ( getPlayersInTeam ( theTeam ) ) do  
  
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
  
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName( players_ ),false,false) 
  
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
            end 
        end 
    end 
guiGridListClear(GUIEditor.gridlist[1]) 
  
local theTeam = getTeamFromName ( "Team2" ) 
  
if ( theTeam ) then 
  
if isPlayerInTeam ( localPlayer , "Team2" ) then 
  
for i , players_ in ipairs ( getPlayersInTeam ( theTeam ) ) do  
  
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
  
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName( players_ ),false,false) 
  
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
            end 
        end 
    end 
end 
  

عند فتح اللوحة ضيف

refreshGrid () 
Link to comment
جرب ذا , ااذا ماضبط اطرح اكوادك كاملة

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 
  
function refreshGrid () 
  
guiGridListClear(GUIEditor.gridlist[1]) 
  
local theTeam = getTeamFromName ( "Team1" ) 
  
if ( theTeam ) then 
  
if isPlayerInTeam ( localPlayer , "Team1" ) then 
  
for i , players_ in ipairs ( getPlayersInTeam ( theTeam ) ) do  
  
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
  
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName( players_ ),false,false) 
  
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
            end 
        end 
    end 
guiGridListClear(GUIEditor.gridlist[1]) 
  
local theTeam = getTeamFromName ( "Team2" ) 
  
if ( theTeam ) then 
  
if isPlayerInTeam ( localPlayer , "Team2" ) then 
  
for i , players_ in ipairs ( getPlayersInTeam ( theTeam ) ) do  
  
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
  
guiGridListSetItemText(GUIEditor.gridlist[1],Row,cow,getPlayerName( players_ ),false,false) 
  
guiGridListSetItemColor(GUIEditor.gridlist[1],Row,cow,53, 53, 201, 255) 
            end 
        end 
    end 
end 
  

عند فتح اللوحة ضيف

refreshGrid () 

مشكور بس في مشكله و هي

Team2 يشتغل

و Team1 مايشتغل

Link to comment
وش يطلع لك بالدي بوق , واكوادك كاملة

خلاص حليت مشكله انت حط مرتين اكود هدا

guiGridListClear(GUIEditor.gridlist[1]) 

و اني حذفت تاني اشتغل

=========================

اكود هدا صح ؟

addEvent ("playerteam",true) 
addEventHandler ("playerteam",root, 
function (amm,plr) 
  
if amm == "" then     outputChatBox("ادخل الرقم الدم الدي تريد ارسله ",source,255,0,0) return end 
  
if getElementHealth(source) <= 0 then   outputChatBox("ليس لديك الدم الكافي ",source,255,0,0) return end 
  
if plr == source then       outputChatBox("لا تستطيع ارسل دم الي نفسك",source,255,0,0)  return end 
  
  
  
  
  
setElementHealth(plr,amm) 
  
 local HB1 = getElementHealth(source) 
  
setElementHealth(source,HB1- amm) 
  
outputChatBox ("تم التحويل",source,0,255,0) 
end 
  
) 
  
  

local plr = getPlayerFromName (plrName) 
  
local amm = guiGetText(GUIEditor.edit[1]) 

Link to comment
addEvent ("playerteam",true) 
addEventHandler ("playerteam",root, 
function (amm,plr) 
if not tonumber(amm) then return outputChatBox("ادخل الرقم الدم الدي تريد ارسله ",source,255,0,0) end 
if getElementHealth(source) <= tonumber(amm) then return outputChatBox("ليس لديك الدم الكافي ",source,255,0,0) end 
if plr == getPlayerFromName(getPlayerName(source)) then return outputChatBox("لا تستطيع ارسل دم الي نفسك",source,255,0,0) end 
setElementHealth(plr,getElementHealth(plr) + tonumber(amm)) 
local HB1 = getElementHealth(source) 
setElementHealth(source,HB1- tonumber(amm)) 
outputChatBox ("تم التحويل",source,0,255,0) 
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...