Jump to content

Ajuda Nesse script aqui


Death

Recommended Posts

Posted

Esse script estou fazendo para mandar Pm usando ID do jogador tipo quero mandar uma mensagem eu uzo /pm ID

so preciso saber porque não ta funcionando se alguem puder me ajudar ficarei muito grato

function PmMessage(source, cmd, id, ...) 
 if id and ... then 
  local words = { ... } 
  local message = table.concat(words, " ") 
  local playerName = call "getPlayerNameFromID", tonumber(id)) 
  local sourceID = getElementData(source, "id") 
   if (getPlayerFromName(playerName) ~= source) then 
    if playerName then 
     if getElementData(source,"PmSpam") ~= 1 then 
      outputChatBox("[PM]["..getPlayerName(source).."]["..tostring(sourceID).."]: "..message, getPlayerFromName(playerName),255,219,61) 
      outputChatBox("[PM]["..playerName.."]["..id.."]: "..message, source,255,219,61) 
      setElementData(source,"PmSpam",1) 
      setTimer(stopTimerAntiSpam, 3000,1,source) 
     else 
      outputChatBox("#0044FF[PM]: #FFFFFF Erro", source, 0, 0, 0,true)    
     end 
    else     
     outputChatBox("#0044FF[PM]: #FFFFFF Voçê não pode mandar mensagem pra vc mesmo!", source, 0, 0, 0,true) 
    end  
   end    
 else 
  outputChatBox("#0044FF[PM]: #FFFFFF erro siga a sintax '/pm [iD] [Mensagem]'!", source, 0, 0, 0,true) 
 end  
end 
addCommandHandler("pm", PmMessage) 
  
function stopTimerAntiSpam(source) 
setElementData(source,"PmSpam", nil) 
end 
  

Posted

Eu duvido que você escreveu esse script (como você disse que está fazendo).

Na linha 5, a função call está errada. Use: local playerName = call( getResourceFromName("resource"), "exportedFunction", tonumber(id) ).

resource: o recurso que está a função a ser chamada.

exportedFunction: o nome da função que está no recurso.

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

Falei para você estudar Lua antes de começar a fazer qualquer coisa.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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