Ir para conteúdo

Featured Replies

  • Respostas 8
  • Visualizações 2.5k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @Vodkart obrigado pela atenção. o script continua dando a storage a apenas players online  caso o player esteja offline esta dando este erro  

  • function onSay(cid, words, param) local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true

Postado
  • Autor

@Vodkart poderia dar uma ajudinha com isso?
estou conseguindo colocar a storage apenas em players online

script

Spoiler

function onSay(cid, words, param)
    local t = string.explode(param, ",")
    if(not t[2]) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
        return true
    end

    local tid = getPlayerByNameWildcard(t[1])
    if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
        return true
    end

    if(not t[3]) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, " [" .. t[1] .. " - " .. t[2] .. "] = " .. getPlayerStorageValue(tid, t[2]))
    else
        setPlayerStorageValue(tid, t[2], t[3])
    end

    return true
end

 

Postado
function onSay(cid, words, param)
  local t = string.explode(param, ",")
  if(not t[2]) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
    return true
  end
  local tid = getPlayerByNameWildcard(t[1])
  if not tid and not getPlayerGUIDByName(t[1]) then
    doPlayerSendCancel(cid, "Você deve digitar um Nome Válido.") return true
  end
  if tid then
    setPlayerStorageValue(tid, t[2], t[3])
  else
    local Guid = getPlayerGUIDByName(t[1])
    local Query = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = ".. Guid .." AND `key` = ".. t[2])
    if (Query:getID() ~= -1) then
      db.executeQuery("UPDATE `player_storage` SET  'value' = "..t[3].." WHERE `player_id` = ".. Guid .." AND `key` = "..t[2])
    else
	db.executeQuery("INSERT `player_storage` SET `key` = "..t[2]..", 'value' = "..t[3]..", WHERE `player_id` = " .. Guid)
    end
  end
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Storage mudada com sucesso.")
  return true
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor

@Vodkart

obrigado pela atenção.
o script continua dando a storage a apenas players online 
caso o player esteja offline esta dando este erro

Spoiler

mysql_real_query(): INSERT `player_storage` SET `key` = 963369, 'value' = 10, WHERE `player_id` = 19 - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''value' = 10, WHERE `player_id` = 19' at line 1 (1064)


 

Editado por wevertonvrb (veja o histórico de edições)

Postado
function onSay(cid, words, param)
  local t = string.explode(param, ",")
  if(not t[2]) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
    return true
  end
  local tid = getPlayerByNameWildcard(t[1])
  if not tid and not getPlayerGUIDByName(t[1]) then
    doPlayerSendCancel(cid, "Você deve digitar um Nome Válido.") return true
  end
  if tid then
    setPlayerStorageValue(tid, t[2], t[3])
  else
    local Guid = getPlayerGUIDByName(t[1])
    local Query = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = ".. Guid .." AND `key` = ".. t[2])
    if (Query:getID() ~= -1) then
      db.executeQuery("UPDATE `player_storage` SET  `value` = "..t[3].." WHERE `player_id` = ".. Guid .." AND `key` = "..t[2])
    else
	db.executeQuery("INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (" .. Guid .. ", " .. t[2] .. ", " .. t[3] .. ");")
    end
  end
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Storage mudada com sucesso.")
  return true
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo