Jump to content

x[ تصحيح ]x كود انشاء التيمات


#STZ

Recommended Posts

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

ابي اسوي لما يكتب في ايديت اسم تيم و يضغط زر

يسوي التيم و يضيف اللاعب فيه

بس مدري الدي بق يقول ان المشكلة من التريقر

--Client
addEventHandler("onClientGUIClick",root,
function()
local MAKETEAM = guiGetText(GUIEditor.edit[1])
if source == GUIEditor.button[1] then
triggerServerEvent ( 'MAKETEAM', getLocalPlayer (), MAKETEAM)
end
end
)
--Server
addEvent('MAKETEAM',true)
addEventHandler('MAKETEAM',getRootElement(),
function(Team)
local newTeam = createTeam ( Team )
setPlayerTeam ( source, Team )
end
end
)

اتمني المساعدة و تصحيح الكود

Link to comment

ممكن هاذا كمان

ابي لما احط اسم حساب و اضغط زر يضيف صاحب الحساب

local addplayer = guiGetText(GUIEditor.button[2])
local teamplayer = getPlayerTeam ( addplayer ) 

addEventHandler("onClientGUIClick",root,
function()
if source == GUIEditor.button[1] then
triggerServerEvent ( 'addplayer', getLocalPlayer (), addplayer)
end
end
)
local accountname = getAccountName
addEvent('addplayer',true)
addEventHandler('addplayer',getRootElement(),
function(Team)
setPlayerTeam ( source,  accountname  )
end
)

 

ابي يضيفه في تيم الشخص اللي ضغط الزر

Link to comment
2 hours ago, MR.NaiF-MTA said:

ممكن هاذا كمان

ابي لما احط اسم حساب و اضغط زر يضيف صاحب الحساب


local addplayer = guiGetText(GUIEditor.button[2])
local teamplayer = getPlayerTeam ( addplayer ) 

addEventHandler("onClientGUIClick",root,
function()
if source == GUIEditor.button[1] then
triggerServerEvent ( 'addplayer', getLocalPlayer (), addplayer)
end
end
)

local accountname = getAccountName
addEvent('addplayer',true)
addEventHandler('addplayer',getRootElement(),
function(Team)
setPlayerTeam ( source,  accountname  )
end
)

 

ابي يضيفه في تيم الشخص اللي ضغط الزر

دبل اللوكال بلاير بالكلنت

هذا كله غلط اصلا

  1. local accountname = getAccountName
  2. addEvent('addplayer',true)
  3. addEventHandler('addplayer',getRootElement(),
  4. function(Team)
  5. setPlayerTeam ( source, accountname )
  6. end
  7. )
Edited by Master_MTA
Link to comment
-- #Clinet
addEventHandler("onClientGUIClick",root,
 function()
  if source == GUIEditor.button[1] then
   local addplayer = guiGetText(NameEdit) -- اسم الايديت بوكس حقك
    triggerServerEvent ( 'addplayer', getLocalPlayer (), addplayer,teamplayer)
   end
end
)

-- #Server

addEvent('addplayer',true)
addEventHandler('addplayer',getRootElement(),
function(addplayer,teamplayer)
   local account = getPlayerAccount ( addplayer )
    if account then
     local accname = getAccountName ( account ) 
      setPlayerTeam ( source ,  "اسم التيم "  )
  end
end
)

 

Edited by iMr ~ MnHmAr
Link to comment
-- #Clinet
addEventHandler("onClientGUIClick",root,
 function()
  if source == GUIEditor.button[1] then
   local addplayer = guiGetText(NameEdit) -- اسم الايديت بوكس حقك
    triggerServerEvent ( 'addplayer', getLocalPlayer (), addplayer,teamplayer)
   end
end
)

-- #Server

addEvent('addplayer',true)
addEventHandler('addplayer',getRootElement(),
function(addplayer,teamplayer)
  local acc = getAccount(player1)
      if acc and not isGuestAccount(acc) then
      local account = getAccountName(acc)
          if account then
      setPlayerTeam ( source ,  "اسم التيم "  )
    end
  end
end    
)

 

Edited by iMr ~ MnHmAr
Link to comment
Just now, Abdul KariM said:

^

غلط

 ليه وش الغلط 

-- #Clinet
addEventHandler("onClientGUIClick",root,
 function()
  if source == GUIEditor.button[1] then
   local addplayer = guiGetText(NameEdit) -- اسم الايديت بوكس حقك
    triggerServerEvent ( 'addplayer', getLocalPlayer (), addplayer)
   end
end
)

-- #Server

addEvent('addplayer',true)
addEventHandler('addplayer',getRootElement(),
function(addplayer)
  local acc = getAccount(addplayer)
      if acc and not isGuestAccount(acc) then
      local account = getAccountName(acc)
          if account then
      setPlayerTeam ( source ,  "اسم التيم "  )
    end
  end
end    
)

 

Link to comment
function teamName ( source, key, newTeamName )
    local playerTeam = getPlayerTeam ( source )          -- get the player's team
    if ( playerTeam ) then                               -- if he's on a team
        local oldTeamName = getTeamName ( playerTeam )   -- get the team's current name
        setTeamName ( playerTeam, newTeamName )          -- change its name
        outputChatBox ( "Changed " .. getPlayerName ( source ).."Is team name from " .. oldTeamName .. " to " .. newTeamName )
    else
        outputChatBox ( getPlayerName ( source ) .. " isn't on a team" )
    end
end
addCommandHandler ( "Team", teamName )
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...