Men muchas gracias por tu ayuda despues de esto ultimo no te molesto mas .. como hago para agregarlo a los demas botones ? intento hacerlo y me sale el mismo boton de primeras !
Esta es la funcion de Server
function greetingHandler(Arma, Precio)
--Chequear si tiene suficiente dinero if getPlayerMoney(source) > Precio then takePlayerMoney(source, 200) giveWeapon(source, 22, 1) outputChatBox("Arma comprada!", source, 0, 255, 0) else outputChatBox("No tienes suficiente dinero!", source, 255, 0, 0) return end end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", getRootElement (), greetingHandler ) ------------------------------------------------------------------------------------------------------------------------ function ArmpaP(Arma1, Precio1) --Chequear si tiene suficiente dinero if getPlayerMoney(source) > Precio1 then takePlayerMoney(source, 100) giveWeapon(source, 22, 100) outputChatBox("Arma comprada!", source, 0, 255, 0) else outputChatBox("No tienes suficiente dinero!", source, 255, 0, 0) return end end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", getRootElement (), ArmpaP )
Este es el client que pena las molestias pero enserio te lo agradeceria hermano
local marker = createMarker(250.08346557630,1846.0504150310,7.7681446075410, "cylinder", 2, 255, 0, 0, 255, 30)
local blip = createBlip ( 249.08346557617,1847.0504150391,8.7681446075439, 18 ) function abrir(hitElement) Ventana = guiCreateWindow(515, 152, 484, 632, "Panel Armas", false) guiWindowSetSizable(Ventana, false) ArmaP = guiCreateButton(25, 64, 122, 143, "Arma 1", false, Ventana) Armap50 = guiCreateButton(188, 64, 122, 143, "Municion 50 balas", false, Ventana) Armap100 = guiCreateButton(346, 64, 122, 143, "Municion 100 Balas", false, Ventana) ArmaS = guiCreateButton(25, 281, 122, 143, "Arma 2", false, Ventana) ArmaS50 = guiCreateButton(188, 281, 122, 143, "Municion 50 Balas", false, Ventana) ArmaS100 = guiCreateButton(346, 281, 122, 143, "Municion 100 Balas", false, Ventana) mensaje1 = guiCreateMemo(22, 219, 130, 52, "Costo : $150", false, Ventana) guiMemoSetReadOnly(mensaje1, true) mensaje2 = guiCreateMemo(188, 219, 130, 52, "Costo: $100", false, Ventana) guiMemoSetReadOnly(mensaje2, true) mensaje3 = guiCreateMemo(346, 219, 129, 52, "Costo: 90$", false, Ventana) guiMemoSetReadOnly(mensaje3, true) mensaje4 = guiCreateMemo(22, 434, 130, 52, "Costo: $100", false, Ventana) guiMemoSetReadOnly(mensaje4, true) mensaje5 = guiCreateMemo(188, 434, 130, 52, "Costo: $90", false, Ventana) guiMemoSetReadOnly(mensaje5, true) mensaje6 = guiCreateMemo(344, 434, 130, 52, "Costo: $110", false, Ventana) guiMemoSetReadOnly(mensaje6, true) Cerrar = guiCreateButton(74, 510, 318, 94, "CERRAR", false, Ventana) guiSetFont(Cerrar, "sa-header") guiSetProperty(Cerrar, "NormalTextColour", "FFFF0000") showCursor(true) addEventHandler ("onClientGUIClick", Cerrar, Exit, false) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then guiSetVisible(Ventana, true) showCursor(true) outputChatBox ( "Bienvenido a la tienda de armas!!", 255, 0, 0 ) end end addEventHandler("onClientMarkerHit", marker, abrir) function Exit () showCursor (false) guiSetVisible (Ventana, not guiGetVisible ( Ventana ) ) end function armap1() if source == ArmaP then Precio = 150 Arma = 22 triggerServerEvent("onGreeting", getLocalPlayer(), Arma, Precio) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), armap1) function Arma50() if source == Armap50 then Precio1 = 100 Arma1 = 22 triggerServerEvent("onGreeting", getLocalPlayer(), Arma1, Precio1) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), Arma50)