Ir para conteúdo
  • 0

Ajuda Talkation Nao Adiciona Points Na Db


96736649

Pergunta

TALK:

 

 

 

function onSay(cid, words, param, channel)

local split = param:explode(",")

local name, count = split[1], tonumber(split[2])

pid = getPlayerByNameWildcard(name)

if (not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")

return TRUE

end

if not(split[2]) then

return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The commands requires 2 parameters: character name, amount")

end

if not(count) then

print(count)

return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Numeric parameter required.")

end

doAccountAddPoints(cid, count)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. count .. " premium points were added to " .. getCreatureName(pid) .. "\'s Account.")

return true

end

éla nao está adicionando pontos na acc marcada:S

Link para o comentário
Compartilhar em outros sites

13 respostass a esta questão

Posts Recomendados

  • 0

LIB:

 

 

function getAccountPoints(cid)

local res = db.getResult('select `premium_points` from accounts where name = \''..getPlayerAccount(cid)..'\'')

if(res:getID() == -1) then

return false

end

local ret = res:getDataInt("premium_points")

res:free()

return tonumber(ret)

end

 

function doAccountAddPoints(cid, count)

return db.executeQuery("UPDATE `accounts` SET `premium_points` = '".. getAccountPoints(cid) + count .."' WHERE `name` ='"..getPlayerAccount(cid).."'")

end

 

function doAccountRemovePoints(cid, count)

return db.executeQuery("UPDATE `accounts` SET `premium_points` = '".. getAccountPoints(cid) - count .."' WHERE `name` ='"..getPlayerAccount(cid).."'")

end

 

Ele esta adicionando pontos a conta do gm, e nao do player :S

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

  • 0

Mais o script ta feito para o player adicionar na conta dele!

Eu queria que modificasse o script para o GOD adicionar na conta dele

mais toda ves que falo /addpoints NOMEDOPLAYER, valor O VALOR vai pra conta do god

e não para a conta do player

Link para o comentário
Compartilhar em outros sites

  • 0
function onSay(cid, words, param, channel)
local split = param:explode(",")
local name, count = split[1], tonumber(split[2])
pid = getPlayerByNameWildcard(name)
if (not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
return TRUE
end
if not(split[2]) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The commands requires 2 parameters: character name, amount")
end
if not(count) then
print(count)
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Numeric parameter required.")
end
doAccountAddPoints(pid, count)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. count .. " premium points were added to " .. getCreatureName(pid) .. "\'s Account.")
return true
end

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

×
×
  • Criar Novo...