
Dr.Xen
Members-
Posts
412 -
Joined
-
Last visited
Everything posted by Dr.Xen
-
السلام عليكم ورحمة الله وبركاته .. ممكن تعديل على الكود local groupName = 'SWAT' local sx, sy = guiGetScreenSize() mainWindow = guiCreateWindow((sx-438)/2, (sy-487)/2, 438, 487, "[MFA] Vehicles", false) guiWindowSetSizable(mainWindow, false) guiSetAlpha(mainWindow, 1.00) guiSetVisible(mainWindow, false) mainTab = guiCreateTabPanel(0.02, 0.04, 0.96, 0.90, true, mainWindow) local vehicles = { cars = { tab = guiCreateTab("Cars", mainTab), list = { {"Police Ranger", 599}, {"Police LV", 598}, {"Police SF", 597}, {"FBI Truck", 528}, {"Sultan", 560}, {"Flash", 565}, {"Infernus", 411} } }, bikes = { tab = guiCreateTab("Bikes", mainTab), list = { {"BF-400", 581}, {"FCR-900", 521}, {"NRG-511", 522}, {"PCJ-600", 461}, {"Sanchez", 468} } }, planes = { tab = guiCreateTab("Planes", mainTab), list = { {"Police Maverick", 497}, {"Cargobob", 548}, {"Seasparrow", 447}, {"News Chopper", 488} } } } vehicles.cars.gridlist = guiCreateGridList(0.05, 0.02, 0.89, 0.95, true, vehicles.cars.tab) table.insert(vehicles.cars, guiGridListAddColumn(vehicles.cars.gridlist, "Cars", 0.9)) vehicles.bikes.gridlist = guiCreateGridList(0.05, 0.02, 0.89, 0.95, true, vehicles.bikes.tab) table.insert(vehicles.bikes, guiGridListAddColumn(vehicles.bikes.gridlist, "Bikes", 0.9)) vehicles.planes.gridlist = guiCreateGridList(0.05, 0.02, 0.89, 0.95, true, vehicles.planes.tab) table.insert(vehicles.planes, guiGridListAddColumn(vehicles.planes.gridlist, "Planes", 0.9)) notice = guiCreateLabel(0.02, 0.94, 0.96, 0.03, "Press (Enter) to select your vehicle>اختر السيارة ثم اضغط انتر", true, mainWindow) guiLabelSetColor(notice, 255, 255, 0) guiLabelSetHorizontalAlign(notice, "center", false) guiLabelSetVerticalAlign(notice, "center") for i,v in pairs(vehicles) do for _,k in ipairs(v.list) do local row = guiGridListAddRow(v.gridlist) guiGridListSetItemText(v.gridlist, row, v[1], k[1], false, false) end end local vehiclesMarker = createColSphere(1217,-1657.1999511719,10.5, 2) createMarker(1217,-1657.1999511719,10.5,"cylinder",2,88,202,52,255) addEventHandler("onClientColShapeHit", vehiclesMarker, function(hitElement) if hitElement == localPlayer and getElementData(hitElement, "Group") == groupName and not isPedInVehicle(hitElement) then guiSetVisible(mainWindow, true) showCursor(true) bindKey("enter", "down", selectVehicle) end end,false ) addEventHandler("onClientColShapeLeave", vehiclesMarker, function(leaveElement) if leaveElement == localPlayer and getElementData(leaveElement, "Group") == groupName and not isPedInVehicle(leaveElement) then guiSetVisible(mainWindow, false) showCursor(false) unbindKey("enter", "down", selectVehicle) end end, false ) function selectVehicle() for i,v in pairs(vehicles) do local tab = v.tab if guiGetSelectedTab(mainTab) == tab then local gridlist = v.gridlist if guiGridListGetSelectedItem(gridlist) ~= -1 then local row = guiGridListGetSelectedItem(gridlist) local vehName = guiGridListGetItemText(gridlist, row, v[1]) for _,k in ipairs(v.list) do if k[1] == vehName then if i == "planes" then triggerServerEvent("spawningVehicle", localPlayer, k[2], true) else triggerServerEvent("spawningVehicle", localPlayer, k[2], false) end unbindKey("enter", "down", selectVehicle) break end end guiSetVisible(mainWindow, false) showCursor(false) break end end end end فقط لتيم الإسعاف ممب للقروب
-
السلام عليكم ورحمة الله وبركاته ! ابيكم تعدلو على الكود كود ذا في قيم مود Server: ابيكم تخلو شخصية 285 خاصة لقروب يعني لو دخل السيرفر وسجل وخلص يختار الشخصية اذا اختار 285 وهو من القروب يقدر واذا مو من القروب ما يقدر يأخذ يطلع كلأم بالشات Server:" rRoot = getResourceRootElement(getThisResource()) local root = getRootElement() local Key = "F4" Teams = { -- here all team name {"Grove", 0, 255, 0}, {"Aztecas", 0, 150, 255}, {"Police", 0, 50, 255}, {"Ballas", 255, 0, 150}, {"No Team", 255, 255, 255}, {"Medic", 6, 183, 248} } local function set(plr, data, bole) if not isElement(plr) then return end return setElementData(plr, data, bole) end local function get(plr, data) if not isElement(plr) then return end return getElementData(plr, data) end addEventHandler("onResourceStart", resourceRoot, function() setGameType("Gang Wars") outputChatBox(".:[ ?_? ]:. " .. ver .. "", root, 0, 255, 0, true) setTimer(OutPut, 50, 1, ".:[ Server GTA-Ar TuNiSiE" .. ver .. "", root, 0, 255, 0) for _,theTeam in ipairs(Teams) do createTeam(theTeam[1], theTeam[2], theTeam[3], theTeam[4]) end for _,AllTeams in ipairs(getElementsByType("team")) do if getTeamFriendlyFire(AllTeams) == true then setTeamFriendlyFire(AllTeams, false) end end setTeamFriendlyFire(getTeamFromName("No Team"), true) for i,v in ipairs(getElementsByType("player")) do bindKey(v, Key, "down", "changeTeame") setElementData(v, "OnJoinFirstSpawn", false) end setElementData(rRoot,"maxPlayer",getMaxPlayers()) end ) addEventHandler("onResourceStop", resourceRoot, function() local players = getElementsByType("player") for k,v in ipairs(players) do set(v, "hjwalah", false) set(v, "Grove", false) set(v, "Aztecs", false) set(v, "Police", false) set(v, "Ballas", false) set(v, "noTeam", false) set(v, "Medic", false) set(v, "GameModeActive", false) end end ) addEvent("onLoadedClient", true) addEventHandler("onLoadedClient", root, function(player) versionDisplay = textCreateDisplay() textDisplayAddText(versionDisplay, versionText) textDisplayAddObserver(versionDisplay, player) setElementData(player, "CancleFirstSpawn", true) playSoundFrontEnd(player, 16) setElementData(player, "OnJoinFirstSpawn", false) end ) addEventHandler("onPlayerJoin", root, function() showTextForPlayer ( source, 6000, 255, 0, 0, 1.5, "welcome to server GTA-AR_TuNiSiE ") showTextForPlayer1 ( source, 6000, 255, 0, 0, 1.5, "الرجآء الأنتظار حتى يتم تحميل المودات....!") setCameraMatrix(source,512.2, -1263.57, 32.53,542.16, -1287.07, 17.24) end ) addEventHandler("onPlayerSpawn", root, function() checkWeapon(source) end ) function checkWeapon(player) setTimer(function(player) if isElement(player) then if getElementData(player, "Police") == true then giveWeapon(player, 3) end else takeWeapon(player, 3) end end, 800, 1, player) end addEvent("onClientWantsToSpawn", true) addEventHandler("onClientWantsToSpawn", getRootElement(), function(player, ID, TeamName) if TeamName == "Grove" then setElementData(player, "ID", ID) GroveTeam(player) elseif TeamName == "Aztecas" then setElementData(player, "ID", ID) AztecsTeam(player) elseif TeamName == "Police" then setElementData(player, "ID", ID) PoliceTeam(player) elseif TeamName == "Ballas" then setElementData(player, "ID", ID) Ballas(player) elseif TeamName == "No Team" then setElementData(player, "ID", ID) NoTeam(player) elseif TeamName == "Medic" then setElementData(player, "ID", ID) MedicTeam(player) elseif TeamName == "Drift" then setElementData(player, "ID", ID) hjwalah(player) end end ) function checkWeapon(player) setTimer(function(player) if isElement(player) then if getElementData(player, "Police") == true then giveWeapon(player, 3) end else takeWeapon(player, 3) end end, 800, 2, player) end function onSelectTeam(player) if not isElement(player) then return end local playerTeam = getPlayerTeam(player) showTextForPlayer(player, 5000, 255, 0, 0, 1.5, "You have been assigned to team [" .. tostring(getTeamName(playerTeam)) .. "]") OutPut("To return to spawn press["..Key.."]", player, 255, 255, 255) local playeraccount = getPlayerAccount(player) if playeraccount and not isGuestAccount(getPlayerAccount(player)) then if getElementData(player, "hjwalah") == true then return false end if getElementData(player, "wasgied") == true then return false end setElementData(player, "wasgied", true) local weap0 = getAccountData(playeraccount, "s.weap0") local weap1 = getAccountData(playeraccount, "s.weap1") local weap2 = getAccountData(playeraccount, "s.weap2") local ammo2 = getAccountData(playeraccount, "s.ammo2") local weap3 = getAccountData(playeraccount, "s.weap3") local ammo3 = getAccountData(playeraccount, "s.ammo3") local weap4 = getAccountData(playeraccount, "s.weap4") local ammo4 = getAccountData(playeraccount, "s.ammo4") local weap5 = getAccountData(playeraccount, "s.weap5") local ammo5 = getAccountData(playeraccount, "s.ammo5") local weap6 = getAccountData(playeraccount, "s.weap6") local ammo6 = getAccountData(playeraccount, "s.ammo6") local weap7 = getAccountData(playeraccount, "s.weap7") local ammo7 = getAccountData(playeraccount, "s.ammo7") local weap8 = getAccountData(playeraccount, "s.weap8") local ammo8 = getAccountData(playeraccount, "s.ammo8") local weap9 = getAccountData(playeraccount, "s.weap9") local ammo9 = getAccountData(playeraccount, "s.ammo9") local weap10 = getAccountData(playeraccount, "s.weap10") local weap11 = getAccountData(playeraccount, "s.weap11") local weap12 = getAccountData(playeraccount, "s.weap12") local wanted = getAccountData(playeraccount, "WantedLevel") if tonumber(wanted) then setPlayerWantedLevel(player, wanted) elseif tonumber(weap0) then giveWeapon(player, weap0, 1) elseif tonumber(weap1) then giveWeapon(player, weap1, 1) elseif tonumber(weap2) and tonumber(ammo2) then giveWeapon(player, weap2, ammo2) elseif tonumber(weap3) and tonumber(ammo3) then giveWeapon(player, weap3, ammo3) elseif tonumber(weap4) and tonumber(ammo4) then giveWeapon(player, weap4, ammo4) elseif tonumber(weap6) and tonumber(ammo5) then giveWeapon(player, weap5, ammo5) elseif tonumber(weap6) and tonumber(ammo6) then giveWeapon(player, weap6, ammo6) elseif tonumber(weap7) and tonumber(ammo7) then giveWeapon(player, weap7, ammo7) elseif tonumber(weap8) and tonumber(ammo8) then giveWeapon(player, weap8, ammo8) elseif tonumber(weap9) and tonumber(ammo9) then giveWeapon(player, weap9, ammo9) elseif tonumber(weap10) then giveWeapon(player, weap10, 30) elseif tonumber(weap11) then giveWeapon(player, weap11, 30) elseif tonumber(weap12) then giveWeapon(player, weap12, 10) end end end function camera(plr) if not isElement(plr) then return end setTimer(fadeCamera, 50, 1, plr, false, 1) setTimer(fadeCamera, 100, 1, plr, true, 3) setCameraTarget(plr, plr) showChat(plr, true) end addEventHandler("onPlayerSpawn", root, function() setElementData(source, "FristTimeSpawn", false) bindKey(source, Key, "down", "changeTeame") setElementData(source, "WasChangeTeam", false) end ) Change = false addCommandHandler("changeTeame", function(plr) if getElementData(plr, "WasChangeTeam") == false then setElementData(plr, "ChangeTeam", true) OutPut("The team will change after you die", plr, 255, 0, 255) setTimer(cancleTeam, 1700, 1, plr) setElementData(plr, "WasChangeTeam", true) else OutPut("Change the team has been canceled", plr, 255, 255, 0) setElementData(plr, "ChangeTeam", false) setElementData(plr, "WasChangeTeam", false) end Change = not Change end ) function cancleTeam(plr) if Change == false then return false end OutPut("To cancel the change team press again", plr, 255, 255, 0) end function GroveTeam(plr) if not isElement(plr) then return
-
السلام عليكم ورحمة الله وبركاته انا عندي خراب بالكود لو اختار سيارة يطلع لي ثنتين ابي وحده تطلع GUIEditor_Window = {} GUIEditor_Marker = {} GUIEditor_Button = {} GUIEditor_Grid = {} vehicleId = {429,411,560,541,431,451,562,482,409,471,522,463,561,434,487,469,548,} GUIEditor_Marker[1] = createMarker( 1415.5999755859,541.90002441406,10, 'cylinder', 1.5, 0, 0, 255, 255 ) GUIEditor_Marker[2] = createMarker( 1420.8000488281,541.20001220703,10, 'cylinder', 1.5, 0, 0, 255, 255 ) GUIEditor_Marker[3] = createMarker( 1426.5,540.5,10, 'cylinder', 1.5, 0, 0, 255, 255 ) local group1 = '[MFA]' local group2 = 'SyR' local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(x/2,y/2,208,321,"Select Vehicle",false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(10,25,184,244,false,GUIEditor_Window[1]) column = guiGridListAddColumn( GUIEditor_Grid[1], 'Vehice Name', 0.80 ) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Button[1] = guiCreateButton(12,277,87,30,"Close",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(107,277,87,30,"Take Vehicle",false,GUIEditor_Window[1]) guiSetVisible(GUIEditor_Window[1],false) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromID( id ), false, false ) end addEventHandler ("onClientMarkerHit", root, function( player ) if getElementData ( player , "Group" ) == group1 and not isPedInVehicle( player ) and player == localPlayer or getElementData ( player , "Group" ) == group2 and not isPedInVehicle( player ) and player == localPlayer then for i,v in ipairs( GUIEditor_Marker ) do if ( source == v ) then x999,y999,z999 = getElementPosition( localPlayer ) if z999 < 13.1 and z999 < 11.1 then setPedFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end end end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setPedFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoa', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setPedFrozen ( localPlayer, false ) showCursor( false ) end end ) AircraftIdSpawn = { { 1430.9000244141,596.09997558594,14 }, } local base = createBlip (1386.28809,583.47192,10.91094,23) setBlipVisibleDistance (base, 23) local group1 = '[MFA]' local group2 = 'SyR' output = function( text, element, r, g, b, vaule ) exports["guimessages"]:outputServer(element, text, r, g, b) end function start() end addEventHandler('onResourceStart', resourceRoot, start) function mm() end onAbadyWasted = function() if getElementData ( source , "Group" ) == groupName then function sp( source ) setElementPosition( source, 1384.70386,548.67749,1008.09998 ) setElementInterior ( source, 0 ) setElementDimension ( source, 0 ) setPedArmor( hPlayer, 200 ) setElementHealth( hPlayer, 200 ) setPedSkin( source, 230 ) setPedArmor( source, 100 ) end setTimer(sp,1000,1,source) end end addEventHandler ( "onPlayerSpawn", getRootElement(), onAbadyWasted ) TableCars = {} addEvent('gvoa', true) addEventHandler('gvoa', root, function( nameCar ) if isElement( TableCars[source] ) then destroyElement( TableCars[source] ) end local id = getVehicleIDFromName( nameCar ) if id == 487 or id == 425 or id == 548 or id == 520 or id == 469 then local x, y, z = unpack( AircraftIdSpawn[math.random(#AircraftIdSpawn)] ) TableCars[source] = createVehicle( id, x, y, z ) if not TableCars[source] then return end warpPedIntoVehicle ( source, TableCars[source] ) return end local x,y,z = getElementPosition( source ) TableCars[source] = createVehicle( id, x, y, z ) if not TableCars[source] then return end warpPedIntoVehicle ( source, TableCars[source] ) addVehicleUpgrade(TableCars[source], 1147) addVehicleUpgrade(TableCars[source], 1041) addVehicleUpgrade(TableCars[source], 1035) addVehicleUpgrade(TableCars[source], 1010) addVehicleUpgrade(TableCars[source], 1087) addVehicleUpgrade(TableCars[source], 1171) addVehicleUpgrade(TableCars[source], 1149) setVehiclePaintjob(TableCars[source], 1) end ) addEventHandler('onPlayerQuit', root, function() if isElement( TableCars[source] ) then destroyElement( TableCars[source] ) end end ) addEventHandler( "onVehicleStartEnter", resourceRoot, function(thepla) if getElementData( thepla, 'Group' ) == group1 or getElementData( thepla, 'Group' ) == group2 then outputChatBox( "** Welcome To Groups Car", thepla, 255, 0, 0, true ) else cancelEvent( ) outputChatBox( "** This Vehicle For Group [ [MFA] ]", thepla, 255, 0, 0, true ) end end )
-
السلام عليكم ورحمة الله وبركاته اانا عندي ماركر اختيار مواتر بس لو غيرت الإحداثيات ما تطلع اللوحة ذذا ما غيرت الاحداثيات Clinet local groupName = '[MFA]' local sx, sy = guiGetScreenSize() mainWindow = guiCreateWindow((sx-438)/2, (sy-487)/2, 438, 487, "[MFA] Vehicles", false) guiWindowSetSizable(mainWindow, false) guiSetAlpha(mainWindow, 1.00) guiSetVisible(mainWindow, false) mainTab = guiCreateTabPanel(0.02, 0.04, 0.96, 0.90, true, mainWindow) local vehicles = { cars = { tab = guiCreateTab("Cars", mainTab), list = { {"Cheetah", 415}, {"Bullet", 541}, {"Infernus", 411}, {"Sultan", 560}, {"Turismo", 451}, {"Comet", 480}, {"Huntley", 579}, {"Flash", 565}, {"Bandito", 568} } }, bikes = { tab = guiCreateTab("Bikes", mainTab), list = { {"BF-400", 581}, {"FCR-900", 521}, {"NRG-511", 522}, {"PCJ-600", 461}, {"Sanchez", 468} } }, planes = { tab = guiCreateTab("Planes", mainTab), list = { {"Sparrow", 469}, {"Maverick", 487} } } } vehicles.cars.gridlist = guiCreateGridList(0.05, 0.02, 0.89, 0.95, true, vehicles.cars.tab) table.insert(vehicles.cars, guiGridListAddColumn(vehicles.cars.gridlist, "Cars", 0.9)) vehicles.bikes.gridlist = guiCreateGridList(0.05, 0.02, 0.89, 0.95, true, vehicles.bikes.tab) table.insert(vehicles.bikes, guiGridListAddColumn(vehicles.bikes.gridlist, "Bikes", 0.9)) vehicles.planes.gridlist = guiCreateGridList(0.05, 0.02, 0.89, 0.95, true, vehicles.planes.tab) table.insert(vehicles.planes, guiGridListAddColumn(vehicles.planes.gridlist, "Planes", 0.9)) notice = guiCreateLabel(0.02, 0.94, 0.96, 0.03, "Press (Enter) to select your vehicle", true, mainWindow) guiLabelSetColor(notice, 255, 255, 0) guiLabelSetHorizontalAlign(notice, "center", false) guiLabelSetVerticalAlign(notice, "center") for i,v in pairs(vehicles) do for _,k in ipairs(v.list) do local row = guiGridListAddRow(v.gridlist) guiGridListSetItemText(v.gridlist, row, v[1], k[1], false, false) end end local vehiclesMarker = createColSphere(3162,870.5,6.8, 1) createMarker(3162,870.5,6.8,"cylinder",2,0,255,0,255) addEventHandler("onClientColShapeHit", vehiclesMarker, function(hitElement) if hitElement == localPlayer and getElementData(hitElement, "Group") == groupName and not isPedInVehicle(hitElement) then guiSetVisible(mainWindow, true) showCursor(true) bindKey("enter", "down", selectVehicle) end end,false ) addEventHandler("onClientColShapeLeave", vehiclesMarker, function(leaveElement) if leaveElement == localPlayer and getElementData(leaveElement, "Group") == groupName and not isPedInVehicle(leaveElement) then guiSetVisible(mainWindow, false) showCursor(false) unbindKey("enter", "down", selectVehicle) end end, false ) function selectVehicle() for i,v in pairs(vehicles) do local tab = v.tab if guiGetSelectedTab(mainTab) == tab then local gridlist = v.gridlist if guiGridListGetSelectedItem(gridlist) ~= -1 then local row = guiGridListGetSelectedItem(gridlist) local vehName = guiGridListGetItemText(gridlist, row, v[1]) for _,k in ipairs(v.list) do if k[1] == vehName then if i == "planes" then triggerServerEvent("spawningVehicle", localPlayer, k[2], true) else triggerServerEvent("spawningVehicle", localPlayer, k[2], false) end unbindKey("enter", "down", selectVehicle) break end end guiSetVisible(mainWindow, false) showCursor(false) break end end end end Server: addEvent("spawningVehicle", true) local groupName = '[MFA]' local activeVehicles = {} local playersVehicles = {} local occupiedVehicles = {} local activeTimers = {} local Intruders = {} local function addVehicleToDestroyList(vehicleNumber) activeTimers[vehicleNumber] = setTimer( function(vehicleNumber) destroyElement(activeVehicles[vehicleNumber]) activeVehicles[vehicleNumber] = nil activeTimers[vehicleNumber] = nil for i,v in pairs(playersVehicles) do if v == vehicleNumber then playersVehicles[i] = nil break end end end, 30000, 1, vehicleNumber ) end local function removeVehicleFromDestroyList(vehicleNumber) if isTimer(activeTimers[vehicleNumber]) then killTimer(activeTimers[vehicleNumber]) activeTimers[vehicleNumber] = nil end end addEventHandler("spawningVehicle", root, function(model, planes) local poo = { {3201,907,19}, {3201,927,19} } local x, y, z = 0, 0, 0 local rx, ry, rz = 0, 0, 0 if planes then x, y, z = unpack(poo[math.random(#poo)]) rx, ry, rz = 0.3275146484375, 359.78839111328, 271.46984863281 else x, y, z = 3089.21973,846.85303,7.67837 rx, ry, rz = 359.54382324219, 359.99975585938, 3.48193359375 end if playersVehicles[client] then destroyElement(activeVehicles[playersVehicles[client]]) removeVehicleFromDestroyList(playersVehicles[client]) playersVehicles[client] = nil end local vehicle = #activeVehicles + 1 activeVehicles[vehicle] = createVehicle(model, x, y, z, rx, ry, rz) setVehicleColor(activeVehicles[vehicle], 255, 255, 255) warpPedIntoVehicle(client, activeVehicles[vehicle]) addVehicleUpgrade(activeVehicles[vehicle], 1010) playersVehicles[client] = vehicle occupiedVehicles[vehicle] = nil end ) addEventHandler("onVehicleExit", root, function(player, seat) if seat == 0 then if playersVehicles[player] then addVehicleToDestroyList(playersVehicles[player]) occupiedVehicles[playersVehicles[player]] = nil else for i,v in pairs(activeVehicles) do if v == source then addVehicleToDestroyList(i) occupiedVehicles[i] = nil end end end end end ) addEventHandler("onVehicleEnter", root, function(player, seat) if seat == 0 then if playersVehicles[player] then removeVehicleFromDestroyList(playersVehicles[player]) occupiedVehicles[playersVehicles[player]] = true else for i,v in pairs(activeVehicles) do if v == source then removeVehicleFromDestroyList(i) occupiedVehicles[i] = true break end end end end end ) addEventHandler("onVehicleStartEnter", root, function(player, seat) for i,v in pairs(activeVehicles) do if v == source then if getElementData(player, "Group") ~= groupName then outputChatBox("This vehicle is only for "..groupName.." group!", player, 255, 0, 0) cancelEvent() else if seat == 0 and occupiedVehicles[i] then outputChatBox("You cannot take this vehicle as someone in it already!", player, 255, 0, 0) cancelEvent() end end break end end end ) addEventHandler("onVehicleExplode", root, function() for i,v in pairs(activeVehicles) do if v == source then removeVehicleFromDestroyList(i) activeVehicles[i] = nil occupiedVehicles[i] = nil setTimer(destroyElement, 2000, 1, source) for k,s in pairs(playersVehicles) do if i == s then playersVehicles[k] = nil break end end break end end end ) ممكن تصححوا الكود ! بعد التعديل: كلينت local groupName = '[MFA]' local sx, sy = guiGetScreenSize() mainWindow = guiCreateWindow((sx-438)/2, (sy-487)/2, 438, 487, "[MFA] Vehicles", false) guiWindowSetSizable(mainWindow, false) guiSetAlpha(mainWindow, 1.00) guiSetVisible(mainWindow, false) mainTab = guiCreateTabPanel(0.02, 0.04, 0.96, 0.90, true, mainWindow) local vehicles = { cars = { tab = guiCreateTab("Cars", mainTab), list = { {"Cheetah", 415}, {"Bullet", 541}, {"Infernus", 411}, {"Sultan", 560}, {"Turismo", 451}, {"Comet", 480}, {"Huntley", 579}, {"Flash", 565}, {"Bandito", 568} } }, bikes = { tab = guiCreateTab("Bikes", mainTab), list = { {"BF-400", 581}, {"FCR-900", 521}, {"NRG-511", 522}, {"PCJ-600", 461}, {"Sanchez", 468} } }, planes = { tab = guiCreateTab("Planes", mainTab), list = { {"Sparrow", 469}, {"Maverick", 487} } } } vehicles.cars.gridlist = guiCreateGridList(0.05, 0.02, 0.89, 0.95, true, vehicles.cars.tab) table.insert(vehicles.cars, guiGridListAddColumn(vehicles.cars.gridlist, "Cars", 0.9)) vehicles.bikes.gridlist = guiCreateGridList(0.05, 0.02, 0.89, 0.95, true, vehicles.bikes.tab) table.insert(vehicles.bikes, guiGridListAddColumn(vehicles.bikes.gridlist, "Bikes", 0.9)) vehicles.planes.gridlist = guiCreateGridList(0.05, 0.02, 0.89, 0.95, true, vehicles.planes.tab) table.insert(vehicles.planes, guiGridListAddColumn(vehicles.planes.gridlist, "Planes", 0.9)) notice = guiCreateLabel(0.02, 0.94, 0.96, 0.03, "Press (Enter) to select your vehicle", true, mainWindow) guiLabelSetColor(notice, 255, 255, 0) guiLabelSetHorizontalAlign(notice, "center", false) guiLabelSetVerticalAlign(notice, "center") for i,v in pairs(vehicles) do for _,k in ipairs(v.list) do local row = guiGridListAddRow(v.gridlist) guiGridListSetItemText(v.gridlist, row, v[1], k[1], false, false) end end local vehiclesMarker = createColSphere(1648.7998046875,577.3994140625,10.199999809265, 3) createMarker(1648.7998046875,577.3994140625,10.199999809265,"cylinder",3,0,255,0,255) addEventHandler("onClientColShapeHit", vehiclesMarker, function(hitElement) if hitElement == localPlayer and getElementData(hitElement, "Group") == groupName and not isPedInVehicle(hitElement) then guiSetVisible(mainWindow, true) showCursor(true) bindKey("enter", "down", selectVehicle) end end,false ) addEventHandler("onClientColShapeLeave", vehiclesMarker, function(leaveElement) if leaveElement == localPlayer and getElementData(leaveElement, "Group") == groupName and not isPedInVehicle(leaveElement) then guiSetVisible(mainWindow, false) showCursor(false) unbindKey("enter", "down", selectVehicle) end end, false ) function selectVehicle() for i,v in pairs(vehicles) do local tab = v.tab if guiGetSelectedTab(mainTab) == tab then local gridlist = v.gridlist if guiGridListGetSelectedItem(gridlist) ~= -1 then local row = guiGridListGetSelectedItem(gridlist) local vehName = guiGridListGetItemText(gridlist, row, v[1]) for _,k in ipairs(v.list) do if k[1] == vehName then if i == "planes" then triggerServerEvent("spawningVehicle", localPlayer, k[2], true) else triggerServerEvent("spawningVehicle", localPlayer, k[2], false) end unbindKey("enter", "down", selectVehicle) break end end guiSetVisible(mainWindow, false) showCursor(false) break end end end end سيرفر: addEvent("spawningVehicle", true) local groupName = 'anAs' local activeVehicles = {} local playersVehicles = {} local occupiedVehicles = {} local activeTimers = {} local Intruders = {} local function addVehicleToDestroyList(vehicleNumber) activeTimers[vehicleNumber] = setTimer( function(vehicleNumber) destroyElement(activeVehicles[vehicleNumber]) activeVehicles[vehicleNumber] = nil activeTimers[vehicleNumber] = nil for i,v in pairs(playersVehicles) do if v == vehicleNumber then playersVehicles[i] = nil break end end end, 30000, 1, vehicleNumber ) end local function removeVehicleFromDestroyList(vehicleNumber) if isTimer(activeTimers[vehicleNumber]) then killTimer(activeTimers[vehicleNumber]) activeTimers[vehicleNumber] = nil end end addEventHandler("spawningVehicle", root, function(model, planes) local poo = { {1645.25256,578.22870,11.35537}, {1645.25256,578.22870,11.35537} } local x, y, z = 0, 0, 0 local rx, ry, rz = 0, 0, 0 if planes then x, y, z = unpack(poo[math.random(#poo)]) rx, ry, rz = 1645.25256,578.22870,11.35537 else x, y, z = 1645.25256,578.22870,11.35537 rx, ry, rz = 1645.25256,578.22870,11.35537 end if playersVehicles[client] then destroyElement(activeVehicles[playersVehicles[client]]) removeVehicleFromDestroyList(playersVehicles[client]) playersVehicles[client] = nil end local vehicle = #activeVehicles + 1 activeVehicles[vehicle] = createVehicle(model, x, y, z, rx, ry, rz) setVehicleColor(activeVehicles[vehicle], 255, 255, 255) warpPedIntoVehicle(client, activeVehicles[vehicle]) addVehicleUpgrade(activeVehicles[vehicle], 1010) playersVehicles[client] = vehicle occupiedVehicles[vehicle] = nil end ) addEventHandler("onVehicleExit", root, function(player, seat) if seat == 0 then if playersVehicles[player] then addVehicleToDestroyList(playersVehicles[player]) occupiedVehicles[playersVehicles[player]] = nil else for i,v in pairs(activeVehicles) do if v == source then addVehicleToDestroyList(i) occupiedVehicles[i] = nil end end end end end ) addEventHandler("onVehicleEnter", root, function(player, seat) if seat == 0 then if playersVehicles[player] then removeVehicleFromDestroyList(playersVehicles[player]) occupiedVehicles[playersVehicles[player]] = true else for i,v in pairs(activeVehicles) do if v == source then removeVehicleFromDestroyList(i) occupiedVehicles[i] = true break end end end end end ) addEventHandler("onVehicleStartEnter", root, function(player, seat) for i,v in pairs(activeVehicles) do if v == source then if getElementData(player, "Group") ~= groupName then outputChatBox("This vehicle is only for "..groupName.." group!", player, 255, 0, 0) cancelEvent() else if seat == 0 and occupiedVehicles[i] then outputChatBox("You cannot take this vehicle as someone in it already!", player, 255, 0, 0) cancelEvent() end end break end end end ) addEventHandler("onVehicleExplode", root, function() for i,v in pairs(activeVehicles) do if v == source then removeVehicleFromDestroyList(i) activeVehicles[i] = nil occupiedVehicles[i] = nil setTimer(destroyElement, 2000, 1, source) for k,s in pairs(playersVehicles) do if i == s then playersVehicles[k] = nil break end end break end end end )
-
عأدي ي رجال @! مشكور ي حبايب @
-
ول انا ما نسخت الكود كامل نسخت setPedStat(hitElement,24,1000) ذا بسس ولصقت في الكود السابق @ Lool!
-
ي رجل كل شي تمام واشتغل معي كيف تقول نأقص؟@
-
زبط ي لبى .. مدري كثر طلبات !! بسس اعتذز @@ ومشكور لكم على الجهد @
-
شوف كذا صحيح marker = createMarker (1828.95093,1026.23010,29.70781, "cylinder", 2, 255, 0, 255, 255 ) addEventHandler ( "onMarkerHit", marker,function ( hitElement ) if getElementType ( hitElement ) == "player" then if getElementData( hitElement ,'Group') == '[ARMY]' then setElementHealth ( hitElement, 1000 ) setPedArmor ( hitElement, 100 ) setPedSkin ( hitElement, 230 ) setPedFightingStyle(hitElement,6) setPedStat(hitElement,24,569) else outputChatBox ( "* You most be [ARMY]Group ", hitElement, 0, 0, 255, true ) end end end
-
في زيادة دم ابي يطول الدم الى رقم 1000 يعني يكون الدم طويل
-
السسلام عليكم ورحمة الله وبركاته ي عيال ممكن تضيفو لي بالكود اذا لمستها دمي يطول 1000 marker = createMarker (877.19921875,-2098,13.800000190735, "cylinder", 2, 255, 0, 255, 255 ) addEventHandler ( "onMarkerHit", marker,function ( hitElement ) if getElementType ( hitElement ) == "player" then if getElementData( hitElement ,'Group') == '[ARMY]' then setElementHealth ( hitElement, 100 ) setPedArmor ( hitElement, 100 ) setPedSkin ( hitElement, 230 ) setPedFightingStyle(hitElement,6) else outputChatBox ( "* You most be [ARMY]Group ", hitElement, 0, 0, 255, true ) end end end )
-
وبعد كل ذا التعب اخيرنأً iMr.Dawix~# جزاك الله خير يأ< مشكور على الرد زبط مشكورين
-
debugscript: Syntax is 'debugscript ' والكود الي فوق هي وظيفته تصلح سيارات+تعبئة دم +درع واشياء ذي