Jump to content

مساعدة بسيطة


Recommended Posts

المشكلة هى انى بحاول اعملل ماركر سيارات لجروب اف بى اى و لتيم الشطرة بنفس الوقت بس الماركر يظهر لكن لا يشتغل يظهر بس

دا كلينت

UIEditor_Button = {} 
GUIEditor_Grid = {} 
GUIEditor_Marker = {} 
GUIEditor_Window = {} 
local marker = {} 
vehicleId = {523,480,497,522,490,522,427,601,411} 
marker = createMarker(1021.5999755859,-1450.5999755859,12.60000038147,"cylinder",1.5,0,100,0,220) 
marker2 = createMarker(1024.4000244141,-1441,12.39999961853,"cylinder",1.5,0,100,0,220) 
  
  
local x,y = guiGetScreenSize() 
local x = x - 208 
local y = y - 321 
GUIEditor_Window[1] = guiCreateWindow(500,147,246,413,"Select Car",false) 
guiSetVisible(GUIEditor_Window[1],false) 
guiSetAlpha(GUIEditor_Window[1],1) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Grid[1] = guiCreateGridList(9,34,228,255,false,GUIEditor_Window[1]) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.5) 
GUIEditor_Button[2] = guiCreateButton(20,308,210,41,"Select",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(20,352,210,41,"Close",false,GUIEditor_Window[1]) 
  
  
  
for i,id in ipairs ( vehicleId ) do 
guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) 
end 
  
addEventHandler ("onClientMarkerHit", marker, 
function( player ) 
    if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'Police' and not isPedInVehicle( player ) and player == localPlayer and getElementData ( player , "gang" ) == "|F.B.I|" then 
  
                x999,y999,z999 = getElementPosition( localPlayer ) 
                setElementFrozen ( localPlayer, true ) 
                guiSetVisible(GUIEditor_Window[1],true) 
                showCursor( true ) 
                end 
                end 
                ) 
  
addEventHandler('onClientGUIClick', root, 
function() 
    if ( source == GUIEditor_Button[1] ) then 
        guiSetVisible(GUIEditor_Window[1],false) 
        showCursor( false ) 
        setElementFrozen ( 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) 
        setElementFrozen ( localPlayer, false ) 
        showCursor( false ) 
    end 
end 

 

و لما عملت debugscript 3

client.lua24 attempt to index gobal 'GuiEditor'-button'(a nill value)

client.lua23 attempt to index gobal 'GuiEditor'-button'(a nill value)

ممكن مساعدة

Edited by Guest
Link to comment

جرببءَ ~

GUIEditor_Button = {} 
GUIEditor_Grid = {} 
GUIEditor_Marker = {} 
GUIEditor_Window = {} 
local marker = {} 
vehicleId = {523,480,497,522,490,522,427,601,411} 
marker = createMarker(1021.5999755859,-1450.5999755859,12.60000038147,"cylinder",1.5,0,100,0,220) 
marker2 = createMarker(1024.4000244141,-1441,12.39999961853,"cylinder",1.5,0,100,0,220) 
  
  
local x,y = guiGetScreenSize() 
local x = x - 208 
local y = y - 321 
GUIEditor_Window[1] = guiCreateWindow(500,147,246,413,"Select Car",false) 
guiSetVisible(GUIEditor_Window[1],false) 
guiSetAlpha(GUIEditor_Window[1],1) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Grid[1] = guiCreateGridList(9,34,228,255,false,GUIEditor_Window[1]) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.5) 
GUIEditor_Button[2] = guiCreateButton(20,308,210,41,"Select",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(20,352,210,41,"Close",false,GUIEditor_Window[1]) 
  
  
  
for i,id in ipairs ( vehicleId ) do 
guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) 
end 
  
addEventHandler ("onClientMarkerHit", marker, 
function( player ) 
    if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'Police' and not isPedInVehicle( player ) and player == localPlayer and getElementData ( player , "gang" ) == "|F.B.I|" then 
  
                x999,y999,z999 = getElementPosition( localPlayer ) 
                setElementFrozen ( localPlayer, true ) 
                guiSetVisible(GUIEditor_Window[1],true) 
                showCursor( true ) 
                end 
                end 
                ) 
  
addEventHandler('onClientGUIClick', root, 
function() 
    if ( source == GUIEditor_Button[1] ) then 
        guiSetVisible(GUIEditor_Window[1],false) 
        showCursor( false ) 
        setElementFrozen ( 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) 
        setElementFrozen ( localPlayer, false ) 
        showCursor( false ) 
    end 
end 

Link to comment

جرببءَ ~

GUIEditor_Button = {} 
GUIEditor_Grid = {} 
GUIEditor_Marker = {} 
GUIEditor_Window = {} 
local marker = {} 
vehicleId = {523,480,497,522,490,522,427,601,411} 
marker = createMarker(1021.5999755859,-1450.5999755859,12.60000038147,"cylinder",1.5,0,100,0,220) 
marker2 = createMarker(1024.4000244141,-1441,12.39999961853,"cylinder",1.5,0,100,0,220) 
  
  
local x,y = guiGetScreenSize() 
local x = x - 208 
local y = y - 321 
GUIEditor_Window[1] = guiCreateWindow(500,147,246,413,"Select Car",false) 
guiSetVisible(GUIEditor_Window[1],false) 
guiSetAlpha(GUIEditor_Window[1],1) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Grid[1] = guiCreateGridList(9,34,228,255,false,GUIEditor_Window[1]) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.5) 
GUIEditor_Button[2] = guiCreateButton(20,308,210,41,"Select",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(20,352,210,41,"Close",false,GUIEditor_Window[1]) 
  
  
  
for i,id in ipairs ( vehicleId ) do 
guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) 
end 
  
addEventHandler ("onClientMarkerHit", marker, 
function( player ) 
    if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'Police' and not isPedInVehicle( player ) and player == localPlayer and getElementData ( player , "gang" ) == "|F.B.I|" then 
  
                x999,y999,z999 = getElementPosition( localPlayer ) 
                setElementFrozen ( localPlayer, true ) 
                guiSetVisible(GUIEditor_Window[1],true) 
                showCursor( true ) 
                end 
                end 
                ) 
  
addEventHandler('onClientGUIClick', root, 
function() 
    if ( source == GUIEditor_Button[1] ) then 
        guiSetVisible(GUIEditor_Window[1],false) 
        showCursor( false ) 
        setElementFrozen ( 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) 
        setElementFrozen ( localPlayer, false ) 
        showCursor( false ) 
    end 
end 

اشتغل بس فهمنى وش عملت؟

Link to comment

طلب كمان لو سمحت

ableCars = {} 
  
addEvent('gvoa', true) 
addEventHandler('gvoa', root, 
function( nameCar ) 
if isElement( TableCars[source] ) then 
destroyElement( TableCars[source] ) 
end 
local id = getVehicleModelFromName( nameCar ) 
if id == 497  then 
local x, y, z = unpack( AircraftIdSpawn[math.random(#AircraftIdSpawn)] ) 
TableCars[source] = createVehicle( 497,939.90002441406,-1468,32.299999237061) 
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], 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", getResourceRootElement(getThisResource()), 
 function(player,seat) 
  if getElementData( player, 'gang' ) == "|F.B.I|" and getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'No Team' then return end 
    if seat == 0 then 
    outputChatBox("gang " .. "|F.B.I|" .. " Only", player, 255, 0, 0, true) 
    cancelEvent() 
  end 
end 
) 
  
  

عايز الطائرة تروح على مكان ثانى الاحداضيات اللى انا حاطتها بس ما تروح مدرى ليش

Link to comment
هههههههههه محطوط لكن انا كتبته بالمنتدى هيك لكن المشكلة الاصلية مو هون عند

sever.lua11 attempt to get length of gobal AircraftIdSpawn '(a nill value)

احذف السطر ١١ اللي فيه

AircraftIdSpawn

لاني اشوفك ماتستخدمه

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...