Jump to content

تعديل كود


Dr.Xen

Recommended Posts

السلام عليكم ورحمة الله وبركاته

ي شباب انا معي لوحة سيارات كل شي تمام بس اذا انا اخذت سيارات اي واحد يقدر يسوق ابيه فقط عضاء القروب ييسوق الموتر

!

الكود:"

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,520,425,} 
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 groupName = '[MFA]' 
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" ) == groupName 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 (1384.30298,581.37543,10.91094) 
setBlipVisibleDistance (base, 30) 
local groupName = '[MFA]' 
  
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  ) 
            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 
) 

!!

Link to comment

AircraftIdSpawn = { 
{ 1430.9000244141,596.09997558594,14 }, 
} 
  
  
local base = createBlip (1384.30298,581.37543,10.91094) 
setBlipVisibleDistance (base, 30) 
local groupName = '[MFA]' 
  
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  ) 
            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") == groupName 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...