yMassai Posted April 26, 2012 Share Posted April 26, 2012 carrosWindow = guiCreateWindow(100,100,175,200,"Sei La",false) carrosList1 = guiCreateGridList(90,20,100,50,true,carrosWindow) carrosComand1 = guiGridListAddColumn(carrosList1,"Carros",2) guiWindowSetSizable( carrosWindow,false) guiSetVisible( carrosWindow, false ) function carrosShow() if (guiGetVisible(carrosWindow) == false) then guiSetVisible(carrosWindow,true) showCursor(true) else guiSetVisible(carrosWindow,false) showCursor(false) end end bindKey("F5","down",carrosShow) tidy error! Link to comment
Guest Guest4401 Posted April 26, 2012 Share Posted April 26, 2012 carrosList1 = guiCreateGridList(90,20,100,50,true,carrosWindow) tidy error! Relative sizes must be 0 to 1. Just change it accordingly, otherwise don't make it relative : carrosList1 = guiCreateGridList(90,20,100,50,false,carrosWindow) Link to comment
yMassai Posted April 26, 2012 Author Share Posted April 26, 2012 carrosWindow = guiCreateWindow(100,100,175,200,"Criador de Carros",false) playerList = guiCreateGridList ( 0.05, 0.10, 0.9, 0.7, true, carrosWindow) column = guiGridListAddColumn( playerList, "Cars", 0.85 ) carrosCreate = guiCreateButton(05,170,85,45,"Create",false,carrosWindow) carrosClose = guiCreateButton(110,170,50,45,"Close",false,carrosWindow) guiWindowSetSizable( carrosWindow,false) guiSetVisible( carrosWindow, false ) carrosMarker = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) how could I open it with a Marker? Link to comment
Guest Guest4401 Posted April 26, 2012 Share Posted April 26, 2012 addEventHandler("onClientMarkerHit", root, function(hitElement) if hitElement == localPlayer then -- if localPlayer hits it if source == carrosMarker then -- only if he hits carros marker guiSetVisible(carrosWindow, true) end end end ) Link to comment
yMassai Posted April 26, 2012 Author Share Posted April 26, 2012 Server carrosMarker = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) addEventHandler("onClientMarkerHit", root, function(hitElement) if hitElement == localPlayer then if source == carrosMarker then guiSetVisible(carrosWindow, true) end end end ) Client carrosWindow = guiCreateWindow(100,100,175,200,"Criador de Carros",false) carrosList = guiCreateGridList ( 0.05, 0.10, 0.9, 0.7, true, carrosWindow) column = guiGridListAddColumn( playerList, "Cars", 0.85 ) carrosCreate = guiCreateButton(05,170,85,45,"Create",false,carrosWindow) carrosClose = guiCreateButton(110,170,50,45,"Close",false,carrosWindow) guiWindowSetSizable( carrosWindow,false) guiSetVisible( carrosWindow, false ) is this way? I just test and does not work Link to comment
Guest Guest4401 Posted April 26, 2012 Share Posted April 26, 2012 No, everything is clientsided. Link to comment
yMassai Posted April 26, 2012 Author Share Posted April 26, 2012 Thanks I will try here, I'm still learning. Link to comment
yMassai Posted April 26, 2012 Author Share Posted April 26, 2012 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, "Cars", 0.85 ) carrosCreate = guiCreateButton(05,170,85,45,"Create",false,carrosWindow) carrosClose = guiCreateButton(110,170,50,45,"Close",false,carrosWindow) guiWindowSetSizable( carrosWindow,false) guiSetVisible( carrosWindow, false ) carrosMarker = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) addEventHandler("onClientMarkerHit", root, function(hitElement) if hitElement == localPlayer then if source == carrosMarker then guiSetVisible(carrosWindow, true) end end end ) How do I close the window with the "Close" button? Link to comment
Guest Guest4401 Posted April 26, 2012 Share Posted April 26, 2012 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, "Cars", 0.85 ) carrosCreate = guiCreateButton(05,170,85,45,"Create",false,carrosWindow) carrosClose = guiCreateButton(110,170,50,45,"Close",false,carrosWindow) guiWindowSetSizable( carrosWindow,false) guiSetVisible( carrosWindow, false ) carrosMarker = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) addEventHandler("onClientMarkerHit", root, function(hitElement) if hitElement == localPlayer then if source == carrosMarker then guiSetVisible(carrosWindow, true) showCursor(true) -- show the cursor end end end ) addEventHandler("onClientGUIClick", root, function() if source == carrosClose then -- if he clicks the carrosClose button guiSetVisible(carrosWindow, false) -- close the window showCursor(false) -- hide the cursor end end ) Link to comment
Castillo Posted April 26, 2012 Share Posted April 26, 2012 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, "Cars", 0.85 ) carrosCreate = guiCreateButton(05,170,85,45,"Create",false,carrosWindow) carrosClose = guiCreateButton(110,170,50,45,"Close",false,carrosWindow) guiWindowSetSizable( carrosWindow,false) guiSetVisible( carrosWindow, false ) carrosMarker = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( hitElement == localPlayer ) then if ( source == carrosMarker ) then guiSetVisible ( carrosWindow, true ) end end end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == carrosClose ) then -- If the button clicked is "carrosClose" guiSetVisible ( carrosWindow, false ) -- Hide the window. end end ) Link to comment
yMassai Posted April 26, 2012 Author Share Posted April 26, 2012 In this script have a place to list and two buttons. the two buttons are Create and Close, one used to create and another for close window. How do I get a few cars on the list in order to be created? Link to comment
Castillo Posted April 26, 2012 Share Posted April 26, 2012 guiGridListAddRow -- To add the row. guiGridListSetItemText -- To set a row text. Link to comment
yMassai Posted April 26, 2012 Author Share Posted April 26, 2012 (edited) 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, "Cars", 0.85 ) carrosRow = guiGridListAddRow ( carrosWindow ) carrosText = guiGridListSetItemText ( carrosWindow, carrosRow, ( playeritem ), false, false ) carrosCreate = guiCreateButton(05,170,85,45,"Create",false,carrosWindow) carrosClose = guiCreateButton(110,170,50,45,"Close",false,carrosWindow) guiWindowSetSizable( carrosWindow,false) guiSetVisible( carrosWindow, false ) carrosMarker = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( hitElement == localPlayer ) then if ( source == carrosMarker ) then guiSetVisible ( carrosWindow, true ) end end end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == carrosClose ) then guiSetVisible ( carrosWindow, false ) end end ) this? Edited April 26, 2012 by Guest Link to comment
Castillo Posted April 26, 2012 Share Posted April 26, 2012 1: What is "guIGrifListAddRow" ? 2: Why you're using getPlayerName if your script is about vehicles? Link to comment
yMassai Posted April 26, 2012 Author Share Posted April 26, 2012 Sorry but I error. if I Knew I would have produced the script. I'm trying to learn. Link to comment
yMassai Posted April 27, 2012 Author Share Posted April 27, 2012 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, "Cars", 0.85 ) carrosCreate = guiCreateButton(05,170,85,45,"Create",false,carrosWindow) carrosClose = guiCreateButton(110,170,50,45,"Close",false,carrosWindow) carrosRow = guiGridListAddRow ( carrosWindow ) guiWindowSetSizable( carrosWindow,false) guiSetVisible( carrosWindow, false ) carrosVis = {{440},{320}} for i,v in ipairs (carrosVis) do local row = guiGridListAddRow (carrosList) guiGridListSetItemText (carrosList, carrosRow, 1, false, true) carrosMarker = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( hitElement == localPlayer ) then if ( source == carrosMarker ) then guiSetVisible ( carrosWindow, true ) end end end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == carrosClose ) then guiSetVisible ( carrosWindow, false ) end end ) ?? Link to comment
Castillo Posted April 27, 2012 Share Posted April 27, 2012 No, that's wrong. 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, "Cars", 0.85 ) carrosCreate = guiCreateButton(05,170,85,45,"Create",false,carrosWindow) carrosClose = guiCreateButton(110,170,50,45,"Close",false,carrosWindow) guiWindowSetSizable( carrosWindow,false) guiSetVisible( carrosWindow, false ) carrosVis = { 440, 320 } for index, model in ipairs ( carrosVis ) do local row = guiGridListAddRow ( carrosList ) guiGridListSetItemText ( carrosList, row, column, tostring ( getVehicleNameFromModel ( model ) ), false, true ) end carrosMarker = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( hitElement == localPlayer ) then if ( source == carrosMarker ) then guiSetVisible ( carrosWindow, true ) end end end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == carrosClose ) then guiSetVisible ( carrosWindow, false ) end end ) Link to comment
yMassai Posted April 27, 2012 Author Share Posted April 27, 2012 error occurs because the arrow does not appear Link to comment
Castillo Posted April 27, 2012 Share Posted April 27, 2012 It works here, when I hit the marker, the window is shown with the vehicle. Link to comment
yMassai Posted April 27, 2012 Author Share Posted April 27, 2012 how i do from create the car and automatically warping the player? Link to comment
Castillo Posted April 27, 2012 Share Posted April 27, 2012 triggerServerEvent -- To trigger a server side event. createVehicle -- To create the vehicle. warpPedIntoVehicle -- To warp the player to the vehicle. Link to comment
yMassai Posted April 27, 2012 Author Share Posted April 27, 2012 function carrosCreateClick ( ) if ( source == carrosCreate ) then triggerServerEvent ( "testCreateTest", localPlayer ) testDestroyTestGUI ( ) end addEventHandler ( "onClientGUIClick", root, carrosCreateClick ) carrosVehicle = createVehicle ( ??, 1543,98962 , -1670,46398 , 13,0213 ) warpPedIntoVehicle ( carrosVehicle ) I use these arguments? Link to comment
yMassai Posted April 27, 2012 Author Share Posted April 27, 2012 local carrosCreate = { } if ( isElement ( carrosVehicle[ source ] ) ) destroyElement ( carrosVehicle[ source ] ) this argument would be used to not create more than one car? Link to comment
Kenix Posted April 27, 2012 Share Posted April 27, 2012 Ninguem[ATZ] viewtopic.php?f=148&t=40809 https://wiki.multitheftauto.com/wiki/Scr ... troduction warpPedIntoVehicle server side only! 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