Doffy Posted June 29, 2018 Share Posted June 29, 2018 السلام عليكم ورحمة الله وبركاته حبيت استفسر عن شي في الجداول وانا اسوي لوحة الادمن في اعطاء مركبة allVehicleIDS = {400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611 } for i,v in ipairs(allVehicleIDS) do local row = guiGridListAddRow(vehiclelist) guiGridListSetItemText(vehiclelist, row, 1, getVehicleNameFromID(v), false, false) guiGridListSetItemColor(vehiclelist, row, 1, math.random(0,255), math.random(0,255), math.random(0,255), 255) guiGridListSetItemData(vehiclelist, row, 1, v) end كل ما اجي اعطي مركبة يعطيني سيارة وحدا اسمها Landstalker وما يعطيني غيرها حتي لما احدد سيارة ثانية Link to comment
Doffy Posted June 29, 2018 Author Share Posted June 29, 2018 Just now, Abdul KariM said: حط كود التحديد ع القريد addEventHandler("onClientGUIClick",root, function( ) if ( source == giveveh ) then local sel = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if sel ~= -1 then local playerName = guiGridListGetItemText(GUIEditor.gridlist[1], sel, 1) local plr = getPlayerFromName(playerName) local x,y,z = getElementPosition(plr) local IDveh = guiGridListGetItemData(vehiclelist, sel, 1) triggerServerEvent("onAdminGiveVehicle", localPlayer, playerName, IDveh,x,y,z) end end end ) Link to comment
Abdul KariM Posted June 29, 2018 Share Posted June 29, 2018 addEventHandler("onClientGUIClick",root, function( ) if ( source == giveveh ) then local sel = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if sel ~= -1 then local playerName = guiGridListGetItemText(GUIEditor.gridlist[1], sel, 1) local plr = getPlayerFromName(playerName) local x,y,z = getElementPosition(plr) local sel2 = guiGridListGetSelectedItem(vehiclelist) if sel2 ~= -1 then local IDveh = guiGridListGetItemData(vehiclelist, sel2, 1) triggerServerEvent("onAdminGiveVehicle", localPlayer, playerName, IDveh,x,y,z) end end end end ) احسن من انك تحط داتا ع القريد ليست getVehicleIDFromName تقدر تستخدم 1 Link to comment
Doffy Posted June 29, 2018 Author Share Posted June 29, 2018 2 minutes ago, Abdul KariM said: addEventHandler("onClientGUIClick",root, function( ) if ( source == giveveh ) then local sel = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if sel ~= -1 then local playerName = guiGridListGetItemText(GUIEditor.gridlist[1], sel, 1) local plr = getPlayerFromName(playerName) local x,y,z = getElementPosition(plr) local sel2 = guiGridListGetSelectedItem(vehiclelist) if sel2 ~= -1 then local IDveh = guiGridListGetItemData(vehiclelist, sel2, 1) triggerServerEvent("onAdminGiveVehicle", localPlayer, playerName, IDveh,x,y,z) end end end end ) احسن من انك تحط داتا ع القريد ليست getVehicleIDFromName تقدر تستخدم مشكور اشتغل Link to comment
Rockyz Posted June 29, 2018 Share Posted June 29, 2018 كنت تقدر تختصر الجدول حقك كذا : for i = 411, 611 do 1 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