Jump to content

طلب مساعده ب setAccountData


Recommended Posts

addEventHandler('onPlayerQuit',root,     
function() --  
    local vAcc = getPlayerAccount(source)   
        if not vAcc or isGuestAccount(vAcc) then return end    
            setAccountData(vAcc,'Clothes',getPedClothes (source) 
    end  
)   
  
addEventHandler('onPlayerLogin',root, 
function(_,acc) 
    local v_Data = getAccountData(acc,'Clothes') 
        if ( v_Data ) then 
            setPedClothes(source,vData) 
        end  
    end  
) 

سويته يحفض ال Clothes حق سكين 0

Link to comment

مافهمت اييش تبي بالظبط بس صلحت شيء

addEventHandler('onPlayerQuit',root,     
function() -- 
    local vAcc = getPlayerAccount(source)   
        if not vAcc or isGuestAccount(vAcc) then return end 
            for type = 0,17 do 
            texture, model = getPedClothes(source, type)         
            setAccountData(vAcc,'Clothes',model) 
        end 
    end 
)   
  
  
  

Link to comment

جرب

addEventHandler("onPlayerQuit", root, function (    ) 
    local PlayerAccount = getPlayerAccount ( source )  
        if not vAcc or isGuestAccount ( PlayerAccount ) then return end  
                setAccountData ( PlayerAccount, "Clothes", getPedClothes ( source , 0 ) )  
    end  
) 
  
addEventHandler("onPlayerLogin", root, function ( _,acc )  
    local v_Data = getAccountData ( acc, "Clothes" )  
        if ( v_Data ) then  
            if getElementModel ( source ) == 0 then 
                setPedClothes ( source, 0 ) 
        end  
    end  
) 

Edit : :mrgreen:

Edited by Guest
Link to comment

والله اول مره اشوفه هههههه

Useful Function هذا الفنكشن جديد من ضمن

John : مسويه

بس ماظن فيه فرق بين فنكشن

setPedClothes 

و

addPedClothes 

ما زبط

addEventHandler('onPlayerQuit',root,    --  
function() -- 
    local vAcc = getPlayerAccount(source)   
        if not vAcc or isGuestAccount(vAcc) then return end 
            for type = 0,17 do 
            texture, model = getPedClothes(source, type)        
            setAccountData(vAcc,'Clothes',model) 
        end 
    end 
)   
  
addEventHandler('onPlayerLogin',root, 
function(_,acc) 
    local v_Data = getAccountData(acc,'Clothes') 
        if ( v_Data ) then 
addPedClothes ( source,v_Data) 
        end  
    end  
) 

Link to comment
مافهمت اييش تبي بالظبط بس صلحت شيء
addEventHandler('onPlayerQuit',root,     
function() -- 
    local vAcc = getPlayerAccount(source)   
        if not vAcc or isGuestAccount(vAcc) then return end 
            for type = 0,17 do 
            texture, model = getPedClothes(source, type)         
            setAccountData(vAcc,'Clothes',model) 
        end 
    end 
)   
  
  
  

كيف مو فاهم شي و صلحت ؟

يا ريت الي ما يفهم ما يساعد

Link to comment
طيب وش عرفك ان الكود ضبط ولالا؟

هات الكود الي يوم تجيب الداتا حق الحساب

انا مسوي سيرفر تجريبي و اجرب اطلع و ادخل و ما ينحفض الملابس

هات الكود الي يوم تجيب الداتا حق الحساب

مو فاهمك يا ريت توضح

Link to comment

يعني ياطويل العمر

انت تطلع وتدخل

وش دراك انه حفظ الداتا او لا ؟

__Edit ,

انت تبيه يحفظ الملابس على حساب اللاعب صح !

جرب هذا الكود

addEventHandler("onPlayerQuit", getRootElement(   ), 
function (      ) 
     local Elaccounte = getPlayerAccount( source ) 
         if not ( isGuestAccount( Elaccounte ) and Elaccounte ) then 
              if getElementModel( source ) == 0 then 
                     for i = 0, 17 do 
                         local clothes, cloth = getPedClothes( source, i ) 
                         setAccountData ( Elaccounte, "Clothes", clothes, cloth ) 
                        setAccountData( Elaccounte, "IntId", tostring(i) ) 
                    end 
              end 
        end 
end 
  
addEventHandler( "onPlayerLogin", getRootElement(   ), 
function(     ) 
      local acc = getPlayerAccount( source ) 
            if acc then 
                 local c, o = getAccountData ( acc, "Clothes" ) 
                      addPedClothes( source, c, o, tonumber( getAccountData( acc, "IntId" ) ) ) 
             end 
 end 
) 

Edited by Guest
Link to comment

طيب ليه ما زبط شوف عدلته:

addEventHandler('onPlayerQuit',root,    --  
function() -- 
    local vAcc = getPlayerAccount(source)   
        if not vAcc or isGuestAccount(vAcc) then return end 
            for type = 0,17 do 
            texture, model = getPedClothes(source, type)        
            setAccountData(vAcc,'Clothes',model) 
        end 
    end 
)   
  
addEventHandler('onPlayerLogin',root, 
function(_,acc) 
    local v_Data = getAccountData(acc,'Clothes') 
        if ( v_Data ) then 
addPedClothes ( source,v_Data) 
        end  
    end  
) 

Link to comment
  • Other Languages Moderators

كل الأكواد الي بالموضوع عبارة عن هريس

addEventHandler("onPlayerQuit",root,     
function() 
    local account = getPlayerAccount(source)   
    if account and not isGuestAccount(account) then 
        local cTable = {} 
        for i = 0, 17 do 
            local texture, model = getPedClothes(source, i) 
            if texture and model then 
                table.insert(cTable, {texture, model, i}) 
            end 
        end 
        setAccountData(account, "Clothes", toJSON(cTable)) 
    end 
end)   
  
addEventHandler("onPlayerLogin", root, 
function() 
    if not isPedDead(source) then 
        givePlayerClothes() 
    else 
        addEventHandler("onPlayerSpawn", source, givePlayerClothes) 
    end 
end) 
  
function givePlayerClothes() 
    local account = getPlayerAccount(source)   
    if account and not isGuestAccount(account) then 
        local data = getAccountData(account, "Clothes") 
        if (data) then 
            local cTable = fromJSON(data) 
            if cTable and type(cTable) == "table" then 
                local cSkin = getElementModel(source) 
                setElementModel(source, 0) 
                for _, value in ipairs(cTable) do 
                    addPedClothes(source, value[1], value[2], value[3]) 
                end 
                setElementModel(source, cSkin) 
            end 
        end 
    end 
    if eventName == "onPlayerSpawn" then 
        removeEventHandler("onPlayerSpawn", source, givePlayerClothes) 
    end 
end 

Link to comment
كل الأكواد الي بالموضوع عبارة عن هريس
addEventHandler("onPlayerQuit",root,     
function() 
    local account = getPlayerAccount(source)   
    if account and not isGuestAccount(account) then 
        local cTable = {} 
        for i = 0, 17 do 
            local texture, model = getPedClothes(source, i) 
            if texture and model then 
                table.insert(cTable, {texture, model, i}) 
            end 
        end 
        setAccountData(account, "Clothes", toJSON(cTable)) 
    end 
end)   
  
addEventHandler("onPlayerLogin", root, 
function() 
    if not isPedDead(source) then 
        givePlayerClothes() 
    else 
        addEventHandler("onPlayerSpawn", source, givePlayerClothes) 
    end 
end) 
  
function givePlayerClothes() 
    local account = getPlayerAccount(source)   
    if account and not isGuestAccount(account) then 
        local data = getAccountData(account, "Clothes") 
        if (data) then 
            local cTable = fromJSON(data) 
            if cTable and type(cTable) == "table" then 
                local cSkin = getElementModel(source) 
                setElementModel(source, 0) 
                for _, value in ipairs(cTable) do 
                    addPedClothes(source, value[1], value[2], value[3]) 
                end 
                setElementModel(source, cSkin) 
            end 
        end 
    end 
    if eventName == "onPlayerSpawn" then 
        removeEventHandler("onPlayerSpawn", source, givePlayerClothes) 
    end 
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...