JesusAliso Posted March 23, 2013 Share Posted March 23, 2013 Que necesitaría para crear esto : https://community.multitheftauto.com/ind ... &pic=10432 pero sin el "addCommandHandler" y uzar "onMarkerHit". No se puede modificar ese recurso, si me pueden ayudar enviándome los comandos gracias Link to comment
AlvareZ_ Posted March 23, 2013 Share Posted March 23, 2013 De seguro esta codificado, Mejor crea el tuyo aca todo lo necesario: guiCreateWindow guiCreateButton guiSetVisible onClientGUIClick triggerServerEvent triggerClientEvent takePlayerMoney onMarkerHit Link to comment
JesusAliso Posted March 23, 2013 Author Share Posted March 23, 2013 ok gracias intentare. les avisare Link to comment
JesusAliso Posted March 23, 2013 Author Share Posted March 23, 2013 local myWindow = guiCreateWindow ( 0, 0, 0.5, 0.4, "Tienda de Armas", true Me sale error "attemp to call global "guiCreateWindow" que significa esto? Link to comment
Plate Posted March 23, 2013 Share Posted March 23, 2013 Te falta cerrar el parentecis y por que mejor no usar el guiEditor? https://community.multitheftauto.com/index.php?p=resources&s=details&id=141 Link to comment
FraN-724 Posted March 23, 2013 Share Posted March 23, 2013 local myWindow = guiCreateWindow ( 0, 0, 0.5, 0.4, "Tienda de Armas", true) Link to comment
JesusAliso Posted March 24, 2013 Author Share Posted March 24, 2013 ok, usare el Gui editor Link to comment
FraN-724 Posted March 24, 2013 Share Posted March 24, 2013 Aquí un vídeo de como usar más o menos el guieditor por si no sabes. Link to comment
JesusAliso Posted March 24, 2013 Author Share Posted March 24, 2013 Ahaha me leíste la mente estaba buscando como usarlo ! Link to comment
FraN-724 Posted March 24, 2013 Share Posted March 24, 2013 Lo suponía, por eso lo puse. Link to comment
JesusAliso Posted March 24, 2013 Author Share Posted March 24, 2013 Le puse el parentesis y Sigue tirándome el mismo error GUIEditor_Window[1] = guiCreateWindow(243,181,555,488,"Tienda de Armas/Weapon Shop",false) es esa linea Link to comment
JesusAliso Posted March 24, 2013 Author Share Posted March 24, 2013 Perdon lo tenia Serverside Link to comment
JesusAliso Posted March 24, 2013 Author Share Posted March 24, 2013 bueno el error de "a nil value" Era por que lo tenia en la meta "Server" lo cambie a "Client" y si funciono, pero ahora lo hice todo como yo creo que esta bien. pero no crea el "Marker" y no lo e podido probar por que no se crear el marker Aquí dejo el script Marker = createMarker ( 1294.6767578125, -1337.5, 17.860641479492, "cylinder", 1.5, 255, 0, 0, 255 ) function tienda() Window = guiCreateWindow(243,181,555,488,"Tienda de Armas/Weapon Shop",false) imagen4 = guiCreateStaticImage(0.0595,0.0902,0.2414,0.2172,"images/SNIPER.png",true,Window) imagen3 = guiCreateStaticImage(0.618,0.1004,0.2577,0.207,"images/M4.png",true,Window) imagen2 = guiCreateStaticImage(0.6505,0.5861,0.2306,0.2582,"images/MP5.png",true,Window) imagen1 = guiCreateStaticImage(0.0865,0.5922,0.2126,0.2275,"images/GRENADE.png",true,Window) Sniper = guiCreateButton(0.0631,0.3217,0.2324,0.1352,"Sniper/Costo:155000$",true,Window) M4 = guiCreateButton(0.6144,0.3217,0.2523,0.127,"M4/Costo:120000$",true,Window) Grenade = guiCreateButton(0.0649,0.8525,0.2559,0.1291,"Grenade/Costo:20000$x1",true,Window) MP5 = guiCreateButton(0.6432,0.8504,0.2685,0.1311,"MP5/Costo:25000$",true,Window) Cerrar = guiCreateButton(0.355,0.5082,0.2162,0.168,"Cerrar/Close",true,Window) showCursor ( true ) addEventHandler ( "onClientGUIClick", Cerrar, Salir, false ) addEventHandler ( "onClientGUIClick", M4, arma1, false ) addEventHandler ( "onClientGUIClick", Sniper, arma2, false ) addEventHandler ( "onClientGUIClick", Grenade, arma3, false ) addEventHandler ( "onClientGUIClick", MP5, arma4, false ) end function Salir() guiSetVisible (Window, not guiGetVisible ( Window ) ) end function arma1() local money = getPlayerMoney ( thePlayer ) if money >= 120000 then takePlayerMoney ( thePlayer, 120000 ) giveWeapon ( source, 31, 2880 ) end function arma2() local money = getPlayerMoney ( thePlayer ) if money >= 155000 then takePlayerMoney ( thePlayer, 155000 ) giveWeapon ( source, 34, 100 ) end function arma3() local money = getPlayerMoney ( thePlayer ) if money >= 20000 then takePlayerMoney ( thePlayer, 20000 ) giveWeapon ( source, 16, 1 ) end function arma4() local money = getPlayerMoney ( thePlayer ) if money >= 25000 then takePlayerMoney ( thePlayer, 25000 ) giveWeapon ( source, 29, 99 ) end addEventHandler ("onMarkerHit", Marker, tienda) Me dicen el error y que tengo que hacer para arreglarlo por favor.((eso de trigger no se para que era por que no entiendo nada de eso si me lo pueden explicar estaría bien))) Me dicen por que no se crea el "marker" no les puedo decir si funciono o no, por que no lo e podido probar por el "Marker". ahhhhh Perdón por no explicarme bien es para que entiendan mejor. espero que lo lean . ya que son las 1:36 de la madrugada no les responderé tan rápido me levantare tarde :L les responderé como a las 10 am o 12 pm. Link to comment
JesusAliso Posted March 24, 2013 Author Share Posted March 24, 2013 creo que ya aprendí lo del trigger. No se que me paso pero me llego a la mente ._. Client local Marker = createMarker ( 1294.6767578125, -1337.5, 17.860641479492, "cylinder", 1.5, 255, 0, 0, 255 ) function tienda() Window = guiCreateWindow(243,181,555,488,"Tienda de Armas/Weapon Shop",false) imagen4 = guiCreateStaticImage(0.0595,0.0902,0.2414,0.2172,"images/SNIPER.png",true,Window) imagen3 = guiCreateStaticImage(0.618,0.1004,0.2577,0.207,"images/M4.png",true,Window) imagen2 = guiCreateStaticImage(0.6505,0.5861,0.2306,0.2582,"images/MP5.png",true,Window) imagen1 = guiCreateStaticImage(0.0865,0.5922,0.2126,0.2275,"images/GRENADE.png",true,Window) Sniper = guiCreateButton(0.0631,0.3217,0.2324,0.1352,"Sniper/Costo:155000$",true,Window) M4 = guiCreateButton(0.6144,0.3217,0.2523,0.127,"M4/Costo:120000$",true,Window) Grenade = guiCreateButton(0.0649,0.8525,0.2559,0.1291,"Grenade/Costo:20000$x1",true,Window) MP5 = guiCreateButton(0.6432,0.8504,0.2685,0.1311,"MP5/Costo:25000$",true,Window) Cerrar = guiCreateButton(0.355,0.5082,0.2162,0.168,"Cerrar/Close",true,Window) showCursor ( true ) addEventHandler ( "onClientGUIClick", Cerrar, Salir, false ) addEventHandler ( "onClientGUIClick", M4, arma1, false ) addEventHandler ( "onClientGUIClick", Sniper, arma2, false ) addEventHandler ( "onClientGUIClick", Grenade, arma3, false ) addEventHandler ( "onClientGUIClick", MP5, arma4, false ) end function Salir() guiSetVisible (Window, not guiGetVisible ( Window ) ) showCursor ( false ) end function arma1() triggerServerEvent ( "arm1", getLocalPlayer() ) end function arma2() triggerServerEvent ( "arm2", getLocalPlayer() ) end function arma3() triggerServerEvent ( "arm3", getLocalPlayer() ) end function arma4() triggerServerEvent ( "arm4", getLocalPlayer() ) end function marker() triggerServerEvent ( "mark", getLocalPlayer() ) end addEventHandler ("onMarkerHit", Marker, tienda) Server function arm11 () local money = getPlayerMoney ( thePlayer ) if money >= 120000 then takePlayerMoney ( thePlayer, 120000 ) giveWeapon ( source, 31, 2880 ) end end addEvent( "arm1", true ) addEventHandler( "arm1", getRootElement(), arm11 ) function arm22 () local money = getPlayerMoney ( thePlayer ) if money >= 155000 then takePlayerMoney ( thePlayer, 155000 ) giveWeapon ( source, 34, 100 ) end end addEvent( "arm2", true ) addEventHandler( "arm2", getRootElement(), arm22 ) function arm33 () triggerServerEvent ( "arm3", getLocalPlayer() ) local money = getPlayerMoney ( thePlayer ) if money >= 20000 then takePlayerMoney ( thePlayer, 20000 ) giveWeapon ( source, 16, 1 ) end end addEvent( "arm3", true ) addEventHandler( "arm3", getRootElement(), arm33 ) function arm44 () local money = getPlayerMoney ( thePlayer ) if money >= 25000 then takePlayerMoney ( thePlayer, 25000 ) giveWeapon ( source, 29, 99 ) end end addEvent( "arm4", true ) addEventHandler( "arm4", getRootElement(), arm44 ) Bueno, aun no se crea el "Marker", osea el marker para que cuando entre al Marker salga la ventana (tienda)bueno espero que me ayuden me dio un sueño PD: Solid Perdon por publicar 4 veces seguidas, y esto que lo acabo de editar :L es que no me salia para eliminar el "post" no me haran nada ? por esto"osea por los post" ._. Link to comment
FraN-724 Posted March 24, 2013 Share Posted March 24, 2013 Intenta así. Client : function tienda() Window = guiCreateWindow(243,181,555,488,"Tienda de Armas/Weapon Shop",false) imagen4 = guiCreateStaticImage(0.0595,0.0902,0.2414,0.2172,"images/SNIPER.png",true,Window) imagen3 = guiCreateStaticImage(0.618,0.1004,0.2577,0.207,"images/M4.png",true,Window) imagen2 = guiCreateStaticImage(0.6505,0.5861,0.2306,0.2582,"images/MP5.png",true,Window) imagen1 = guiCreateStaticImage(0.0865,0.5922,0.2126,0.2275,"images/GRENADE.png",true,Window) Sniper = guiCreateButton(0.0631,0.3217,0.2324,0.1352,"Sniper/Costo:155000$",true,Window) M4 = guiCreateButton(0.6144,0.3217,0.2523,0.127,"M4/Costo:120000$",true,Window) Grenade = guiCreateButton(0.0649,0.8525,0.2559,0.1291,"Grenade/Costo:20000$x1",true,Window) MP5 = guiCreateButton(0.6432,0.8504,0.2685,0.1311,"MP5/Costo:25000$",true,Window) Cerrar = guiCreateButton(0.355,0.5082,0.2162,0.168,"Cerrar/Close",true,Window) showCursor ( true ) addEventHandler ( "onClientGUIClick", Cerrar, Salir, false ) addEventHandler ( "onClientGUIClick", M4, arma1, false ) addEventHandler ( "onClientGUIClick", Sniper, arma2, false ) addEventHandler ( "onClientGUIClick", Grenade, arma3, false ) addEventHandler ( "onClientGUIClick", MP5, arma4, false ) end function Salir() guiSetVisible (Window, not guiGetVisible ( Window ) ) showCursor ( false ) end function arma1() triggerServerEvent ( "arm1", getLocalPlayer() ) end function arma2() triggerServerEvent ( "arm2", getLocalPlayer() ) end function arma3() triggerServerEvent ( "arm3", getLocalPlayer() ) end function arma4() triggerServerEvent ( "arm4", getLocalPlayer() ) end function marker() triggerServerEvent ( "mark", getLocalPlayer() ) end function showGUI () guiSetVisible (Window,true) showCursor (true) end addEvent ("showGUI",true) addEventHandler ("showGUI",getRootElement(),showGUI) Server: local Marker = createMarker ( 1294.6767578125, -1337.5, 17.860641479492, "cylinder", 1.5, 255, 0, 0, 255 ) function showGUI (thePlayer) if (source == Marker) then triggerClientEvent (thePlayer,"showGUI",getRootElement(),thePlayer) end end addEventHandler ("onMarkerHit",getRootElement(),showGUI) function arm11 () local money = getPlayerMoney ( thePlayer ) if money >= 120000 then takePlayerMoney ( thePlayer, 120000 ) giveWeapon ( source, 31, 2880 ) end end addEvent( "arm1", true ) addEventHandler( "arm1", getRootElement(), arm11 ) function arm22 () local money = getPlayerMoney ( thePlayer ) if money >= 155000 then takePlayerMoney ( thePlayer, 155000 ) giveWeapon ( source, 34, 100 ) end end addEvent( "arm2", true ) addEventHandler( "arm2", getRootElement(), arm22 ) function arm33 () triggerServerEvent ( "arm3", getLocalPlayer() ) local money = getPlayerMoney ( thePlayer ) if money >= 20000 then takePlayerMoney ( thePlayer, 20000 ) giveWeapon ( source, 16, 1 ) end end addEvent( "arm3", true ) addEventHandler( "arm3", getRootElement(), arm33 ) function arm44 () local money = getPlayerMoney ( thePlayer ) if money >= 25000 then takePlayerMoney ( thePlayer, 25000 ) giveWeapon ( source, 29, 99 ) end end addEvent( "arm4", true ) addEventHandler( "arm4", getRootElement(), arm44 ) Link to comment
EstrategiaGTA Posted March 24, 2013 Share Posted March 24, 2013 bueno el error de "a nil value" Era por que lo tenia en la meta "Server" lo cambie a "Client" y si funciono, pero ahora lo hice todo como yo creo que esta bien. pero no crea el "Marker" y no lo e podido probar por que no se crear el markerAquí dejo el script Marker = createMarker ( 1294.6767578125, -1337.5, 17.860641479492, "cylinder", 1.5, 255, 0, 0, 255 ) function tienda() Window = guiCreateWindow(243,181,555,488,"Tienda de Armas/Weapon Shop",false) imagen4 = guiCreateStaticImage(0.0595,0.0902,0.2414,0.2172,"images/SNIPER.png",true,Window) imagen3 = guiCreateStaticImage(0.618,0.1004,0.2577,0.207,"images/M4.png",true,Window) imagen2 = guiCreateStaticImage(0.6505,0.5861,0.2306,0.2582,"images/MP5.png",true,Window) imagen1 = guiCreateStaticImage(0.0865,0.5922,0.2126,0.2275,"images/GRENADE.png",true,Window) Sniper = guiCreateButton(0.0631,0.3217,0.2324,0.1352,"Sniper/Costo:155000$",true,Window) M4 = guiCreateButton(0.6144,0.3217,0.2523,0.127,"M4/Costo:120000$",true,Window) Grenade = guiCreateButton(0.0649,0.8525,0.2559,0.1291,"Grenade/Costo:20000$x1",true,Window) MP5 = guiCreateButton(0.6432,0.8504,0.2685,0.1311,"MP5/Costo:25000$",true,Window) Cerrar = guiCreateButton(0.355,0.5082,0.2162,0.168,"Cerrar/Close",true,Window) showCursor ( true ) addEventHandler ( "onClientGUIClick", Cerrar, Salir, false ) addEventHandler ( "onClientGUIClick", M4, arma1, false ) addEventHandler ( "onClientGUIClick", Sniper, arma2, false ) addEventHandler ( "onClientGUIClick", Grenade, arma3, false ) addEventHandler ( "onClientGUIClick", MP5, arma4, false ) end function Salir() guiSetVisible (Window, not guiGetVisible ( Window ) ) end function arma1() local money = getPlayerMoney ( thePlayer ) if money >= 120000 then takePlayerMoney ( thePlayer, 120000 ) giveWeapon ( source, 31, 2880 ) end function arma2() local money = getPlayerMoney ( thePlayer ) if money >= 155000 then takePlayerMoney ( thePlayer, 155000 ) giveWeapon ( source, 34, 100 ) end function arma3() local money = getPlayerMoney ( thePlayer ) if money >= 20000 then takePlayerMoney ( thePlayer, 20000 ) giveWeapon ( source, 16, 1 ) end function arma4() local money = getPlayerMoney ( thePlayer ) if money >= 25000 then takePlayerMoney ( thePlayer, 25000 ) giveWeapon ( source, 29, 99 ) end addEventHandler ("onMarkerHit", Marker, tienda) Me dicen el error y que tengo que hacer para arreglarlo por favor.((eso de trigger no se para que era por que no entiendo nada de eso si me lo pueden explicar estaría bien))) Me dicen por que no se crea el "marker" no les puedo decir si funciono o no, por que no lo e podido probar por el "Marker". ahhhhh Perdón por no explicarme bien es para que entiendan mejor. espero que lo lean . ya que son las 1:36 de la madrugada no les responderé tan rápido me levantare tarde :L les responderé como a las 10 am o 12 pm. No te va a funcionar. Necesitas usar: triggerServerEvent o triggerClientEvent ¿Porqué? Pues, no puedes juntar funciones de server y de client... Ah, y si, el resource está compilado por mi. Link to comment
EstrategiaGTA Posted March 24, 2013 Share Posted March 24, 2013 De seguro esta codificado, Mejor crea el tuyo aca todo lo necesario: guiCreateWindow guiCreateButton guiSetVisible onClientGUIClick triggerServerEvent triggerClientEvent takePlayerMoney onMarkerHit También debe usar: getPlayerMoney Link to comment
FraN-724 Posted March 24, 2013 Share Posted March 24, 2013 También debe usar: getPlayerMoney Ya lo tiene incorporado. Link to comment
EstrategiaGTA Posted March 24, 2013 Share Posted March 24, 2013 También debe usar: getPlayerMoney Ya lo tiene incorporado. Ah, sí. Link to comment
Sasu Posted March 24, 2013 Share Posted March 24, 2013 Es simple hacer estos panels. Si estuviera en mi casa te lo hatia todo. Por que usas triggerServerEvent dentro de un server side? triggerServerEvent ( "arm3", getLocalPlayer() ) Link to comment
FraN-724 Posted March 24, 2013 Share Posted March 24, 2013 O, perdón, no me di cuenta de ese error. Ahora si. Server side: local Marker = createMarker ( 1294.6767578125, -1337.5, 17.860641479492, "cylinder", 1.5, 255, 0, 0, 255 ) function showGUI (thePlayer) if (source == Marker) then triggerClientEvent (thePlayer,"showGUI",getRootElement(),thePlayer) end end addEventHandler ("onMarkerHit",getRootElement(),showGUI) function arm11 () local money = getPlayerMoney ( thePlayer ) if money >= 120000 then takePlayerMoney ( thePlayer, 120000 ) giveWeapon ( source, 31, 2880 ) end end addEvent( "arm1", true ) addEventHandler( "arm1", getRootElement(), arm11 ) function arm22 () local money = getPlayerMoney ( thePlayer ) if money >= 155000 then takePlayerMoney ( thePlayer, 155000 ) giveWeapon ( source, 34, 100 ) end end addEvent( "arm2", true ) addEventHandler( "arm2", getRootElement(), arm22 ) function arm33 () local money = getPlayerMoney ( thePlayer ) if money >= 20000 then takePlayerMoney ( thePlayer, 20000 ) giveWeapon ( source, 16, 1 ) end end addEvent( "arm3", true ) addEventHandler( "arm3", getRootElement(), arm33 ) function arm44 () local money = getPlayerMoney ( thePlayer ) if money >= 25000 then takePlayerMoney ( thePlayer, 25000 ) giveWeapon ( source, 29, 99 ) end end addEvent( "arm4", true ) addEventHandler( "arm4", getRootElement(), arm44 ) Link to comment
Sasu Posted March 24, 2013 Share Posted March 24, 2013 takePlayerMoney ( thePlayer, 120000 ) giveWeapon ( source, 31, 2880 ) No estas definiendo thePlayer ni source. Link to comment
FraN-724 Posted March 24, 2013 Share Posted March 24, 2013 Solo le pone thePlayer entre medio de los () de la función y ya. Link to comment
Recommended Posts