#AL-J7EEEM Posted June 5, 2017 Share Posted June 5, 2017 الحين انا اخذت كود مستر جراند في مود الشراء عشان ابي اعدل عليه بدل السيريال الحساب سويت هيك ومايشتغل الكود : addEventHandler( 'onClientGUIClick', root, function() if (source == Players.GridList.BuyingWNDManager) then local getItemSelected = guiGridListGetSelectedItem(Players.GridList.BuyingWNDManager) if (getItemSelected == -1) then guiSetText(TotalPrice.Label.BuyingWNDManager, "") guiSetText(PlayerSerial.Label.BuyingWNDManager, "") guiSetText(cardType.Label.ManagerBuyWND, "") guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) end end end ) addEventHandler( 'onClientGUIClick', root, function() if (source == Players.GridList.BuyingWNDManager) then local getItemSelected = guiGridListGetSelectedItem(Players.GridList.BuyingWNDManager) if (getItemSelected ~= -1) then local SERIAL_ = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 1) local PRICE_ = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 3) guiSetText(TotalPrice.Label.BuyingWNDManager, PRICE_) guiSetText(PlayerSerial.Label.BuyingWNDManager, SERIAL_) guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) local ID = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 2) triggerServerEvent( 'getCARDS', localPlayer, SERIAL_, ID) end elseif (source == X.Button.BuyingWNDManager) then guiSetVisible(BuyingManager.BuyingWNDManager, false) showCursor(false) end end ) function openBuyWNDmanager() if (not Access[getPlayerSerial(source)]) then outputChatBox("* ERROR : #FFFFFF Access denied !", 255, 0, 0, true) return end if (guiGetVisible(BuyingManager.BuyingWNDManager) == false) then guiSetVisible(BuyingManager.BuyingWNDManager, true) showCursor(true) else guiSetVisible(BuyingManager.BuyingWNDManager, false) showCursor(false) end end الدي بق مو مطلع شي . @#_iMr.[E]coo @Master_MTA مساعده لو سمحتم .. Link to comment
Master_MTA Posted June 5, 2017 Share Posted June 5, 2017 6 minutes ago, #AL-J7EEEM said: الحين انا اخذت كود مستر جراند في مود الشراء عشان ابي اعدل عليه بدل السيريال الحساب سويت هيك ومايشتغل الكود : addEventHandler( 'onClientGUIClick', root, function() if (source == Players.GridList.BuyingWNDManager) then local getItemSelected = guiGridListGetSelectedItem(Players.GridList.BuyingWNDManager) if (getItemSelected == -1) then guiSetText(TotalPrice.Label.BuyingWNDManager, "") guiSetText(PlayerSerial.Label.BuyingWNDManager, "") guiSetText(cardType.Label.ManagerBuyWND, "") guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) end end end ) addEventHandler( 'onClientGUIClick', root, function() if (source == Players.GridList.BuyingWNDManager) then local getItemSelected = guiGridListGetSelectedItem(Players.GridList.BuyingWNDManager) if (getItemSelected ~= -1) then local SERIAL_ = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 1) local PRICE_ = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 3) guiSetText(TotalPrice.Label.BuyingWNDManager, PRICE_) guiSetText(PlayerSerial.Label.BuyingWNDManager, SERIAL_) guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) local ID = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 2) triggerServerEvent( 'getCARDS', localPlayer, SERIAL_, ID) end elseif (source == X.Button.BuyingWNDManager) then guiSetVisible(BuyingManager.BuyingWNDManager, false) showCursor(false) end end ) function openBuyWNDmanager() if (not Access[getPlayerSerial(source)]) then outputChatBox("* ERROR : #FFFFFF Access denied !", 255, 0, 0, true) return end if (guiGetVisible(BuyingManager.BuyingWNDManager) == false) then guiSetVisible(BuyingManager.BuyingWNDManager, true) showCursor(true) else guiSetVisible(BuyingManager.BuyingWNDManager, false) showCursor(false) end end الدي بق مو مطلع شي . @#_iMr.[E]coo @Master_MTA مساعده لو سمحتم .. وش تبي تسوي بالظبط Link to comment
#AL-J7EEEM Posted June 5, 2017 Author Share Posted June 5, 2017 ابي يجيب بدل السيريال . يجيب الاكونت @Master_MTA المود فيه ليبل في اداره المشتريات . لم اضغط علي اللاعب يجي السيريال ابي بدل السيريال يجي الاكونت . Link to comment
Master_MTA Posted June 5, 2017 Share Posted June 5, 2017 8 minutes ago, #AL-J7EEEM said: ابي يجيب بدل السيريال . يجيب الاكونت @Master_MTA المود فيه ليبل في اداره المشتريات . لم اضغط علي اللاعب يجي السيريال ابي بدل السيريال يجي الاكونت . getAccountName Link to comment
#AL-J7EEEM Posted June 5, 2017 Author Share Posted June 5, 2017 يحبيبي افهمني @Master_MTAا المود طويل . وش ابدل؟++ اما سويتها ومايظهر شي بل دي بق Link to comment
#BrosS Posted June 5, 2017 Share Posted June 5, 2017 14 minutes ago, #AL-J7EEEM said: يحبيبي افهمني @Master_MTAا المود طويل . وش ابدل؟++ اما سويتها ومايظهر شي بل دي بق هو فاهمك انت اللي افهمه وما شايفك سويت شي ، لسا اشوف تحقق السريال موجود وما اشوف اي وظيفة تخص الحسابات 1 Link to comment
#AL-J7EEEM Posted June 5, 2017 Author Share Posted June 5, 2017 22 minutes ago, #BrosS said: هو فاهمك انت اللي افهمه وما شايفك سويت شي ، لسا اشوف تحقق السريال موجود وما اشوف اي وظيفة تخص الحسابات انا مو ملاقي التحقق >< Link to comment
coNolel Posted June 5, 2017 Share Posted June 5, 2017 43 minutes ago, #AL-J7EEEM said: انا مو ملاقي التحقق >< معليش بس كيف مو ملاقي اي تحقق و انت اصلا مسوي الاكواد ولا كيف عموما ذا هو اظن التحقق if (not Access[getPlayerSerial(source)]) then outputChatBox("* ERROR : #FFFFFF Access denied !", 255, 0, 0, true) return end Link to comment
#AL-J7EEEM Posted June 5, 2017 Author Share Posted June 5, 2017 1 hour ago, coNolel said: معليش بس كيف مو ملاقي اي تحقق و انت اصلا مسوي الاكواد ولا كيف عموما ذا هو اظن التحقق if (not Access[getPlayerSerial(source)]) then outputChatBox("* ERROR : #FFFFFF Access denied !", 255, 0, 0, true) return end هذا حق فتح الوحه >< يتحقق من سيريال اللاعب ويفتحها Link to comment
^iiEcoo'x_) Posted June 5, 2017 Share Posted June 5, 2017 هات الكود كامل سيرفر + كلينت Link to comment
#AL-J7EEEM Posted June 5, 2017 Author Share Posted June 5, 2017 executeSQLQuery( ' CREATE TABLE IF NOT EXISTS `BoughtUSERSsystem` (userSerial,userID,userName,boughtType,boughtPlan,boughtPrice,typeCard,CARD1,CARD2,CARD3,CARD4,CARD5,CARD6) ' ) --executeSQLQuery( ' DROP TABLE `BoughtUSERSsystem` ' ) addEvent( 'removeUSERfromBuyWindow', true ) addEventHandler( 'removeUSERfromBuyWindow', root, function(SERIAL_, ID) local checkPlayer = executeSQLQuery( ' SELECT * FROM `BoughtUSERSsystem` WHERE userSerial=?', SERIAL_ ) if (checkPlayer) then end executeSQLQuery( ' DELETE FROM `BoughtUSERSsystem` WHERE userID=? ', ID ) outputChatBox('* إدارة المشتريات : #FFFFFF تم حذف المشتري من القائمة بنجاح !', source, 0, 255, 0, true) triggerClientEvent( 'UPDATEGRIDLIST', source) end ) addEvent( 'getCARDS', true ) addEventHandler( 'getCARDS', root, function(SERIAL_, ID) local checkPlayer = executeSQLQuery( ' SELECT * FROM `BoughtUSERSsystem` WHERE userSerial=?', SERIAL_ ) if (checkPlayer) then end local checkID = executeSQLQuery( ' SELECT * FROM `BoughtUSERSsystem` WHERE userID=?', ID ) local CARD1_ = checkID[1]['CARD1'] local CARD2_ = checkID[1]['CARD2'] local CARD3_ = checkID[1]['CARD3'] local CARD4_ = checkID[1]['CARD4'] local CARD5_ = checkID[1]['CARD5'] local CARD6_ = checkID[1]['CARD6'] local CARDtype_ = checkID[1]['typeCard'] triggerClientEvent(source, 'putNUMBERS', source, CARDtype_, CARD1_, CARD2_, CARD3_, CARD4_, CARD5_, CARD6_) end ) addEvent( 'NewPlayerBought', true ) addEventHandler( 'NewPlayerBought', root, function(getID, BoutghType, BoutghPlan, BoutghPrice, cardType, CARDnumber1, CARDnumber2, CARDnumber3, CARDnumber4, CARDnumber5, CARDnumber6) local check = executeSQLQuery('SELECT * FROM `BoughtUSERSsystem` WHERE userSerial=?', getPlayerSerial(source)) if (type(check) == 'table' and #check ~= 0 and check) then local oldItemPlan = check[1]['boughtPlan'] if (oldItemPlan == BoutghPlan) then outputChatBox('* خطأ : #FFFFFF لقد قمت بشراء النوع والخطة التي حددتها مسبقا !', source, 255, 0, 0, true) triggerClientEvent( source, "ERRORselectedBUY", source ) return end local ID = 1 + getID - math.random(10, 100) + math.random(10,100) * getPlayerPing(source) executeSQLQuery('INSERT INTO `BoughtUSERSsystem` (userSerial,userID,userName,boughtType,boughtPlan,boughtPrice,typeCard,CARD1,CARD2,CARD3,CARD4,CARD5,CARD6) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)', getPlayerSerial(source), ID, getPlayerName(source), BoutghType, BoutghPlan, BoutghPrice, cardType, CARDnumber1, CARDnumber2, CARDnumber3, CARDnumber4, CARDnumber5, CARDnumber6) triggerClientEvent( 'UPDATEGRIDLIST', source) triggerClientEvent( source, 'SeccessfullySent', source) else local ID = getPlayerSerial(source) executeSQLQuery('INSERT INTO `BoughtUSERSsystem` (userSerial,userID,userName,boughtType,boughtPlan,boughtPrice,typeCard,CARD1,CARD2,CARD3,CARD4,CARD5,CARD6) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)', getPlayerSerial(source), ID, getPlayerName(source), BoutghType, BoutghPlan, BoutghPrice, cardType, CARDnumber1, CARDnumber2, CARDnumber3, CARDnumber4, CARDnumber5, CARDnumber6) triggerClientEvent( 'UPDATEGRIDLIST', source) triggerClientEvent( source, 'SeccessfullySent', source) end end ) addEvent( 'putPlayers', true ) addEventHandler( 'putPlayers', root, function() local TABLE = executeSQLQuery( ' SELECT * FROM `BoughtUSERSsystem` ' ) triggerClientEvent( 'PutPlayersInList', source, TABLE) end ) Server - كلنت - addEventHandler( 'onClientGUIClick', root, function() if (source == DeleteAll.Button.BuyingWNDManager) then local getItemSelected = guiGridListGetSelectedItem(Players.GridList.BuyingWNDManager) if (getItemSelected == -1) then outputChatBox( '* خطأ : #FFFFFF لم تقم بتحديد مشتري من القائمة !', 255, 0, 0, true) return end local SERIAL_ = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 1) local ID = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 2) triggerServerEvent( 'removeUSERfromBuyWindow', localPlayer, SERIAL_, ID) guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) guiSetText(TotalPrice.Label.BuyingWNDManager, "") guiSetText(PlayerSerial.Label.BuyingWNDManager, "") guiSetText(cardType.Label.ManagerBuyWND, "") guiSetEnabled(DeleteAll.Button.BuyingWNDManager, false) setTimer(guiSetEnabled, 5000, 1, DeleteAll.Button.BuyingWNDManager, true) elseif (source == CopySerial.Button.BuyingWNDManager) then local getAccountName = guiGetText(PlayerSerial.Label.BuyingWNDManager) if (getAccountName == "") then outputChatBox( '* خطأ : #FFFFFF لا يوجد سيريال لتقوم بنسخه !', 255, 0, 0, true) return end setClipboard(getAccountName) guiSetEnabled(CopySerial.Button.BuyingWNDManager, false) setTimer(guiSetEnabled, 5000, 1, CopySerial.Button.BuyingWNDManager, true) outputChatBox('* إدارة المشتريات : #FFFFFF تم نسخ سيريال المشتري بنجاح !', 0, 255, 0, true) end end ) addEvent( 'UPDATEGRIDLIST', true ) addEventHandler( 'UPDATEGRIDLIST', root, function() guiGridListClear(Players.GridList.BuyingWNDManager) triggerServerEvent( 'putPlayers', localPlayer ) end ) function putPlayersBought(SQL) guiGridListClear(Players.GridList.BuyingWNDManager) for i, _ in ipairs(SQL) do local player_ = guiGridListAddRow(Players.GridList.BuyingWNDManager) local text1 = guiGridListSetItemText(Players.GridList.BuyingWNDManager, player_, 1, SQL[i].userName, false, false) local text2 = guiGridListSetItemText(Players.GridList.BuyingWNDManager, player_, 2, SQL[i].boughtType, false, false) local text4 = guiGridListSetItemText(Players.GridList.BuyingWNDManager, player_, 3, SQL[i].boughtPlan, false, false) local Data1 = guiGridListSetItemData(Players.GridList.BuyingWNDManager, player_, 1, SQL[i].userSerial) local data3 = guiGridListSetItemData(Players.GridList.BuyingWNDManager, player_, 3, SQL[i].boughtPrice) local id = guiGridListSetItemData(Players.GridList.BuyingWNDManager, player_, 2, SQL[i].userID) guiGridListSetItemColor(Players.GridList.BuyingWNDManager, player_, 1, 255, 0, 0) guiGridListSetItemColor(Players.GridList.BuyingWNDManager, player_, 2, 255, 255, 0) guiGridListSetItemColor(Players.GridList.BuyingWNDManager, player_, 3, 0, 255, 0) end end addEvent( 'PutPlayersInList', true ) addEventHandler( 'PutPlayersInList', root, putPlayersBought) addEventHandler( 'onClientResourceStart', resourceRoot, function() triggerServerEvent( 'putPlayers', localPlayer ) end ) addEvent( 'putNUMBERS', true ) addEventHandler( 'putNUMBERS', root, function(CARDtype_, CARD1_, CARD2_, CARD3_, CARD4_, CARD5_, CARD6_) guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) Row1 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) Row2 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) Row3 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) Row4 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) Row5 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) Row6 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) if (Row1) and (CARD1_ ~= "") then local text1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row1, 2, CARD1_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row1, 2, 0, 255, 0) end if (Row2) and (CARD2_ ~= "") then local text2 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row2, 2, CARD2_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row2, 2, 0, 255, 0) end if (Row3) and (CARD3_ ~= "") then local text3 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row3, 2, CARD3_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row3, 2, 0, 255, 0) end if (Row4) and (CARD4_ ~= "") then local text4 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row4, 2, CARD4_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row4, 2, 0, 255, 0) end if (Row5) and (CARD5_ ~= "") then local text5 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row5, 2, CARD5_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row5, 2, 0, 255, 0) end if (Row6) and (CARD6_ ~= "") then local text6 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row6, 2, CARD6_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row6, 2, 0, 255, 0) end if (Row1) and (CARD1_ ~= "") then local text1C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row1, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row1, 1, 255, 0, 0) end if (Row2) and (CARD2_ ~= "") then local text2C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row2, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row2, 1, 255, 0, 0) end if (Row3) and (CARD3_ ~= "") then local text3C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row3, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row3, 1, 255, 0, 0) end if (Row4) and (CARD4_ ~= "") then local text4C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row4, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row4, 1, 255, 0, 0) end if (Row5) and (CARD5_ ~= "") then local text5C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row5, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row5, 1, 255, 0, 0) end if (Row6) and (CARD6_ ~= "") then local text6C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row6, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row6, 1, 255, 0, 0) end guiSetText(cardType.Label.ManagerBuyWND, CARDtype_) end ) addEventHandler( 'onClientGUIClick', root, function() if (source == Players.GridList.BuyingWNDManager) then local getItemSelected = guiGridListGetSelectedItem(Players.GridList.BuyingWNDManager) if (getItemSelected == -1) then guiSetText(TotalPrice.Label.BuyingWNDManager, "") guiSetText(PlayerSerial.Label.BuyingWNDManager, "") guiSetText(cardType.Label.ManagerBuyWND, "") guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) end end end ) addEventHandler( 'onClientGUIClick', root, function() if (source == Players.GridList.BuyingWNDManager) then local getItemSelected = guiGridListGetSelectedItem(Players.GridList.BuyingWNDManager) if (getItemSelected ~= -1) then local SERIAL_ = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 1) local PRICE_ = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 3) guiSetText(TotalPrice.Label.BuyingWNDManager, PRICE_) guiSetText(PlayerSerial.Label.BuyingWNDManager, SERIAL_) guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) local ID = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 2) triggerServerEvent( 'getCARDS', localPlayer, SERIAL_, ID) end elseif (source == X.Button.BuyingWNDManager) then guiSetVisible(BuyingManager.BuyingWNDManager, false) showCursor(false) end end ) function openBuyWNDmanager() if (not Access[getPlayerSerial(source)]) then outputChatBox("* ERROR : #FFFFFF Access denied !", 255, 0, 0, true) return end if (guiGetVisible(BuyingManager.BuyingWNDManager) == false) then guiSetVisible(BuyingManager.BuyingWNDManager, true) showCursor(true) else guiSetVisible(BuyingManager.BuyingWNDManager, false) showCursor(false) end end كلنت - addEventHandler( 'onClientGUIClick', root, function() if (source == DeleteAll.Button.BuyingWNDManager) then local getItemSelected = guiGridListGetSelectedItem(Players.GridList.BuyingWNDManager) if (getItemSelected == -1) then outputChatBox( '* خطأ : #FFFFFF لم تقم بتحديد مشتري من القائمة !', 255, 0, 0, true) return end local SERIAL_ = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 1) local ID = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 2) triggerServerEvent( 'removeUSERfromBuyWindow', localPlayer, SERIAL_, ID) guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) guiSetText(TotalPrice.Label.BuyingWNDManager, "") guiSetText(PlayerSerial.Label.BuyingWNDManager, "") guiSetText(cardType.Label.ManagerBuyWND, "") guiSetEnabled(DeleteAll.Button.BuyingWNDManager, false) setTimer(guiSetEnabled, 5000, 1, DeleteAll.Button.BuyingWNDManager, true) elseif (source == CopySerial.Button.BuyingWNDManager) then local getAccountName = guiGetText(PlayerSerial.Label.BuyingWNDManager) if (getAccountName == "") then outputChatBox( '* خطأ : #FFFFFF لا يوجد سيريال لتقوم بنسخه !', 255, 0, 0, true) return end setClipboard(getAccountName) guiSetEnabled(CopySerial.Button.BuyingWNDManager, false) setTimer(guiSetEnabled, 5000, 1, CopySerial.Button.BuyingWNDManager, true) outputChatBox('* إدارة المشتريات : #FFFFFF تم نسخ سيريال المشتري بنجاح !', 0, 255, 0, true) end end ) addEvent( 'UPDATEGRIDLIST', true ) addEventHandler( 'UPDATEGRIDLIST', root, function() guiGridListClear(Players.GridList.BuyingWNDManager) triggerServerEvent( 'putPlayers', localPlayer ) end ) function putPlayersBought(SQL) guiGridListClear(Players.GridList.BuyingWNDManager) for i, _ in ipairs(SQL) do local player_ = guiGridListAddRow(Players.GridList.BuyingWNDManager) local text1 = guiGridListSetItemText(Players.GridList.BuyingWNDManager, player_, 1, SQL[i].userName, false, false) local text2 = guiGridListSetItemText(Players.GridList.BuyingWNDManager, player_, 2, SQL[i].boughtType, false, false) local text4 = guiGridListSetItemText(Players.GridList.BuyingWNDManager, player_, 3, SQL[i].boughtPlan, false, false) local Data1 = guiGridListSetItemData(Players.GridList.BuyingWNDManager, player_, 1, SQL[i].userSerial) local data3 = guiGridListSetItemData(Players.GridList.BuyingWNDManager, player_, 3, SQL[i].boughtPrice) local id = guiGridListSetItemData(Players.GridList.BuyingWNDManager, player_, 2, SQL[i].userID) guiGridListSetItemColor(Players.GridList.BuyingWNDManager, player_, 1, 255, 0, 0) guiGridListSetItemColor(Players.GridList.BuyingWNDManager, player_, 2, 255, 255, 0) guiGridListSetItemColor(Players.GridList.BuyingWNDManager, player_, 3, 0, 255, 0) end end addEvent( 'PutPlayersInList', true ) addEventHandler( 'PutPlayersInList', root, putPlayersBought) addEventHandler( 'onClientResourceStart', resourceRoot, function() triggerServerEvent( 'putPlayers', localPlayer ) end ) addEvent( 'putNUMBERS', true ) addEventHandler( 'putNUMBERS', root, function(CARDtype_, CARD1_, CARD2_, CARD3_, CARD4_, CARD5_, CARD6_) guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) Row1 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) Row2 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) Row3 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) Row4 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) Row5 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) Row6 = guiGridListAddRow(CardsNumbers.GridList.BuyingWNDManager) if (Row1) and (CARD1_ ~= "") then local text1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row1, 2, CARD1_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row1, 2, 0, 255, 0) end if (Row2) and (CARD2_ ~= "") then local text2 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row2, 2, CARD2_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row2, 2, 0, 255, 0) end if (Row3) and (CARD3_ ~= "") then local text3 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row3, 2, CARD3_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row3, 2, 0, 255, 0) end if (Row4) and (CARD4_ ~= "") then local text4 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row4, 2, CARD4_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row4, 2, 0, 255, 0) end if (Row5) and (CARD5_ ~= "") then local text5 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row5, 2, CARD5_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row5, 2, 0, 255, 0) end if (Row6) and (CARD6_ ~= "") then local text6 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row6, 2, CARD6_, false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row6, 2, 0, 255, 0) end if (Row1) and (CARD1_ ~= "") then local text1C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row1, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row1, 1, 255, 0, 0) end if (Row2) and (CARD2_ ~= "") then local text2C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row2, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row2, 1, 255, 0, 0) end if (Row3) and (CARD3_ ~= "") then local text3C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row3, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row3, 1, 255, 0, 0) end if (Row4) and (CARD4_ ~= "") then local text4C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row4, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row4, 1, 255, 0, 0) end if (Row5) and (CARD5_ ~= "") then local text5C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row5, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row5, 1, 255, 0, 0) end if (Row6) and (CARD6_ ~= "") then local text6C1 = guiGridListSetItemText(CardsNumbers.GridList.BuyingWNDManager, Row6, 1, "-", false, false) guiGridListSetItemColor(CardsNumbers.GridList.BuyingWNDManager, Row6, 1, 255, 0, 0) end guiSetText(cardType.Label.ManagerBuyWND, CARDtype_) end ) addEventHandler( 'onClientGUIClick', root, function() if (source == Players.GridList.BuyingWNDManager) then local getItemSelected = guiGridListGetSelectedItem(Players.GridList.BuyingWNDManager) if (getItemSelected == -1) then guiSetText(TotalPrice.Label.BuyingWNDManager, "") guiSetText(PlayerSerial.Label.BuyingWNDManager, "") guiSetText(cardType.Label.ManagerBuyWND, "") guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) end end end ) addEventHandler( 'onClientGUIClick', root, function() if (source == Players.GridList.BuyingWNDManager) then local getItemSelected = guiGridListGetSelectedItem(Players.GridList.BuyingWNDManager) if (getItemSelected ~= -1) then local SERIAL_ = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 1) local PRICE_ = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 3) guiSetText(TotalPrice.Label.BuyingWNDManager, PRICE_) guiSetText(PlayerSerial.Label.BuyingWNDManager, SERIAL_) guiGridListClear(CardsNumbers.GridList.BuyingWNDManager) local ID = guiGridListGetItemData(Players.GridList.BuyingWNDManager, getItemSelected, 2) triggerServerEvent( 'getCARDS', localPlayer, SERIAL_, ID) end elseif (source == X.Button.BuyingWNDManager) then guiSetVisible(BuyingManager.BuyingWNDManager, false) showCursor(false) end end ) function openBuyWNDmanager() if (not Access[getPlayerSerial(source)]) then outputChatBox("* ERROR : #FFFFFF Access denied !", 255, 0, 0, true) return end if (guiGetVisible(BuyingManager.BuyingWNDManager) == false) then guiSetVisible(BuyingManager.BuyingWNDManager, true) showCursor(true) else guiSetVisible(BuyingManager.BuyingWNDManager, false) showCursor(false) end end Link to comment
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