Xperia Posted January 15, 2013 Share Posted January 15, 2013 ¿Con que funciones puedo hacer un spawn? Link to comment
Arsilex Posted January 15, 2013 Share Posted January 15, 2013 ¿Con que funciones puedo hacer un spawn? spawnPlayer (source, 0, 0, 5, 0, modelo, 0, 0) fadeCamera(source, true, 5) setCameraTarget ( source ,source ) Link to comment
Xperia Posted January 15, 2013 Author Share Posted January 15, 2013 Me explique mal, me refiero a hacer un Spawn Panel, con sus teams privados, y teams publicos, y skin selector(me explique mal). Link to comment
Arsilex Posted January 15, 2013 Share Posted January 15, 2013 con un panel 1 triger y un boton y esas funciones e.e Link to comment
Xperia Posted January 15, 2013 Author Share Posted January 15, 2013 ¿Y si quiero hacer que un skin se muestre? Link to comment
Castillo Posted January 15, 2013 Share Posted January 15, 2013 Crea un ped con createPed Link to comment
Xperia Posted January 15, 2013 Author Share Posted January 15, 2013 function ped() local w, h = guiGetScreenSize () local x, y, z = getWorldFromScreenPosition ( w/2, h/2, 10 ) createPed ( 285, x, y, z ) end ¿Estaria bien asi? Link to comment
Castillo Posted January 15, 2013 Share Posted January 15, 2013 La unica manera de saberlo es probandolo. P.D: Te falta algo para ejecutar la funcion esa. Link to comment
Xperia Posted January 15, 2013 Author Share Posted January 15, 2013 Ahora, tengo esto: ventana = guiCreateWindow(1086,15,269,635,"Spawn",false) guiSetAlpha(ventana,0.94999998807907) guiWindowSetMovable(ventana,false) guiWindowSetSizable(ventana,false) grid_skins = guiCreateGridList(13,482,244,144,false,ventana) guiGridListSetSelectionMode(grid_skins,2) guiGridListAddColumn(grid_skins," ",0.95) rowSkin1 = guiGridListAddRow(grid_skins) rowSkin2 = guiGridListAddRow(grid_skins) grid_city = guiCreateGridList(13,51,244,188,false,ventana) guiGridListSetSelectionMode(grid_city,2) columnCity = guiGridListAddColumn(grid_city,"San Andreas",0.95) rowCitySF = guiGridListAddRow(grid_city) guiGridListSetItemText ( grid_city, rowCitySF, columnCity, "San Francisco", false, false ) rowCityLS = guiGridListAddRow(grid_city) guiGridListSetItemText ( grid_city, rowCityLS, columnCity, "Los Santos", false, false ) grid_groups = guiCreateGridList(13,269,244,188,false,ventana) guiGridListSetSelectionMode(grid_groups,2) columnGroups = guiGridListAddColumn(grid_groups," ",0.95) groups_name = guiCreateLabel(112,246,88,23,"Groups",false,ventana) guiSetFont(groups_name,"default-bold-small") skins_name = guiCreateLabel(118,461,88,23,"Skins",false,ventana) guiSetFont(skins_name,"default-bold-small") city_name = guiCreateLabel(117,30,88,23,"City",false,ventana) guiSetFont(city_name,"default-bold-small") spawn_button = guiCreateButton(1088,654,266,99,"Spawn",false) guiSetFont(spawn_button,"default-bold-small") info = guiCreateMemo(375,653,653,101,"",false) guiMemoSetReadOnly(info,true) guiSetVisible ( ventana , true ) showCursor ( true ) function name1() if rowCitySF then rowGroupsPolice = guiGridListAddRow(grid_groups) guiGridListSetItemText ( grid_groups, rowGroupsPolice, columnGroups, "Police", false, false ) end end addEventHandler("onClientGUIClick",getRootElement(),name1) El error es que al hacer click en "cualquier sitio del GUI", crea el row "Police" y se crea tantas veces como clicks des, y yo solo quiero que lo cree 1 vez, y solo al pulsar "San Francisco". Link to comment
Castillo Posted January 15, 2013 Share Posted January 15, 2013 function name1 ( ) if ( rowCitySF ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local cityName = guiGridListGetItemText ( source, row, 1 ) if ( cityName == "San Francisco" ) then guiGridListClear ( grid_groups ) rowGroupsPolice = guiGridListAddRow ( grid_groups ) guiGridListSetItemText ( grid_groups, rowGroupsPolice, columnGroups, "Police", false, false ) end end end end addEventHandler ( "onClientGUIClick", grid_city, name1, false ) Link to comment
Xperia Posted January 15, 2013 Author Share Posted January 15, 2013 Gracias Castillo, si tengo algun error mas, lo posteare. Link to comment
Xperia Posted January 16, 2013 Author Share Posted January 16, 2013 (edited) Ahora cuando estoy con otro user en el server, y yo spawneo, el no puede porque no le aparece el panel. x, y = guiGetScreenSize() ventana = guiCreateWindow(x*0.7950219619326501,y*0.01953125,x*0.1969253294289898,y*0.8268229166666667,"Spawn",false) guiSetAlpha(ventana,0.94999998807907) guiWindowSetMovable(ventana,false) guiWindowSetSizable(ventana,false) grid_skins = guiCreateGridList(x*0.0095168374816984,y*0.6276041666666667,x*0.1786237188872621,y*0.1875,false,ventana) guiGridListSetSelectionMode(grid_skins,2) columnSkins = guiGridListAddColumn(grid_skins," ",0.95) grid_city = guiCreateGridList(x*0.0095168374816984,y*0.06640625,x*0.1786237188872621,y*0.2447916666666667,false,ventana) guiGridListSetSelectionMode(grid_city,2) columnCity = guiGridListAddColumn(grid_city,"San Andreas",0.95) rowCitySF = guiGridListAddRow(grid_city) guiGridListSetItemText ( grid_city, rowCitySF, columnCity, "San Francisco", false, false ) rowCityLS = guiGridListAddRow(grid_city) guiGridListSetItemText ( grid_city, rowCityLS, columnCity, "Los Santos", false, false ) grid_groups = guiCreateGridList(x*0.0095168374816984,y*0.3502604166666667,x*0.1786237188872621,y*0.2447916666666667,false,ventana) guiGridListSetSelectionMode(grid_groups,2) columnGroups = guiGridListAddColumn(grid_groups," ",0.95) Edited January 28, 2013 by Guest Link to comment
Castillo Posted January 16, 2013 Share Posted January 16, 2013 function test(player) guiSetVisible ( ventana , false ) guiSetVisible ( spawn_button , false ) guiSetVisible ( info , false ) showCursor ( false ) end addEventHandler("onClientPlayerSpawn",localPlayer,test) function test2(localPlayer) guiSetVisible ( ventana , true ) guiSetVisible ( spawn_button , true ) guiSetVisible ( info , true ) showCursor ( true ) end addEventHandler("onClientPlayerWasted",localPlayer,test2) Link to comment
Xperia Posted January 17, 2013 Author Share Posted January 17, 2013 Gracias Solid. ¿Y como puedo quitar la camara que sale cuando un jugador muere o pone /kill? Link to comment
Xperia Posted January 17, 2013 Author Share Posted January 17, 2013 Min 1:28 EDIT: Ya lo he arreglado y esta to hecho, gracias por ayudarme. Link to comment
Xperia Posted January 18, 2013 Author Share Posted January 18, 2013 (edited) Ahora le quiero poner armas, y tengo esto, pero me dice "bad argument #1 to unpack", en la linea 30. Edited January 28, 2013 by Guest Link to comment
Alexs Posted January 18, 2013 Share Posted January 18, 2013 Creo que no entiendes bien el uso de las tablas, te dejo un link para que revises por que esta mal: http://lua-users.org/wiki/TablesTutorial Link to comment
Xperia Posted January 18, 2013 Author Share Posted January 18, 2013 ¿Que funcion puedo usar para coger la ID de un arma? Link to comment
Alexs Posted January 18, 2013 Share Posted January 18, 2013 getPedWeapon getWeaponIDFromName Link to comment
Julian09123 Posted January 18, 2013 Share Posted January 18, 2013 Una cosa mas facil.Descargate el spawn de mta (resource) y editalo como tu quieras cambia las coordenadas, skins etc https://community.multitheftauto.com/ind ... ls&id=1152 Link to comment
Otto Posted January 18, 2013 Share Posted January 18, 2013 Una cosa mas facil.Descargate el spawn de mta (resource) y editalo como tu quieras cambia las coordenadas, skins etchttps://community.multitheftauto.com/ind ... ls&id=1152 A bue. El gusto está en hacerlo, si todos editarían otros resources sin permiso, todo sería una anarquía y dejarían de compartirse los resources. Link to comment
Recommended Posts