WASSIm. Posted January 19, 2013 Share Posted January 19, 2013 script hadha ispawn karahba bil panel Clent: Wnd = guiCreateWindow ( 0.4, 0.25, 0.25, 0.5, "Police Vehicles", true ) guiSetAlpha( Wnd, 100 ) button = guiCreateButton ( 0.01, 0.8, 0.99, 0.15, "Close", true, Wnd ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Double Click Vehicle to take it.", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) vehicles = { {"Patriot", 470}, {"Police Ranger", 599}, {"Mesa", 500}, {"Shanchez", 486}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd) guiGridListAddColumn(grid, "Vehicles", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function use() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("CreVehice1s", localPlayer, model) end end end addEventHandler("onClientDoubleClick", root, use, false) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function showGUI1s() guiSetVisible(Wnd,true) showCursor(true) end addEvent("showGUI1s",true) addEventHandler("showGUI1s", getRootElement(), showGUI1s) Server: markerp = createMarker( 193.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) marker2p = createMarker( 202.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) marker3p = createMarker( 211.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) marker4p = createMarker( 220.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) local vehicles = { } function spawnVehP ( id ) local theTeam = getPlayerTeam ( source ) local theTeamName = getTeamName ( theTeam ) if ( theTeamName == "Soldier" ) then local x, y, z = getElementPosition ( source ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( id, x, y, z + 1 ) setVehicleColor ( vehicles [ source ], getTeamColor ( theTeam ) ) warpPedIntoVehicle ( source, vehicles [ source ] ) else outoutChatBox ( "Only police agents and FBI can get free vehicles from here!", source, 255, 0, 0 ) end end addEvent ( "CreVehice1s", true ) addEventHandler ( "CreVehice1s", root, spawnVehP ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) vehicles [ source ] = nil end end ) function showGUIp ( hitPlayer ) if ( source == markerp or source == marker2p or source == marker3p or source == marker4p ) then local theTeam = getPlayerTeam ( hitPlayer ) local theTeamName = getTeamName ( theTeam ) if ( theTeamName == "Soldier" ) then triggerClientEvent ( hitPlayer, "showGUI1s", getRootElement(), hitPlayer ) end end end addEventHandler ( "onMarkerHit",root, showGUIp ) ama ki 7atit wa7da o5ra kifha ama badalt chwaya 7ajat ya5i mafhamtch 3alach twarili fil lola Clent: Wnd = guiCreateWindow ( 0.4, 0.25, 0.25, 0.5, "Police Vehicles", true ) guiSetAlpha( Wnd, 100 ) button = guiCreateButton ( 0.01, 0.8, 0.99, 0.15, "Close", true, Wnd ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Double Click Vehicle to take it.", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) vehicles = { {"Cargobob", 548}, {"Maverick", 487}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd) guiGridListAddColumn(grid, "Vehicles", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function use() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("CreVehice2s", localPlayer, model) end end end addEventHandler("onClientDoubleClick", root, use, false) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function showGUI2s() guiSetVisible(Wnd,true) showCursor(true) end addEvent("showGUI2s",true) addEventHandler("showGUI2s", getRootElement(), showGUI2s) Server: markerp = createMarker( 343.7, 1954.4, 20, "cylinder", 2, 0, 0, 0, 0 ) local vehicles = { } function spawnVehP ( id ) local theTeam = getPlayerTeam ( source ) local theTeamName = getTeamName ( theTeam ) if ( theTeamName == "Soldier" ) then local x, y, z = getElementPosition ( source ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( id, x, y, z + 1 ) setVehicleColor ( vehicles [ source ], getTeamColor ( theTeam ) ) warpPedIntoVehicle ( source, vehicles [ source ] ) else outoutChatBox ( "Only police agents and FBI can get free vehicles from here!", source, 255, 0, 0 ) end end addEvent ( "CreVehice2s", true ) addEventHandler ( "CreVehice2s", root, spawnVehP ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) vehicles [ source ] = nil end end ) function showGUIp ( hitPlayer ) if ( source == markerp ) then if hasObjectPermissionTo(hitPlayer, "general.Soldier", false) then triggerClientEvent ( hitPlayer, "showGUI2s", getRootElement(), hitPlayer ) end end end addEventHandler ( "onMarkerHit",root, showGUIp ) wala daw5atni il 7kaya Link to comment
WASSIm. Posted January 19, 2013 Author Share Posted January 19, 2013 wlh lé fhemtek behi rit il client wa server il thaniya ki n7otha twarili il panel mta3 il client wa server lola Link to comment
Baseplate Posted January 19, 2013 Share Posted January 19, 2013 mak enti saker el resource loula w jareb.. Link to comment
WASSIm. Posted January 19, 2013 Author Share Posted January 19, 2013 mak enti saker el resource loula w jareb.. ama ena n7abhom il zouz ya5dmo Link to comment
Sparrow Posted January 19, 2013 Share Posted January 19, 2013 lezem asemi el event yabdew mahomch kifkif. badel les noms mta3 events fil 2eme script Link to comment
Baseplate Posted January 19, 2013 Share Posted January 19, 2013 Sparrow, zid thabet taw tal9ahoum mech kifkif ana aslan thabatet fihom Link to comment
WASSIm. Posted January 19, 2013 Author Share Posted January 19, 2013 balahi chnawa il 7al Link to comment
Baseplate Posted January 19, 2013 Share Posted January 19, 2013 mathama 7ata chay 3la /debugscript 3 ? Link to comment
Sparrow Posted January 19, 2013 Share Posted January 19, 2013 wassams, 2m1 ataw nposti fixed script, pours les 2. tawa te3b mechi nor9ed Link to comment
WASSIm. Posted January 19, 2013 Author Share Posted January 19, 2013 mathama 7ata chay 3la /debugscript 3 ? mafamachay wassams, 2m1 ataw nposti fixed script, pours les 2.tawa te3b mechi nor9ed i3aychek Link to comment
Sparrow Posted January 20, 2013 Share Posted January 20, 2013 first one: server: markerp = createMarker( 193.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) marker2p = createMarker( 202.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) marker3p = createMarker( 211.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) marker4p = createMarker( 220.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) local vehicles = { } function spawnVehP ( id ) local theTeam = getPlayerTeam ( source ) local theTeamName = getTeamName ( theTeam ) if ( theTeamName == "Soldier" ) then local x, y, z = getElementPosition ( source ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( id, x, y, z + 1 ) setVehicleColor ( vehicles [ source ], getTeamColor ( theTeam ) ) warpPedIntoVehicle ( source, vehicles [ source ] ) else outoutChatBox ( "Only police agents and FBI can get free vehicles from here!", source, 255, 0, 0 ) end end addEvent ( "CreVehice1s", true ) addEventHandler ( "CreVehice1s", root, spawnVehP ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) vehicles [ source ] = nil end end ) function showGUIp ( hitPlayer ) if ( source == markerp or source == marker2p or source == marker3p or source == marker4p ) then local theTeam = getPlayerTeam ( hitPlayer ) local theTeamName = getTeamName ( theTeam ) if ( theTeamName == "Soldier" ) then triggerClientEvent ( hitPlayer, "showGUI1s", getRootElement(), hitPlayer ) end end end addEventHandler ( "onMarkerHit",root, showGUIp ) client: Wnd = guiCreateWindow ( 0.4, 0.25, 0.25, 0.5, "Police Vehicles", true ) guiSetAlpha( Wnd, 100 ) button = guiCreateButton ( 0.01, 0.8, 0.99, 0.15, "Close", true, Wnd ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Double Click Vehicle to take it.", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) vehicles = { {"Patriot", 470}, {"Police Ranger", 599}, {"Mesa", 500}, {"Shanchez", 486}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd) guiGridListAddColumn(grid, "Vehicles", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function use() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("CreVehice1s", localPlayer, model) end end end addEventHandler("onClientDoubleClick", root, use, false) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function showGUI1s() guiSetVisible(Wnd,true) showCursor(true) end addEvent("showGUI1s",true) addEventHandler("showGUI1s", getRootElement(), showGUI1s) second one: server: marker2 = createMarker( 343.7, 1954.4, 21, "checkpoint", 2, 0, 0, 0, 0 ) local vehicles = { } function spawnVehP ( id ) local theTeam = getPlayerTeam ( source ) local theTeamName = getTeamName ( theTeam ) if ( theTeamName == "Soldier" ) then local x, y, z = getElementPosition ( source ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( id, x, y, z + 1 ) setVehicleColor ( vehicles [ source ], getTeamColor ( theTeam ) ) warpPedIntoVehicle ( source, vehicles [ source ] ) else outoutChatBox ( "Only police agents and FBI can get free vehicles from here!", source, 255, 0, 0 ) end end addEvent ( "CreVehice2s", true ) addEventHandler ( "CreVehice2s", root, spawnVehP ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) vehicles [ source ] = nil end end ) function showGUIp ( hitPlayer ) if ( source == marker2 ) then if hasObjectPermissionTo(hitPlayer, "general.Soldier", false) then triggerClientEvent ( hitPlayer, "showGUI2s", getRootElement(), hitPlayer ) end end end addEventHandler ( "onMarkerHit",root, showGUIp ) client: Wnd = guiCreateWindow ( 0.4, 0.25, 0.25, 0.5, "Police Vehicles", true ) guiSetAlpha( Wnd, 100 ) button = guiCreateButton ( 0.01, 0.8, 0.99, 0.15, "Close", true, Wnd ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Double Click Vehicle to take it.", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) vehicles = { {"Cargobob", 548}, {"Maverick", 487}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd) guiGridListAddColumn(grid, "Vehicles", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function use() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("CreVehice2s", localPlayer, model) end end end addEventHandler("onClientDoubleClick", root, use, false) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function showGUI2s() guiSetVisible(Wnd,true) showCursor(true) end addEvent("showGUI2s",true) addEventHandler("showGUI2s", getRootElement(), showGUI2s) Link to comment
WASSIm. Posted January 20, 2013 Author Share Posted January 20, 2013 first one:server: markerp = createMarker( 193.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) marker2p = createMarker( 202.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) marker3p = createMarker( 211.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) marker4p = createMarker( 220.5, 1919.2, 16.7, "cylinder", 2, 113, 132, 50, 170 ) local vehicles = { } function spawnVehP ( id ) local theTeam = getPlayerTeam ( source ) local theTeamName = getTeamName ( theTeam ) if ( theTeamName == "Soldier" ) then local x, y, z = getElementPosition ( source ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( id, x, y, z + 1 ) setVehicleColor ( vehicles [ source ], getTeamColor ( theTeam ) ) warpPedIntoVehicle ( source, vehicles [ source ] ) else outoutChatBox ( "Only police agents and FBI can get free vehicles from here!", source, 255, 0, 0 ) end end addEvent ( "CreVehice1s", true ) addEventHandler ( "CreVehice1s", root, spawnVehP ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) vehicles [ source ] = nil end end ) function showGUIp ( hitPlayer ) if ( source == markerp or source == marker2p or source == marker3p or source == marker4p ) then local theTeam = getPlayerTeam ( hitPlayer ) local theTeamName = getTeamName ( theTeam ) if ( theTeamName == "Soldier" ) then triggerClientEvent ( hitPlayer, "showGUI1s", getRootElement(), hitPlayer ) end end end addEventHandler ( "onMarkerHit",root, showGUIp ) client: Wnd = guiCreateWindow ( 0.4, 0.25, 0.25, 0.5, "Police Vehicles", true ) guiSetAlpha( Wnd, 100 ) button = guiCreateButton ( 0.01, 0.8, 0.99, 0.15, "Close", true, Wnd ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Double Click Vehicle to take it.", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) vehicles = { {"Patriot", 470}, {"Police Ranger", 599}, {"Mesa", 500}, {"Shanchez", 486}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd) guiGridListAddColumn(grid, "Vehicles", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function use() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("CreVehice1s", localPlayer, model) end end end addEventHandler("onClientDoubleClick", root, use, false) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function showGUI1s() guiSetVisible(Wnd,true) showCursor(true) end addEvent("showGUI1s",true) addEventHandler("showGUI1s", getRootElement(), showGUI1s) second one: server: marker2 = createMarker( 343.7, 1954.4, 21, "checkpoint", 2, 0, 0, 0, 0 ) local vehicles = { } function spawnVehP ( id ) local theTeam = getPlayerTeam ( source ) local theTeamName = getTeamName ( theTeam ) if ( theTeamName == "Soldier" ) then local x, y, z = getElementPosition ( source ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( id, x, y, z + 1 ) setVehicleColor ( vehicles [ source ], getTeamColor ( theTeam ) ) warpPedIntoVehicle ( source, vehicles [ source ] ) else outoutChatBox ( "Only police agents and FBI can get free vehicles from here!", source, 255, 0, 0 ) end end addEvent ( "CreVehice2s", true ) addEventHandler ( "CreVehice2s", root, spawnVehP ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement ( vehicles [ source ] ) then destroyElement ( vehicles [ source ] ) vehicles [ source ] = nil end end ) function showGUIp ( hitPlayer ) if ( source == marker2 ) then if hasObjectPermissionTo(hitPlayer, "general.Soldier", false) then triggerClientEvent ( hitPlayer, "showGUI2s", getRootElement(), hitPlayer ) end end end addEventHandler ( "onMarkerHit",root, showGUIp ) client: Wnd = guiCreateWindow ( 0.4, 0.25, 0.25, 0.5, "Police Vehicles", true ) guiSetAlpha( Wnd, 100 ) button = guiCreateButton ( 0.01, 0.8, 0.99, 0.15, "Close", true, Wnd ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Double Click Vehicle to take it.", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) vehicles = { {"Cargobob", 548}, {"Maverick", 487}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd) guiGridListAddColumn(grid, "Vehicles", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function use() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("CreVehice2s", localPlayer, model) end end end addEventHandler("onClientDoubleClick", root, use, false) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function showGUI2s() guiSetVisible(Wnd,true) showCursor(true) end addEvent("showGUI2s",true) addEventHandler("showGUI2s", getRootElement(), showGUI2s) I3AYCH 5OYA ama chnawa il line ili badalthom ala5ter mazelo barcha chn3awed kif hadhoma Link to comment
Sparrow Posted January 20, 2013 Share Posted January 20, 2013 badelet esm el marker fil script thenya Link to comment
WASSIm. Posted January 20, 2013 Author Share Posted January 20, 2013 badelet esm el marker fil script thenya wa ena mkasar rasi ma3arftch chnawa il problem wa howa tla3 min isem marker 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