yMassai Posted April 26, 2012 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! Community Profile MTA:SA = Click Here
Kenix Posted April 26, 2012 Posted April 26, 2012 /debugscript 3? http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Guest Guest4401 Posted April 26, 2012 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)
yMassai Posted April 26, 2012 Author 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? Community Profile MTA:SA = Click Here
Guest Guest4401 Posted April 26, 2012 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 )
yMassai Posted April 26, 2012 Author 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 Community Profile MTA:SA = Click Here
yMassai Posted April 26, 2012 Author Posted April 26, 2012 Thanks I will try here, I'm still learning. Community Profile MTA:SA = Click Here
yMassai Posted April 26, 2012 Author 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? Community Profile MTA:SA = Click Here
Guest Guest4401 Posted April 26, 2012 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 )
Castillo Posted April 26, 2012 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
yMassai Posted April 26, 2012 Author 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? Community Profile MTA:SA = Click Here
Castillo Posted April 26, 2012 Posted April 26, 2012 guiGridListAddRow -- To add the row. guiGridListSetItemText -- To set a row text. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
yMassai Posted April 26, 2012 Author 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 Community Profile MTA:SA = Click Here
Castillo Posted April 26, 2012 Posted April 26, 2012 1: What is "guIGrifListAddRow" ? 2: Why you're using getPlayerName if your script is about vehicles? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
yMassai Posted April 26, 2012 Author Posted April 26, 2012 Sorry but I error. if I Knew I would have produced the script. I'm trying to learn. Community Profile MTA:SA = Click Here
yMassai Posted April 27, 2012 Author 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 ) ?? Community Profile MTA:SA = Click Here
Castillo Posted April 27, 2012 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
yMassai Posted April 27, 2012 Author Posted April 27, 2012 error occurs because the arrow does not appear Community Profile MTA:SA = Click Here
Castillo Posted April 27, 2012 Posted April 27, 2012 It works here, when I hit the marker, the window is shown with the vehicle. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
yMassai Posted April 27, 2012 Author Posted April 27, 2012 how i do from create the car and automatically warping the player? Community Profile MTA:SA = Click Here
Castillo Posted April 27, 2012 Posted April 27, 2012 triggerServerEvent -- To trigger a server side event. createVehicle -- To create the vehicle. warpPedIntoVehicle -- To warp the player to the vehicle. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
yMassai Posted April 27, 2012 Author 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? Community Profile MTA:SA = Click Here
yMassai Posted April 27, 2012 Author 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? Community Profile MTA:SA = Click Here
Kenix Posted April 27, 2012 Posted April 27, 2012 Ninguem[ATZ] viewtopic.php?f=148&t=40809 https://wiki.multitheftauto.com/wiki/Scr ... troduction warpPedIntoVehicle server side only! http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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