Dr.Xen Posted January 4, 2014 Share Posted January 4, 2014 السلام عليكم ورحمة الله وبركاته انا عندي خراب بالكود لو اختار سيارة يطلع لي ثنتين ابي وحده تطلع 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 ) Link to comment
al-Kobra Posted January 4, 2014 Share Posted January 4, 2014 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] ) شوف شلون مكرر 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 ) 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 ) جربه Link to comment
Booo Posted January 4, 2014 Share Posted January 4, 2014 السلام عليكم ورحمة الله وبركاتهانا عندي خراب بالكود لو اختار سيارة يطلع لي ثنتين ابي وحده تطلع 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 ) وعليكم السلام ورحمة الله وبركاته عندك أكواد زآيده ماادري وش وضعها .! عالعموم سوى نسخ للكود وشف يزبط مععك .. 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 TableCars[source] and 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 ) else local x,y,z = getElementPosition( source ) TableCars[source] = createVehicle( id, x, y, z ) 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 ) Link to comment
Dr.Xen Posted January 5, 2014 Author Share Posted January 5, 2014 وكمان تطلع ثنتين ! مازبط Link to comment
jafar Posted January 5, 2014 Share Posted January 5, 2014 اذا انت مستخدم الكود مرتين, استبدل إسم ترايقر إنشاء السيارة .. Link to comment
Booo Posted January 5, 2014 Share Posted January 5, 2014 وكمان تطلع ثنتين !مازبط تأكد يخوي الكود مااأشوف فيه شي تأكد انك قفلت السكربت وسويت تحديث له ترا التعديل بملف السيرفر 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