Saltar al contenido

Hardcore123

Usuario
  • Contenido

    6
  • Ingreso

  • Última visita

Todo lo publicado por Hardcore123

  1. 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)
  2. Ya me ha servido ahora lo que no se es como ponerle el precio a las armas y que me selgan los diferentes mensajes porfavor ayudame!
  3. como puedo hacer que a el comprar el arma se descuente dinero y que al comprarla salga el mensaje que la ha comprado y el de no tienes suficiente dinero 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 : $50", false, Ventana) guiMemoSetReadOnly(mensaje1, true) mensaje2 = guiCreateMemo(188, 219, 130, 52, "Costo: $50", 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", ArmaP, armap1, false) 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 armap1 () showCursor (true) local pMoney = getPlayerMoney(source) if pMoney >= 50 then takePlayerMoney ( 50 ) setPlayerWeaponSlot(localPlayer, tonumber( guiGetText ( edit ) )) outputChatBox ( "Has comprado el arma", 0, 255, 0 ) else outputChatBox ( "No tienes Dinero!", 255, 0, 0 ) triggerServerEvent ( "onGreeting", getRootElement() ) end end function Exit() showCursor (false) guiSetVisible (Ventana, not guiGetVisible ( Ventana ) ) end
  4. Muchas gracias si me sirvio :3 que pena la molestia pero quisiera saber como hacer para que se abra con un marker ! me paro en el marker y que se abra muchas gracias
  5. Lo se y gracias pero el problema es cuando ejecuto el comando el panel no me abre y me dice en la consola: ERROR: Panel\client.lua:2: attempt to call global 'guiCreateWindow' <a nil value> Si me puedes ayudar con eso te lo agradeceria
  6. function Kmilo() panel = guiCreateWindow(406, 167, 596, 611, "Panel de Armas", false) guiWindowSetSizable(panel, false) ARMA1 = guiCreateButton(28, 61, 220, 161, "Arma1", false, panel) guiSetFont(ARMA1, "sa-header") ARMA2 = guiCreateButton(353, 61, 220, 161, "arma2", false, panel) guiSetFont(ARMA2, "sa-header") cerrar = guiCreateButton(353, 300, 220, 161, "CERRAR", false, panel) guiSetFont(cerrar, "sa-header") ARMA3 = guiCreateButton(28, 300, 220, 161, "arma3", false, panel) guiSetFont(ARMA3, "sa-header") GUIEditor.memo[1] = guiCreateMemo(17, 482, 556, 105, "asdddddddddd", false, panel) guiMemoSetReadOnly(GUIEditor.memo[1], true) end addCommandHandler ("rps", Kmilo) Al ejecutarlo todo sale bien pero cuando pongo el comando me aparece lo siguiente ERROR: Panel\client.lua:2: attempt to call global 'guiCreateWindow' <a nil value> Se que el error esta en la linea 2 del client.lua Pero no entiendo por que ese es el error porfavor ayudenme esto lo hice con el Guieditor !
×
×
  • Crear nuevo...