yMassai Posted May 28, 2012 Share Posted May 28, 2012 carrosMarker = createMarker( 1507.860, -1714.509, 13.046, "cylinder", 1.5, 255, 250,110,100 ) carrosWindow = guiCreateWindow(100,100,175,200,"Criador de Carros",false) carrosList = guiCreateGridList ( 0.05, 0.10, 0.9, 0.7, true, carrosWindow) column = guiGridListAddColumn( carrosList, "Carros", 0.85 ) carrosCreate = guiCreateButton(05,170,85,45,"Criar",false,carrosWindow) carrosClose = guiCreateButton(110,170,50,45,"Fechar",false,carrosWindow) guiWindowSetSizable( carrosWindow,false) row = guiGridListAddRow( carrosList ) row2 = guiGridListAddRow( carrosList ) row3 = guiGridListAddRow( carrosList ) guiGridListSetItemText( carrosList, row, column, "Glendale", false, false ) guiGridListSetItemText( carrosList, row2, column, "Sadler", false, false ) guiGridListSetItemText( carrosList, row3, column, "Sanchez", false, false ) guiSetVisible( carrosWindow, false ) function elMarker( hitPlayer ) if ( getElementType(hitPlayer) == "player" and hitPlayer == localPlayer ) then guiSetVisible ( carrosWindow, true ) showCursor(true) end end addEventHandler ( "onClientMarkerHit", carrosMarker, elMarker) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == carrosClose ) then guiSetVisible ( carrosWindow, false ) showCursor(false) elseif ( source == carrosCreate ) then local modelo = 0 if(guiGridListGetItemText ( carrosList, guiGridListGetSelectedItem ( carrosList ), column )=="Glendale")then modelo = 604 elseif(guiGridListGetItemText ( carrosList, guiGridListGetSelectedItem ( carrosList ), column )=="Sadler")then modelo = 605 elseif(guiGridListGetItemText ( carrosList, guiGridListGetSelectedItem ( carrosList ), column )=="Sanchez")then modelo = 468 end triggerServerEvent("CreateCarros", getLocalPlayer(),modelo) guiSetVisible ( carrosWindow, false ) showCursor(false) end end ) function Loc (hitElement) if ( source == carrosMarker and not isPedInVehicle ( localPlayer ) and hitElement == localPlayer ) then guiSetVisible(carrosWindow,true) showCursor(treu) end end function pQuit() end addEventHandler("onPlayerQuit",getRootElement(),pQuit) I do not want the window open when the player is inside a vehicle. someone could help me? Link to comment
Guest Guest4401 Posted May 28, 2012 Share Posted May 28, 2012 if not isPedInVehicle(localPlayer) then Link to comment
yMassai Posted May 28, 2012 Author Share Posted May 28, 2012 I really do not understand what you want to say mean. Link to comment
Flaker Posted May 28, 2012 Share Posted May 28, 2012 Use this code for "elMarker" function. function elMarker( hitPlayer ) if ( getElementType(hitPlayer) == "player" and hitPlayer == localPlayer and not(isPedInVehicle(localPlayer)) ) then guiSetVisible ( carrosWindow, true ) showCursor(true) end end addEventHandler ( "onClientMarkerHit", carrosMarker, elMarker) Link to comment
yMassai Posted May 28, 2012 Author Share Posted May 28, 2012 Thanks, This working perfectly. 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