Ir para conteúdo
  • 0

Pluzetti

Pergunta

Galera estou com esse script, mas eu ja tentei mudar para ele remover um item mas nao consigo, poderiam me ajudar?

 

 

function onSay(cid, words, param, channel)

local p = string.explode(param, ',')
local item_id = 2195
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
doPlayerRemoveItem(cid, item_id, 1)
return true
end
if(words == "/name") then
if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then
return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.")
elseif(isPlayerBanished(p[1], PLAYERBAN_LOCK)) then
return doPlayerSendCancel(cid, "Sorry, but " .. p[1] .. " is name locked.")
elseif(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[2]) .. ";"):getID() == 1) then
return doPlayerSendCancel(cid, "Sorry, but the name [" .. p[2] .. "] already exists.")
end
return db.executeQuery("UPDATE `players` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';") and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed " .. p[1] .. "'s name to " .. p[2] .. ".")
end
end

Item ID= 2145
Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0

toma testa ae.

 

function onSay(cid, words, param, channel)
local p = string.explode(param, ',')
local item_id = 2145
local item_count = 1     --Mude aqui a qnt de diamonds q vai remover do player.
local proibido = {"[", "{", "]", "}", "tutor", "gm", "cm", "god", "mapper", "scripter", "programador", "spriter", "account manager", "character"} -- simbolos proibidos
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
return true
end
if getPlayerItemCount(cid, item_id) <= 4 then
    return doPlayerSendCancel(cid, "vc precisa de 5 diamonds.")
end
if(string.find(param:lower(), "[^%l%s]") ~= nil) then
doPlayerSendCancel(cid, 20, "Voce nao pode usar simbolos no nome.")
return TRUE
end
    if getPlayerGroupId(p[1]) >= 3 then
        return doPlayerSendCancel(cid, "Você não pode alterar o nick de tutores, GMs, Subs e GODs.")
end
if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then
return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.")
elseif(isPlayerBanished(p[1], PLAYERBAN_LOCK)) then
return doPlayerSendCancel(cid, "Sorry, but " .. p[1] .. " is name locked.")
elseif(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[2]) .. ";"):getID() == 1) then
return doPlayerSendCancel(cid, "Sorry, but the name [" .. p[2] .. "] already exists.")
end
doPlayerRemoveItem(cid, item_id, item_count)
db.executeQuery("UPDATE `players` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';")
doPlayerSendTextMessage(cid, 20,  "You have changed " .. p[1] .. "'s name to " .. p[2] .. " You will be logged out in 5 seconds.")
addEvent(doRemoveCreature, 5*1000, cid, true)
return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

Esse erro...

 

 

[04/11/2013 20:28:01] [Error - TalkAction Interface]
[04/11/2013 20:28:01] data/talkactions/scripts/name.lua:onSay
[04/11/2013 20:28:01] Description:
[04/11/2013 20:28:01] (luaDoPlayerSendCancel) Player not found
Link para o comentário
Compartilhar em outros sites

  • 0

vacilo meu lek, toma.

 

function onSay(cid, words, param, channel)
local p = string.explode(param, ',')
local item_id = 2145
local item_count = 1     --Mude aqui a qnt de diamonds q vai remover do player.
local proibido = {"[", "{", "]", "}", "tutor", "gm", "cm", "god", "mapper", "scripter", "programador", "spriter", "account manager", "character"} -- simbolos proibidos
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
return true
end
if getPlayerItemCount(cid, item_id) <= 4 then
    return doPlayerSendCancel(cid, "vc precisa de 5 diamonds.")
end
if(string.find(param:lower(), "[^%l%s]") ~= nil) then
doPlayerSendTextMessage(cid, 20, "Voce nao pode usar simbolos no nome.")
return TRUE
end
    if getPlayerGroupId(p[1]) >= 3 then
        return doPlayerSendCancel(cid, "Você não pode alterar o nick de tutores, GMs, Subs e GODs.")
end
if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then
return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.")
elseif(isPlayerBanished(p[1], PLAYERBAN_LOCK)) then
return doPlayerSendCancel(cid, "Sorry, but " .. p[1] .. " is name locked.")
elseif(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[2]) .. ";"):getID() == 1) then
return doPlayerSendCancel(cid, "Sorry, but the name [" .. p[2] .. "] already exists.")
end
doPlayerRemoveItem(cid, item_id, item_count)
db.executeQuery("UPDATE `players` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';")
doPlayerSendTextMessage(cid, 20,  "You have changed " .. p[1] .. "'s name to " .. p[2] .. " You will be logged out in 5 seconds.")
addEvent(doRemoveCreature, 5*1000, cid, true)
return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

Desculpe reabrir o tópico mas olhem foi encontrado hoje cedo.

 

[11/11/2013 10:04:06] [Error - TalkAction Interface]
[11/11/2013 10:04:06] data/talkactions/scripts/name.lua:onSay
[11/11/2013 10:04:06] Description:
[11/11/2013 10:04:06] (luaDoPlayerSendTextMessage) Player not found
Script:
function onSay(cid, words, param, channel)
local p = string.explode(param, ',')
local item_id = 2145
local item_count = 5     --Mude aqui a qnt de diamonds q vai remover do player.
local proibido = {"[", "{", "]", "}", "tutor", "gm", "cm", "god", "mapper", "scripter", "programador", "spriter", "account manager", "character"} -- simbolos proibidos
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
return true
end
if getPlayerItemCount(cid, item_id) <= 4 then
    return doPlayerSendCancel(cid, "You Don't Have 5 Diamonds, Please Buy In Shop.")
end
if getCreatureName(cid) ~= p[1] then
return doPlayerSendCancel(cid, "Sorry, not is possible.")
end
if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then
return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.")
elseif(isPlayerBanished(p[1], PLAYERBAN_LOCK)) then
return doPlayerSendCancel(cid, "Sorry, but " .. p[1] .. " is name locked.")
elseif(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[2]) .. ";"):getID() == 1) then
return doPlayerSendCancel(cid, "Sorry, but the name [" .. p[2] .. "] already exists.")
end
doPlayerRemoveItem(cid, item_id, item_count)
db.executeQuery("UPDATE `players` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';")
doPlayerSendTextMessage(cid, 20,  "You have changed " .. p[1] .. "'s name to " .. p[2] .. " You will be logged out in 5 seconds.")
addEvent(doRemoveCreature, 5*1000, cid, true)
return true
end

Queria assim:

 

O player Kevin, nao pode trocar o nome do player Joao

 

E ão pode usar sinais nem nomes de staff tipo: Mapper, Hoster...quando eu falo o comando da esse erro ae oq pode ser?

Editado por Pluzetti
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...