Jump to content

ayuda con mi script


Flipi

Recommended Posts

Hola, tengo un problema con la parte de la funcion cuests con message (linea 17), ya que no me funciona al escribir...ejemplo "!ayuda" ........(lo puse en server-side)...

server:

local msgs = { 'necesita ayuda', 'es noob', 'es malo' } 
local msgss = { 'Carabinero', 'Bachelet', 'Holy Fuuu' } 
local msgsss = { 'No tengo idea', 'Que te ayude tu vieja', 'Mala cuea' }  
  
function cuest( player,text ) 
 local texts = msgs [ math.random ( 1, #msgs )] 
 local texts2 = msgss [ math.random ( 1, #msgss )] 
 local texts3 = msgsss [ math.random ( 1, #msgsss )] 
        if text then 
            outputChatBox ("* #FF8000[Ayuda] #FFFFFF"..getPlayerName(player).." #0080FFpide ayuda porque: #FFFFFF" ..texts.. "#0080FF!", getRootElement(), 255, 255, 255, true ) 
            outputChatBox ("* #FF8000"..texts2.." #0080FFle da la solucion: #FFFFFF" ..texts3.. "#0080FF!", getRootElement(), 255, 255, 255, true )  
end 
end 
addCommandHandler ( "ayuda", cuest) 
addCommandHandler ( "jelp", cuest) 
  
function cuests(player,message,messageType,text) 
 if message == "!ayuda" or message =="!jelp" then 
 local texts = msgs [ math.random ( 1, #msgs )] 
 local texts2 = msgss [ math.random ( 1, #msgss )] 
 local texts3 = msgsss [ math.random ( 1, #msgsss )] 
    if text then 
            outputChatBox ("* #FF8000[Ayuda] #FFFFFF"..getPlayerName(player).." #0080FFpide ayuda porque: #FFFFFF" ..texts.. "#0080FF!", getRootElement(), 255, 255, 255, true ) 
            outputChatBox ("* #FF8000"..texts2.." #0080FFle da la solucion: #FFFFFF" ..texts3.. "#0080FF!", getRootElement(), 255, 255, 255, true )  
    end 
end 
end 
addEventHandler("onPlayerChat",getRootElement(),cuests) 

Link to comment
function cuests(player,message,messageType,text) 

Ese es el problema, onPlayerChat solo tiene 2 argumentos: mensaje, tipoDeMensaje.

Borra 'player' de ahi y tambien 'text'.

Luego cambia 'player' por 'source' en las otras funciones ( getPlayerName, etc ).

asi?

function cuests(message,messageType) 
 if message == "!ayuda" or message =="!jelp" then 
 local texts = msgs [ math.random ( 1, #msgs )] 
 local texts2 = msgss [ math.random ( 1, #msgss )] 
 local texts3 = msgsss [ math.random ( 1, #msgsss )] 
    if text then 
            outputChatBox ("* #FF8000[Ayuda] #FFFFFF"..getPlayerName(source).." #0080FFpide ayuda porque: #FFFFFF" ..texts.. "#0080FF!", getRootElement(), 255, 255, 255, true ) 
            outputChatBox ("* #FF8000"..texts2.." #0080FFle da la solucion: #FFFFFF" ..texts3.. "#0080FF!", getRootElement(), 255, 255, 255, true )  
    end 
end 
end 
addEventHandler("onPlayerChat",getRootElement(),cuests) 

Link to comment
Si, pero, donde esta definido 'text'?

lo puse asi, pero tampoco funciona... o como tendria que ser?

function cuests(message,messageType,text) 
 if message == "!ayuda" or message =="!jelp" then 
 local texts = msgs [ math.random ( 1, #msgs )] 
 local texts2 = msgss [ math.random ( 1, #msgss )] 
 local texts3 = msgsss [ math.random ( 1, #msgsss )] 
    if text then 
            outputChatBox ("* #FF8000[Ayuda] #FFFFFF"..getPlayerName(source).." #0080FFpide ayuda porque: #FFFFFF" ..texts.. "#0080FF!", getRootElement(), 255, 255, 255, true ) 
            outputChatBox ("* #FF8000"..texts2.." #0080FFle da la solucion: #FFFFFF" ..texts3.. "#0080FF!", getRootElement(), 255, 255, 255, true ) 
    end 
end 
end 
addEventHandler("onPlayerChat",getRootElement(),cuests) 

Link to comment
Eso es porque 'text' es siempre nil, no deberias usar 'texts'?

no entiendo :(

function cuests(message,messageType) 
 if message == "!ayuda" or message =="!jelp" then 
 local texts = msgs [ math.random ( 1, #msgs )] 
 local texts2 = msgss [ math.random ( 1, #msgss )] 
 local texts3 = msgsss [ math.random ( 1, #msgsss )] 
            outputChatBox ("* #FF8000[Ayuda] #FFFFFF"..getPlayerName(source).." #0080FFpide ayuda porque: #FFFFFF" ..texts.. "#0080FF!", getRootElement(), 255, 255, 255, true ) 
            outputChatBox ("* #FF8000"..texts2.." #0080FFle da la solucion: #FFFFFF" ..texts3.. "#0080FF!", getRootElement(), 255, 255, 255, true ) 
end 
end 
addEventHandler("onPlayerChat",getRootElement(),cuests) 

Link to comment
function cuests(message,messageType) 
 if message == "!ayuda" or message =="!jelp" then 
 local texts = msgs [ math.random ( 1, #msgs )] 
 local texts2 = msgss [ math.random ( 1, #msgss )] 
 local texts3 = msgsss [ math.random ( 1, #msgsss )] 
            outputChatBox ("* #FF8000[Ayuda] #FFFFFF"..getPlayerName(source).." #0080FFpide ayuda porque: #FFFFFF" ..texts.. "#0080FF!", getRootElement(), 255, 255, 255, true ) 
            outputChatBox ("* #FF8000"..texts2.." #0080FFle da la solucion: #FFFFFF" ..texts3.. "#0080FF!", getRootElement(), 255, 255, 255, true ) 
end 
end 
addEventHandler("onPlayerChat",getRootElement(),cuests) 

era solo quitar el text?, gracias :D!!

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...