Jump to content

مساعدة


WASSIm.

Recommended Posts

مرحبا جميع

أريد جعل قائمة حسابات في guiGridList

ولكن لا شيء

Client

addEvent ( "onClientLoadAccountsList", true ) 
addEventHandler ( "onClientLoadAccountsList", root, 
function ( accounts ) 
    guiGridListClear ( tabaccountslist ) 
    for _, name in ipairs ( accounts ) do 
        local row = guiGridListAddRow ( tabaccountslist ) 
        guiGridListSetItemText ( tabaccountslist, row, tabaccountslistcolumn, name, false, false ) 
    end 
end 
) 

Server

function onLoadAccountsList ( ) 
    local accounts = { } 
    for _, account in ipairs ( getAccounts ( ) ) do 
        table.insert ( accounts, getAccountName ( account ) ) 
    end 
    triggerClientEvent ( "onClientLoadAccountsList", root, accounts ) 
end 
addEvent ( "onLoadAccountsList", true ) 
addEventHandler ( "onLoadAccountsList", getRootElement(), onLoadAccountsList ) 

Link to comment

مرحبا بك ..

function onLoadAccountsList ( ) 
    local accounts = { } 
    for _, account in ipairs ( getAccounts ( ) ) do 
        table.insert ( accounts,{ acc = getAccountName ( account ) } ) 
    end 
    triggerClientEvent ( "onClientLoadAccountsList", root, accounts ) 
end 
addEvent ( "onLoadAccountsList", true ) 
addEventHandler ( "onLoadAccountsList", getRootElement(), onLoadAccountsList ) 

addEvent ( "onClientLoadAccountsList", true ) 
addEventHandler ( "onClientLoadAccountsList", root, 
function ( accounts ) 
    guiGridListClear ( tabaccountslist ) 
    for _, name in ipairs ( accounts ) do 
        local row = guiGridListAddRow ( tabaccountslist ) 
        guiGridListSetItemText ( tabaccountslist, row, tabaccountslistcolumn, tostring ( name.acc ), false, false ) 
    end 
end 
) 

Link to comment

شكرا

هذه مشكلة أخرى

فهو يقول النيل

  
addEventHandler ( "onClientGUIClick", getRootElement(), 
function ( ) 
local theAccount =  getClientAccount(guiGridListGetItemText (tabaccountslist,guiGridListGetSelectedItem(tabaccountslist),1)) 
    if ( guiGetSelectedTab(tabpanel) == tabaccounts)then 
        if (source == tabaccountsdelete ) then 
            if (theAccount) then 
                triggerServerEvent( "onDeleteAccount", localPlayer, theAccount ) 
            end 
        end 
    end 
end 
) 
  
function getClientAccount (account) 
    triggerServerEvent( "onGetAccount", localPlayer, account ) 
end 
  

SERVER

function getNameAccount (account) 
    getAccount(account) 
end 
addEvent( "onGetAccount", true ) 
addEventHandler( "onGetAccount", root, getNameAccount ) 

Edited by Guest
Link to comment
أنت على الرحب و السعة ..

قم بــ أرســال الحساب المحدد الى جانب السيرفر ثم قم بفعل ماتريده باسترداد النص المحدد عن استلام النص على جانب العميل ..

آسف لكنني عدلة بوست يرجى إعادة قراءة

Link to comment

CLIENT

addEventHandler ( "onClientGUIClick", getRootElement(), 
function ( ) 
local theAccount =  getClientAccount(guiGridListGetItemText (tabaccountslist,guiGridListGetSelectedItem(tabaccountslist),1)) 
    if ( guiGetSelectedTab(tabpanel) == tabaccounts)then 
        if (source == tabaccountsdelete ) then 
            if (theAccount) then 
                triggerServerEvent( "onDeleteAccount", localPlayer, theAccount ) 
            end 
        end 
    end 
end 
) 
  
function getClientAccount (account) 
    triggerServerEvent( "onGetAccount", localPlayer, account ) 
end 

SERVER

function getNameAccount (account) 
    getAccount(account) 
end 
addEvent( "onGetAccount", true ) 
addEventHandler( "onGetAccount", root, getNameAccount ) 
  
function DeleteAccount (theAccount) 
    local nameAccount = getAccountName(theAccount) 
    removeAccount(theAccount) 
    exports["ZA-dxhelp"]:createNewHelpMessageForPlayer (source,"you'r Delete Account "..nameAccount, 0, 255, 0) 
end 
addEvent ( "onDeleteAccount", true ) 
addEventHandler ( "onDeleteAccount", getRootElement(), DeleteAccount) 

Edited by Guest
Link to comment

جرب .. :wink:

  
addEventHandler ( "onClientGUIClick", getRootElement(), 
function ( ) 
if ( source == tabaccountsdelete ) then 
if ( guiGridListGetSelectedItem(tabresourceslist) ~= -1 ) then 
local theAccount = guiGridListGetItemText (tabresourceslist,guiGridListGetSelectedItem(tabaccountslist),1) 
if (theAccount) then 
triggerServerEvent( "onDeleteAccount", localPlayer, theAccount ) 
end 
end 
end 
end 
) 
  

Edited by Guest
Link to comment

المشكلة هنا أنه يقول النيل

Client

local theAccount = getClientAccount(guiGridListGetItemText (tabaccountslist,guiGridListGetSelectedItem(tabaccountslist),1)) 
outputChatBox(theAccount) 
  
function getClientAccount (account) 
    triggerServerEvent( "onGetAccount", localPlayer, account ) 
end 

server

function getNameAccount (account) 
    getAccount(account) 
end 
addEvent( "onGetAccount", true ) 
addEventHandler( "onGetAccount", root, getNameAccount ) 

Link to comment

# Client Side #

addEventHandler("onClientGUIClick",root, 
    function () 
        local sel = guiGridListGetSelectedItem(tabaccountslist) 
        if source == tabaccountsdelete then 
            if sel ~= -1 then 
                local accountName = guiGirdListGetItemText(tabaccountslist,sel,1) 
                triggerServerEvent("onDeleteAccount",localPlayer,accountName) 
            else 
                outputChatBox("Error: You did not select an account",255,0,0) 
            end 
        end 
    end 
) 

# Server Side #

addEvent("onDeleteAccount",true) 
addEventHandler("onDeleteAccount",root, 
    function (accountName) 
        local account = getAccount(accountName) 
        if account then 
            removeAccount(account) 
            outputChatBox("INFO: Account Deleted",source,0,255,0) 
        else 
            outputChatBox("Error: Account not found",source,255,0,0) 
        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...