-
Posts
3,267 -
Joined
-
Last visited
-
Days Won
7
Everything posted by Tete omar
-
انظر على المثال guiGridListGetItemData : function clientsideResourceStart () local numberList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) local column = guiGridListAddColumn ( numberList, "Column Title", 0.85 ) if ( column ) then local row = guiGridListAddRow ( numberList ) local myItem = guiGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ^ 100 ), false, false ) local myItemData = guiGridListGetItemData ( numberList, row, column ) outputChatBox ( "My gridlist item data: " .. myItemData ) end end addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart ) guiGridListSetItemData: function showPlayers() local window = guiCreateWindow(0,0,500,400,"Window example - Title",false) -- Create the window grid = guiCreateGridList(0,0,100,300,false,window) -- Create the gridlist local column = guiGridListAddColumn(grid, "Players online", 0.9) -- Create a column showCursor(true)--show cursor for index,player in ipairs(getElementsByType("player")) do -- Loop through all players local row = guiGridListAddRow(grid) -- Add a row guiGridListSetItemText ( grid, row, column, (string.gsub ( getPlayerName(player), '#%x%x%x%x%x%x', '' ) or getPlayerName(player)), false, false) -- Set it's text to the player's name excluding colorcodes guiGridListSetItemData ( grid, row, column, getPlayerName(player)) -- Set it's data to the player's name with colorcodes end end function outputPlayerName() if source == grid then -- If the player clicked something in the grid local selectedRow, selectedColumn = guiGridListGetSelectedItem(grid) -- See which player he selected local playerName = guiGridListGetItemData(grid, selectedRow, selectedColumn) -- Get the selected player's name with color codes local playerNameWithoutColorCodes = guiGridListGetItemText(grid, selectedRow, selectedColumn) -- Get the selected player's name without color codes local playerNameWithoutColorCodes = guiGridListGetItemText(grid, selectedRow, selectedColumn) -- Get the selected player's name without color codes if playerName and playerNameWithoutColorCodes then -- If he really selected something outputChatBox("The selected player's name without color codes : "..playerNameWithoutColorCodes, 255,255,255,false) -- output without color codes outputChatBox("The selected player's name with color codes : "..playerName, 255,255,255,false) -- output with color codes outputChatBox("The selected player's name with colors : "..playerName, 255,255,255,true) -- output with colors end end end addEventHandler("onClientGUIClick", getRootElement(), outputPlayerName) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), showPlayers)
-
جربت الكود لقيت كلام الاخ تابل صحيح عدلته ودوبي حاطه
-
التصحيح GUIEditor_Window = {} GUIEditor_Grid = {} local rows = {} GUIEditor_Window[1] = guiCreateWindow(269,161,259,296,"",false) GUIEditor_Grid[1] = guiCreateGridList(9,26,241,250,false,GUIEditor_Window[1]) guiGridListAddColumn(GUIEditor_Grid[1],"skin",0.2) rows.skin1 = guiGridListAddRow(GUIEditor_Grid[1]) rows.skin2 = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListSetItemText(GUIEditor_Grid[1],rows.skin1,1,"Skin 1",false,false) guiGridListSetItemText(GUIEditor_Grid[1],rows.skin2,1,"Skin 2",false,false) local skins = { ["Skin 1"] = 1, ["Skin 2"] = 2 } addEventHandler("onClientGUIClick", GUIEditor_Grid[1], function() for i, v in pairs( rows ) do if( guiGridListGetSelectedItem(source) == v )then local itemName = guiGridListGetItemText(GUIEditor_Grid[1], guiGridListGetSelectedItem(source), 1) if(skins[ itemName ])then triggerServerEvent("settingModel", localPlayer, skins[ itemName ]) end end end end ) Client
-
ERROR: window\cleint.lua:4: attempt to call global 'guiCreateWindow' (a nil value) انت حاط الكود بملف السيرفر حطه بملف الكلنت
-
GUIEditor_Window = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(269,161,259,296,"",false) GUIEditor_Grid[1] = guiCreateGridList(9,26,241,250,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) local rows = {} rows.skin1 = guiGridListAddRow(GUIEditor_Grid[1]) rows.skin2 = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1],rows.skin1,1,"Skin 1",false,false) guiGridListSetItemText(GUIEditor_Grid[1],rows.skin2,1,"Skin 2",false,false) guiGridListAddColumn(GUIEditor_Grid[1],"skin",0.2) local skins = { ["Skin 1"] = 1, ["Skin 2"] = 2 } addEventHandler("onClientGUIClick", GUIEditor_Grid[1], function() for i, v in pairs( rows ) do if( source == v )then local itemName = guiGridListGetItemText(GUIEditor_Grid[1], source, 1) if(skins[ itemName ])then triggerServerEvent("settingModel", localPlayer, skins[ itemName ]) end end end end ) local marker = createMarker ( 0, 0, 2, "cylinder", 1.5, 255, 255, 0, 170 ) addEventHandler("onClientMarkerHit", marker, function(hitElement) if( hitElement == localPlayer )then showCursor(true) guiSetVisible( GUIEditor_Window[1], true ) end end )
-
كلنت GUIEditor_Window = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(269,161,259,296,"",false) GUIEditor_Grid[1] = guiCreateGridList(9,26,241,250,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) local rows = {} rows.skin1 = guiGridListAddRow(GUIEditor_Grid[1]) rows.skin2 = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1],rows.skin1,1,"Skin 1",false,false) guiGridListSetItemText(GUIEditor_Grid[1],rows.skin2,1,"Skin 2",false,false) guiGridListAddColumn(GUIEditor_Grid[1],"skin",0.2) local skins = {["Skin 1"] = 1 ["Skin 2"] = 2} addEventHandler("onClientGUIClick", GUIEditor_Grid[1], function() for i, v in pairs( rows ) do if( source == v )then local itemName = guiGridListGetItemText(GUIEditor_Grid[1], source, 1) if(skins[ itemName ])then triggerServerEvent("settingModel", localPlayer, skins[ itemName ]) end end end end ) سيرفر addEvent("settingModel", true) addEventHandler("settingModel", root, function(model) setElementModel(client, model) end ) اذا تبي اي شرح للكود انا في الخدمة ثانياً انت ماكنت حاط اسم للرو , مما يعني ان الرو ماراح تكون موجودة مثل ما قال الويكي ATTENTION: Without guiGridListSetItemText there is no row added to the grid في guiGridListAddRow
-
الحين تبي اذا ضغط على الرو ولا اذا ضغط على زر وهو مأشر على رو يصير كل شي ؟
-
استخدم guiCreateGridList -- لصنع قريد لست guiGridListAddColumn -- لإضافة عامود guiGridListAddRow -- لأضافة رو داخل القرد لست تحت العامود المحدد
-
بس هو لسة يتعلم , يتعلم بعدين هو يسوي بنفسه
-
playSound("اسم ملف الصوت ومكانه بالسكربت") مثلاً playSound("sound.mp3") أو playSound("sounds/sound.mp3") اذا كان فيه مجلد اسمه sounds وانت حاط فيه ملف sound.mp3
-
حسن , اشرح الاختبار بالعربي وقولي وش آخرته أو وش يسوي
-
Your choice.. , anyway ur welcome.
-
I know , but i implied that if he needs to use addCommandHandler client side, he'll have to and same thing server side...
-
Of course , and same thing client side.
-
or he can simply do it client side , it'll output this message too without needing of 'thePlayer' argument unless he wants to do something that can't be in the client side and vice versa.
-
Make an increasable variable , and start to count.
-
لبي المبرمج الامريكي الخطير بس
-
الرجال توه مبتدئ وانت عاطيه وظيفة يستخدمها وهو ما يعرف وش أساسيات البرمجة :\ والله يوفق الجميع ..
-
الويكي العربي ما انحذف https://wiki.multitheftauto.com/wiki/AR/ ... 8%AC%D9%87
-
افصللكك نظآرآت ولا بتفصل بروحك ! فصلها لنفسك
-
لا حاول ولا قوة إلا بالله .. , ياخي لا تذكرنا بالماضي