andrex123 Posted July 19, 2012 Share Posted July 19, 2012 function comprararma (thePlayer) local detection = isElementWithinColShape ( thePlayer, comprararmamarker ) if detection then guiSetInputEnabled ( true) GUIEditor_Window[1] = guiCreateWindow(201,81,383,503,"Tienda de Armas",false) GUIEditor_Button[1] = guiCreateButton(18,68,339,41,"Ak-47 -- $5000",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(19,121,338,42,"M4 -- $6000",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(19,176,335,39,"Desert Eagle -- $3000",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(22,227,332,45,"Escopeta -- $4000",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(21,282,334,38,"Escopeta cortada -- $3500",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(24,332,327,33,"Escopeta de Guerra -- $6000",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(355,479,19,15,"X",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(20,459,250,22,"Tu dinero: ",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"default-bold-small") end end addCommandHandler ("comprar", comprararma) Link to comment
Castillo Posted July 19, 2012 Share Posted July 19, 2012 El primer argumento de addCommandHandler client side es el comando usado, borra 'thePlayer' del nombre de la funcion, y luego remplazalo en las otras funciones con 'localPlayer'. Link to comment
andrex123 Posted July 20, 2012 Author Share Posted July 20, 2012 Haci? function comprararma () local detection = isElementWithinColShape ( localPlayer, comprararmamarker ) if detection then guiSetInputEnabled ( true) GUIEditor_Window[1] = guiCreateWindow(201,81,383,503,"Tienda de Armas",false) GUIEditor_Button[1] = guiCreateButton(18,68,339,41,"Ak-47 -- $5000",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(19,121,338,42,"M4 -- $6000",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(19,176,335,39,"Desert Eagle -- $3000",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(22,227,332,45,"Escopeta -- $4000",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(21,282,334,38,"Escopeta cortada -- $3500",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(24,332,327,33,"Escopeta de Guerra -- $6000",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(355,479,19,15,"X",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(20,459,250,22,"Tu dinero: ",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"default-bold-small") end end addCommandHandler ("comprar", comprararma) Link to comment
andrex123 Posted July 20, 2012 Author Share Posted July 20, 2012 Aun no funciona....... u.u Link to comment
Castillo Posted July 20, 2012 Share Posted July 20, 2012 Es un marker no un colshape? Link to comment
Castillo Posted July 20, 2012 Share Posted July 20, 2012 Entonces tenes que obtener el colshape del marker primero con: getElementColShape. Link to comment
andrex123 Posted July 20, 2012 Author Share Posted July 20, 2012 GUIEditor_Image[1] = guiCreateStaticImage(1,314,250,184,"zombies.png",false) colmarker = getElementColShape ( amarker ) amarker = createMarker ( 222.19999694824, 1855.5999755859, 12.399999809265, "cylinder", 4, 255, 0, 0, 255) function armagui () local detection = isElementWithinColShape ( localPlayer, colmarker ) if detection then guiSetInputEnabled ( true) GUIEditor_Window[1] = guiCreateWindow(201,81,383,503,"Tienda de Armas",false) GUIEditor_Button[1] = guiCreateButton(18,68,339,41,"Ak-47 -- $5000",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(19,121,338,42,"M4 -- $6000",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(19,176,335,39,"Desert Eagle -- $3000",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(22,227,332,45,"Escopeta -- $4000",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(21,282,334,38,"Escopeta cortada -- $3500",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(24,332,327,33,"Escopeta de Guerra -- $6000",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(355,479,19,15,"X",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(20,459,250,22,"Tu dinero: ",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"default-bold-small") end end addCommandHandler ("comprar", armagui) ahy? Link to comment
Alexs Posted July 20, 2012 Share Posted July 20, 2012 al revez, lo estas consiguiendo antes de crearlo: GUIEditor_Image[1] = guiCreateStaticImage(1,314,250,184,"zombies.png",false) amarker = createMarker ( 222.19999694824, 1855.5999755859, 12.399999809265, "cylinder", 4, 255, 0, 0, 255) colmarker = getElementColShape ( amarker ) function armagui () local detection = isElementWithinColShape ( localPlayer, colmarker ) if detection then guiSetInputEnabled ( true) GUIEditor_Window[1] = guiCreateWindow(201,81,383,503,"Tienda de Armas",false) GUIEditor_Button[1] = guiCreateButton(18,68,339,41,"Ak-47 -- $5000",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(19,121,338,42,"M4 -- $6000",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(19,176,335,39,"Desert Eagle -- $3000",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(22,227,332,45,"Escopeta -- $4000",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(21,282,334,38,"Escopeta cortada -- $3500",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(24,332,327,33,"Escopeta de Guerra -- $6000",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(355,479,19,15,"X",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(20,459,250,22,"Tu dinero: ",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"default-bold-small") end end addCommandHandler ("comprar", armagui) Link to comment
iFoReX Posted July 20, 2012 Share Posted July 20, 2012 o tambien... GUIEditor_Image[1] = guiCreateStaticImage(1,314,250,184,"zombies.png",false) amarker = createMarker ( 222.19999694824, 1855.5999755859, 12.399999809265, "cylinder", 4, 255, 0, 0, 255) function armagui () if isElement(amarker) then colmarker = getElementColShape ( amarker ) local detection = isElementWithinColShape ( localPlayer, colmarker ) if detection then guiSetInputEnabled ( true) GUIEditor_Window[1] = guiCreateWindow(201,81,383,503,"Tienda de Armas",false) GUIEditor_Button[1] = guiCreateButton(18,68,339,41,"Ak-47 -- $5000",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(19,121,338,42,"M4 -- $6000",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(19,176,335,39,"Desert Eagle -- $3000",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(22,227,332,45,"Escopeta -- $4000",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(21,282,334,38,"Escopeta cortada -- $3500",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(24,332,327,33,"Escopeta de Guerra -- $6000",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(355,479,19,15,"X",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(20,459,250,22,"Tu dinero: ",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"default-bold-small") end end end addCommandHandler ("comprar", armagui) Link to comment
iFoReX Posted July 20, 2012 Share Posted July 20, 2012 Si, pero hay comprueba si el marker existe Link to comment
Alexs Posted July 20, 2012 Share Posted July 20, 2012 Si no lo destruye en ningun lado y se crea al iniciarse el recurso, ¿Para que comprobarlo? Link to comment
Alexs Posted July 20, 2012 Share Posted July 20, 2012 En realidad si, el muestra el script y nosotros lo ayudamos en esos parametros, si luego lo borra es su problema Link to comment
Recommended Posts