WASSIm. Posted September 12, 2013 Posted September 12, 2013 مرحبا جميع أريد جعل قائمة حسابات في 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 )
iPrestege Posted September 12, 2013 Posted September 12, 2013 مرحبا بك .. 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 )
WASSIm. Posted September 12, 2013 Author Posted September 12, 2013 (edited) شكرا هذه مشكلة أخرى فهو يقول النيل 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 September 13, 2013 by Guest
iPrestege Posted September 12, 2013 Posted September 12, 2013 أنت على الرحب و السعة .. قم بــ أرســال الحساب المحدد الى جانب السيرفر ثم قم بفعل ماتريده باسترداد النص المحدد عن استلام النص على جانب العميل ..
WASSIm. Posted September 12, 2013 Author Posted September 12, 2013 أنت على الرحب و السعة ..قم بــ أرســال الحساب المحدد الى جانب السيرفر ثم قم بفعل ماتريده باسترداد النص المحدد عن استلام النص على جانب العميل .. آسف لكنني عدلة بوست يرجى إعادة قراءة
WASSIm. Posted September 13, 2013 Author Posted September 13, 2013 ماذا تحاول ان تفعل ؟ ذا ضغط حساب في القائمة واضغط على زر حذف الحساب سيتم حذف ولكن يقول هذا حساب النيل
iPrestege Posted September 13, 2013 Posted September 13, 2013 لا أرى أنك تحاول حذف الحساب في أي من الأكواد السابقة
WASSIm. Posted September 13, 2013 Author Posted September 13, 2013 (edited) 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 September 13, 2013 by Guest
AboShanab Posted September 13, 2013 Posted September 13, 2013 (edited) جرب .. 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 September 13, 2013 by Guest
WASSIm. Posted September 13, 2013 Author Posted September 13, 2013 (edited) حذف Edited September 13, 2013 by Guest
WASSIm. Posted September 13, 2013 Author Posted September 13, 2013 المشكلة هنا أنه يقول النيل 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 )
AboShanab Posted September 13, 2013 Posted September 13, 2013 حط بملف Client الكود حقي فقط بدون function getClientAccount (account) triggerServerEvent( "onGetAccount", localPlayer, account ) end وجرب
AboShanab Posted September 13, 2013 Posted September 13, 2013 local theAccount = guiGridListGetItemText (tabaccountslist,guiGridListGetSelectedItem(tabaccountslist),1) outputChatBox(theAccount) جرب كذا
|Mr|-Talal07-| Posted September 13, 2013 Posted September 13, 2013 # 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 )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now