Ir para conteúdo

Featured Replies

Postado

bom dia, eu dou o comando pra adicionar pontos a alguém, só q no final adiciona a minha própria conta, oq está de errado ??

  Citar

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_ORANGE, "Player " .. param .. " is not currently online.")
return TRUE
end
if not(split[2]) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The commands requires 2 parameters: character name, amount")
end
if not(count) then
print(count)
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Numeric parameter required.")
end
doPlayerAddotfunPoints(cid, count)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "" .. count .. " otfun points were added to " .. getPlayerAccount(cid) .. "\'s Account.")
return true
end

 

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

Resolvido por Vodkart

Ir para solução
Postado
  • Autor

 

bom dia, agora está adicionando a conta do player, só q a msg q aparece pra mim, q ainda está adicionando a minha conta, como faz para msg aparecer q foi adicionada a conta do player msm, exemplo eu dou comando está aparecendo 50 otfun points were added to kallos's Account, sendo que a do player é sthenos..

 

  Em 15/01/2019 em 13:13, Vodkart disse:

o certo é 'pid' e nao 'cid'

 

doPlayerAddotfunPoints(pid, count)

 

 

 

Postado
  • Solução

@BilauX 

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

 

Postado
  • Autor

 

pow muito obrigado @Vodkart  eu não sei quase nada de lua, mais baseado no seu script eu msm consertei o de remover, muito obrigado mais uma vez..

 

  Em 15/01/2019 em 13:31, Vodkart disse:

@BilauX 

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

 

 

 

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

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo