Jump to content

Ayuda


JesusAliso

Recommended Posts

Posted
Eso iba a decir, mejor utiliza esa. Este sería el código.
local Marker = createMarker ( 1294.7626953125, -1379.625, 13.486034584045, "corona",1.5,90,253,70,163) 
      
    function comprar (thePlayer) 
       funcion = setElementHealth ( thePlayer, getElementHealth(thePlayer) + 20 ) 
       outputChatBox ("Presiona Z para comprar Armor!", getRootElement(), 8, 224, 13 ) 
    end 
    addEventHandler ( "onMarkerHit", Marker, comprar ) 
  
    function armor( player, 20 ) 
    end 
    addEventHandler ( "onMarkerHit", Marker, armor ) 
       bindKey("z","down","comprar") 

Prueba este.

    function armor( player, 20 ) 
    end 
    addEventHandler ( "onMarkerHit", Marker, armor ) 
       bindKey("z","down","comprar") 

Que onda con eso?. Ademas El mensaje del chat , se lo mostraria a todos los players.

  • Replies 74
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Okei probá con algo así, talvez te sirva

function check (thePlayer) 
   if ( isElementWithinMarker( thePlayer, Marker ) ) then 
   --Acá le das la vida 
   end 
end 
bindKey("F1, "down", check) 
  
 
Posted
Okei probá con algo así, talvez te sirva

function check (thePlayer) 
   if ( isElementWithinMarker( thePlayer, Marker ) ) then 
   --Acá le das la vida 
   end 
end 
bindKey("F1, "down", check) 
  
  
 

Tu código está mal.

function check (thePlayer) 
   if ( isElementWithinMarker( thePlayer, Marker ) ) then 
   --Acá le das la vida-- 
   end 
end 
bindKey("z", "down", check) 
  

Te faltaba una comilla en Bindkey.

Posted

En resume. Si no te anda agregale un end creo e.é

function check (thePlayer) 
   if ( isElementWithinMarker( thePlayer, Marker ) ) then 
       outputChatBox ("Preciona Z para comprar el armor!", thePlayer, 8, 224, 13 ) 
        local money = getPlayerMoney(thePlayer) 
           if (money > 1000) then 
             setPlayerArmor ( thePlayer, 20 ) 
             else 
             outputChatBox ("No tienes Dinero para comprar Armor!", thePlayer, 8, 224, 13 ) 
   end 
end 
bindKey("z", "down", check) 
  

Posted

Hacé lo que te dijo Alvarez o lo que te dije Yo. Gracias @EstrategiaGTA , No me habia dado cuenta ( eso me pasa por escribir rapido.) xD

Posted
Marker = createMarker ( 1294.7626953125, -1379.625, 13.486034584045, "corona",1.5,90,253,70,163) 
  
function check (thePlayer) 
   if ( isElementWithinMarker( thePlayer, Marker ) ) then 
       outputChatBox ("Preciona Z para comprar el armor!", thePlayer, 8, 224, 13 ) 
        local money = getPlayerMoney(thePlayer) 
           if (money > 1000) then 
             setPlayerArmor ( thePlayer, 10 ) 
             else 
             outputChatBox ("No tienes Dinero para comprar Armor!", thePlayer, 8, 224, 13 ) 
   end 
end 
bindKey("z", "down", check) 
end 

Hay esta lo pobre como dijo AlvareZ y le tube que agregar "end" y nada no tira errror entro al marker tampoco dice el outPutChatBox...

Posted
Marker = createMarker ( 1294.7626953125, -1379.625, 13.486034584045, "corona",1.5,90,253,70,163) 
  
function check (thePlayer) 
   if ( isElementWithinMarker( thePlayer, Marker ) ) then 
       outputChatBox ("Preciona Z para comprar el armor!", thePlayer, 8, 224, 13 ) 
        local money = getPlayerMoney(thePlayer) 
           if (money > 1000) then 
             setPedArmor ( thePlayer, 10 ) 
             else 
             outputChatBox ("No tienes Dinero para comprar Armor!", thePlayer, 8, 224, 13 ) 
   end 
end 
end 
bindKey("z", "down", check) 

Posted

a ver esto.

Marker = createMarker ( 1294.7626953125, -1379.625, 13.486034584045, "corona",1.5,90,253,70,163) 
  
function check (thePlayer, source) 
   if ( isElementWithinMarker( thePlayer, Marker ) ) then 
       outputChatBox ("Preciona Z para comprar el armor!", source, 8, 224, 13 ) 
        local money = getPlayerMoney(thePlayer) 
           if (money > 1000) then 
             setPedArmor ( thePlayer, 10 ) 
             else 
             outputChatBox ("No tienes Dinero para comprar Armor!", source, 8, 224, 13 ) 
   end 
end 
end 
bindKey("z", "down", check) 

Posted

Y todas esas funciones se pueden usar en server side. Ademas esta para server side xq usas thePlayer y en client no estaria definido. Prueba poniendolo en server.

Posted (edited)

No lo cambie y aun sigue diciendo :Lua:14: Bad argument @ bindKey

Bueno intente cambiarlo y lo puse arriva del ultimo "end" el bindKey y no tiro error Pero cuando entro al Marker no dice el outputchatbox...

Marker = createMarker ( 1294.7626953125, -1379.625, 13.486034584045, "corona",1.5,90,253,70,163) 
  
function check (thePlayer, source) 
   if ( isElementWithinMarker( thePlayer, Marker ) ) then 
       outputChatBox ("Preciona Z para comprar el armor!", source, 8, 224, 13 ) 
        local money = getPlayerMoney(thePlayer) 
           if (money > 1000) then 
             setPedArmor ( thePlayer, 10 ) 
             else 
             outputChatBox ("No tienes Dinero para comprar Armor!", source, 8, 224, 13 ) 
   end 
end 
bindKey(thePlayer, "z", "down", check) 
end 
  

Edited by Guest
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...