Master_MTA

x[استفسار ]xبخصوص الاكاونت

Recommended Posts

السلام عليكم ورحمة الله وبركاته اخواني سؤال بسيط فقط 

هل يمكن جلب اللاعب من اسم حسابه؟

 

Share this post


Link to post
6 minutes ago, Master_MTA said:

السلام عليكم ورحمة الله وبركاته اخواني سؤال بسيط فقط 

هل يمكن جلب اللاعب من اسم حسابه؟

 

getAccountName

Share this post


Link to post

اخوي تايجر ما يزبط للاسف انا جربتها قبل ان اطرح الموضوع لكن ما زبط

Share this post


Link to post
Just now, Master_MTA said:

اخوي تايجر ما يزبط للاسف انا جربتها قبل ان اطرح الموضوع لكن ما زبط

اطرح محاولتك

Share this post


Link to post
4 minutes ago, iMr ~ MnHmAr said:

اطرح محاولتك


addEvent("teamcrr",true)
addEventHandler("teamcrr",root,function(a,b,e)
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then
local playername = getAccountPlayer(e)
	
local b1,c1,d1 = getColorFromString(b) 

local team2 = createTeam ( a, b1, c1, d1 )
local ks = getPlayerAccount(playername)

setPlayerTeam(playername,team2)
setAccountData(ks,"ownerTeam",getTeamName(team2))
	 
	 setElementData(playername,"ownerrr",getPlayerTeam(playername))
	 
	 	 setElementData(playername,"ownerrr2",getAccountName(getPlayerAccount(playername)) )

setElementData(team2,"?owner",getAccountName(getPlayerAccount(playername)))

triggerClientEvent("asgs",root)
triggerClientEvent("closect",source)

end

end
)

e

ايديت بوكس 

 

Edited by Master_MTA
اعتذر هذا كان القديم

Share this post


Link to post

ما اشوف فيه اخطاء

لو تقدر تطرح 

ارسال التقرايت لـ السيرفر الي بـ الكلنت يمكن فيه يكون الغلط

الايدت بوكس تحط فيه اسم الاعب ؟

Share this post


Link to post

لا يا  غالي احط اسم الحساب

تفضل كلنت

elseif source == GUIEditor.button[14] then
local a1=guiGetText(GUIEditor.edit[1])
local a2=guiGetText(GUIEditor.edit[2])
local a5 = guiGetText(GUIEditor.edit[5])
if a1 ~="" and a2 ~="" and a5 ~="" then
	

triggerServerEvent("teamcrr",localPlayer,a1,a2,a5)

aTeamsRefresh()

else
outputChatBox("pls Complete all EditBox")
aTeamsRefresh()

end

 

Share this post


Link to post
-- #Server
addEvent("teamcrr",true)
addEventHandler("teamcrr",root,function( a,b,e )
  if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then
   local playername = getAccountPlayer(e)
    local b1,c1,d1 = getColorFromString(b) 
     local team2 = createTeam ( a, b1, c1, d1 )
      local ks = getPlayerAccount(playername)	  
       setPlayerTeam(playername,team2)
        setAccountData(ks,"ownerTeam",getTeamName(team2))
	     setElementData(playername,"ownerrr",getPlayerTeam(playername))
	      setElementData(playername,"ownerrr2",getAccountName(getPlayerAccount(playername)) )
           setElementData(team2,"?owner",getAccountName(getPlayerAccount(playername)))
            triggerClientEvent("asgs",root)
             triggerClientEvent("closect",source)
          end
       end
   )
   
   --#Client
   
 elseif source == GUIEditor.button[14] then
  local a1 = guiGetText(GUIEditor.edit[1])
   local a2 = guiGetText(GUIEditor.edit[2])
    local a5 = guiGetText(GUIEditor.edit[5])
     if a1 ~="" and a2 ~="" and a5 ~="" then
      triggerServerEvent("teamcrr",localPlayer,a1,a2,a5)
       aTeamsRefresh()
   else
   outputChatBox("pls Complete all EditBox")
    aTeamsRefresh()

end

جرب  ;

Edited by iMr ~ MnHmAr

Share this post


Link to post
2 minutes ago, iMr ~ MnHmAr said:

-- #Server
addEvent("teamcrr",true)
addEventHandler("teamcrr",root,function( a,b,e )
  if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then
   local playername = getAccountPlayer(e)
    local b1,c1,d1 = getColorFromString(b) 
     local team2 = createTeam ( a, b1, c1, d1 )
      local ks = getPlayerAccount(playername)	  
       setPlayerTeam(playername,team2)
        setAccountData(ks,"ownerTeam",getTeamName(team2))
	     setElementData(playername,"ownerrr",getPlayerTeam(playername))
	      setElementData(playername,"ownerrr2",getAccountName(getPlayerAccount(playername)) )
           setElementData(team2,"?owner",getAccountName(getPlayerAccount(playername)))
            triggerClientEvent("asgs",root)
             triggerClientEvent("closect",source)
          end
       end
   )
   
   --#Client
   
 elseif source == GUIEditor.button[14] then
  local a1 = guiGetText(GUIEditor.edit[1])
   local a2 = guiGetText(GUIEditor.edit[2])
    local a5 = guiGetText(GUIEditor.edit[5])
     if a1 ~="" and a2 ~="" and a5 ~="" then
      triggerServerEvent("teamcrr",localPlayer,a1,a2,a5)
       aTeamsRefresh()
   else
   outputChatBox("pls Complete all EditBox")
    aTeamsRefresh()

end

جرب  ;

مو شغال +_+

Share this post


Link to post

لو طلع كنت جبته ذذ+_+

يقولي

getAccountPlayer

got string

كذا

ويجيبلي اسم الحساب

اللي كتبته

Share this post


Link to post
local account = getAccount( string theText )
local player = getAccountPlayer( account )

Required Arguments

  • theAccount: The account you wish to get the player of. /// not string
Edited by MR.GRAND

Share this post


Link to post
1 minute ago, MR.GRAND said:

local account = getAccount( string theText )
local player = getAccountPlayer( account )

Required Arguments

  • theAccount: The account you wish to get the player of. /// not string

hmmmmmmmmmm

thx man +_+

Edited by Master_MTA

Share this post


Link to post

another question if i wanna check if the account name really is registered in the server what i will do

    local accountTable = getAccounts () -- return the table over accounts
i will used that but after that what i will do?

Edited by Master_MTA

Share this post


Link to post

استخدم هذي الوظيفه 

function getPlayerFromAccount ( accnt )
    if accnt and type ( accnt ) == 'string' then
        for i, v in ipairs ( getElementsByType ( 'player' ) ) do
            if ( getAccountName ( getPlayerAccount ( v ) ) == accnt ) then
                return v;
            end
        end
    end
    return false
end

 

  • Like 1

Share this post


Link to post

If you want to check if the specified account is already registered below you just need to put if after get account like this

اذا تبي تتحقق اذا الحساب المحدد موجود ومسجل مسبقا انت تحتاج فقط تسوي كذا

local account = getAccount( string accountName )
	if ( account ~= false ) then
		...
	end

-- complete code if the account is already exists, return otherwise
-- راح يكمل الوظيفة لو ان الحساب موجود, راح يرجع ويوقف الوظيفة لو العكس

 

Edited by MR.GRAND

Share this post


Link to post
1 minute ago, MR.GRAND said:

If you want to check if the specified account is already registered below you just need to put if after get account like this

 


local account = getAccount( string accountName )
	if ( account ~= false ) then
		...
	end

-- complete code if the account is already exists, return otherwise

 

الحين تخيل انه ما يفهم انجليزي

كيف بيفهم كلامك خخخخخ

ي ليت تتكلم عربي 

Share this post


Link to post
1 minute ago, Abu-Solo said:

الحين تخيل انه ما يفهم انجليزي

كيف بيفهم كلامك خخخخخ

ي ليت تتكلم عربي 

^
Up

تم التعديل

  • Like 1

Share this post


Link to post
3 minutes ago, MR.GRAND said:

If you want to check if the specified account is already registered below you just need to put if after get account like this

 


local account = getAccount( string accountName )
	if ( account ~= false ) then
		...
	end

-- complete code if the account is already exists, return otherwise

 

thx alot  man

2 minutes ago, Abu-Solo said:

الحين تخيل انه ما يفهم انجليزي

كيف بيفهم كلامك خخخخخ

ي ليت تتكلم عربي 

ابشر

  • Like 1

Share this post


Link to post

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.