Ir para conteúdo
  • 0

Comando >> /cb


BrunooMaciell

Pergunta

Eu queria deixa o comando >> /cb quando o ADM usa-lo pra cria o pokemon dentro da ball que a ball vinha so de ultra ball.

 

Tipo: /cb charizard 

 

Ai vinha um charizard dentro de uma ultra ball

 

Quando o ADM ou STAFF que seja usar o comando ela so vinha com pokemons dentro de ultra ball

 

Rep++

 

SCRIPT >> /CB

function onSay(cid, words, param)

local typess = {
[1] = "normal",
[2] = "great",
[3] = "super",
[4] = "ultra"
}

if param == "" then
doPlayerSendCancel(cid, 'Command needs parameters, function structure: "/cb [Pokemon Name], [boost], [Gender]".')
return 0
end

local t = string.explode(param, ",")

local name = ""
local gender = 0
local btype = typess[math.random(1, 4)]                --"normal"
local typeee = typess[math.random(1, 4)]

if t[1] then
	local n = string.explode(t[1], " ")
	local str = string.sub(n[1], 1, 1)
	local sta = string.sub(n[1], 2, string.len(n[1]))
	name = ""..string.upper(str)..""..string.lower(sta)..""
	if n[2] then
	str = string.sub(n[2], 1, 1)
	sta = string.sub(n[2], 2, string.len(n[2]))
	name = name.." "..string.upper(str)..""..string.lower(sta)..""
	end
	if not pokes[name] then
	doPlayerSendCancel(cid, "Sorry, a pokemon with the name "..name.." doesn't exists.")
	return true
	end
print(""..name.." ball has been created by "..getPlayerName(cid)..".")
end

local genders = {
["male"] = 4,
["female"] = 3,
["1"] = 4,
["0"] = 3}

if t[3] then
	if genders[t[3]] then
		gender = genders[t[3]]
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
	end
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
end

local mypoke = pokes[name]
local happy = 255

local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", name)
doItemSetAttribute(item, "hp", 1)
if t[2] and tonumber(t[2]) > 0 and tonumber(t[2]) <= 50 then
   doItemSetAttribute(item, "boost", tonumber(t[2]))
end
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
if name == "Shiny Hitmonchan" or name == "Hitmonchan" then
   doItemSetAttribute(item, "hands", 0)
end
doItemSetAttribute(item, "description", "Contains a "..name..".")


doItemSetAttribute(item, "addon", 0)
doItemSetAttribute(item, "fakedesc", "Contains a "..name..".")
local x = icons[getItemAttribute(item, "poke")]
	    doPlayerAddItemEx(cid, item, true)		
		doItemSetAttribute(item, "ball", "Icone")
		doItemSetAttribute(item, "icon", "yes")
		doItemSetAttribute(item, "morta", "no")
	    doTransformItem(item, x.on)		
return 1
end

Rep+++

Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0
function onSay(cid, words, param)

local typess = {
[1] = "normal",
[2] = "great",
[3] = "super",
[4] = "ultra"
}

if param == "" then
doPlayerSendCancel(cid, 'Command needs parameters, function structure: "/cb [Pokemon Name], [boost], [Gender]".')
return 0
end

local t = string.explode(param, ",")

local name = ""
local gender = 0
local btype = pokeballs["ultra"].on                --"normal"
local typeee = typess[math.random(1, 4)]

if t[1] then
	local n = string.explode(t[1], " ")
	local str = string.sub(n[1], 1, 1)
	local sta = string.sub(n[1], 2, string.len(n[1]))
	name = ""..string.upper(str)..""..string.lower(sta)..""
	if n[2] then
	str = string.sub(n[2], 1, 1)
	sta = string.sub(n[2], 2, string.len(n[2]))
	name = name.." "..string.upper(str)..""..string.lower(sta)..""
	end
	if not pokes[name] then
	doPlayerSendCancel(cid, "Sorry, a pokemon with the name "..name.." doesn't exists.")
	return true
	end
print(""..name.." ball has been created by "..getPlayerName(cid)..".")
end

local genders = {
["male"] = 4,
["female"] = 3,
["1"] = 4,
["0"] = 3}

if t[3] then
	if genders[t[3]] then
		gender = genders[t[3]]
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
	end
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
end

local mypoke = pokes[name]
local happy = 255

local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", name)
doItemSetAttribute(item, "hp", 1)
if t[2] and tonumber(t[2]) > 0 and tonumber(t[2]) <= 50 then
   doItemSetAttribute(item, "boost", tonumber(t[2]))
end
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
if name == "Shiny Hitmonchan" or name == "Hitmonchan" then
   doItemSetAttribute(item, "hands", 0)
end
doItemSetAttribute(item, "description", "Contains a "..name..".")


doItemSetAttribute(item, "addon", 0)
doItemSetAttribute(item, "fakedesc", "Contains a "..name..".")
	    doPlayerAddItemEx(cid, item, true)		
		doItemSetAttribute(item, "ball", "Icone")
		doItemSetAttribute(item, "icon", "yes")
		doItemSetAttribute(item, "morta", "no")
	    doTransformItem(item, btype)		
return 1
end

 

Link para o comentário
Compartilhar em outros sites

  • 0

aqui esta.. mas pelo que vi aqui, usa icone, então nem vai mudar nada..

function onSay(cid, words, param)

if param == "" then
doPlayerSendCancel(cid, 'Command needs parameters, function structure: "/cb [Pokemon Name], [boost], [Gender]".')
return 0
end

local t = string.explode(param, ",")

local name = ""
local gender = 0
local btype = "ultra"                --"normal"
local typeee = typess[math.random(1, 4)]

if t[1] then
	local n = string.explode(t[1], " ")
	local str = string.sub(n[1], 1, 1)
	local sta = string.sub(n[1], 2, string.len(n[1]))
	name = ""..string.upper(str)..""..string.lower(sta)..""
	if n[2] then
	str = string.sub(n[2], 1, 1)
	sta = string.sub(n[2], 2, string.len(n[2]))
	name = name.." "..string.upper(str)..""..string.lower(sta)..""
	end
	if not pokes[name] then
	doPlayerSendCancel(cid, "Sorry, a pokemon with the name "..name.." doesn't exists.")
	return true
	end
print(""..name.." ball has been created by "..getPlayerName(cid)..".")
end

local genders = {
["male"] = 4,
["female"] = 3,
["1"] = 4,
["0"] = 3}

if t[3] then
	if genders[t[3]] then
		gender = genders[t[3]]
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
	end
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
end

local mypoke = pokes[name]
local happy = 255

local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", name)
doItemSetAttribute(item, "hp", 1)
if t[2] and tonumber(t[2]) > 0 and tonumber(t[2]) <= 50 then
   doItemSetAttribute(item, "boost", tonumber(t[2]))
end
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
if name == "Shiny Hitmonchan" or name == "Hitmonchan" then
   doItemSetAttribute(item, "hands", 0)
end
doItemSetAttribute(item, "description", "Contains a "..name..".")


doItemSetAttribute(item, "addon", 0)
doItemSetAttribute(item, "fakedesc", "Contains a "..name..".")
local x = icons[getItemAttribute(item, "poke")]
	    doPlayerAddItemEx(cid, item, true)		
		doItemSetAttribute(item, "ball", "Icone")
		doItemSetAttribute(item, "icon", "yes")
		doItemSetAttribute(item, "morta", "no")
	    doTransformItem(item, x.on)		
return 1
end

 

Link para o comentário
Compartilhar em outros sites

  • 0
32 minutos atrás, Deadpool disse:

aqui esta.. mas pelo que vi aqui, usa icone, então nem vai mudar nada..


function onSay(cid, words, param)

if param == "" then
doPlayerSendCancel(cid, 'Command needs parameters, function structure: "/cb [Pokemon Name], [boost], [Gender]".')
return 0
end

local t = string.explode(param, ",")

local name = ""
local gender = 0
local btype = "ultra"                --"normal"
local typeee = typess[math.random(1, 4)]

if t[1] then
	local n = string.explode(t[1], " ")
	local str = string.sub(n[1], 1, 1)
	local sta = string.sub(n[1], 2, string.len(n[1]))
	name = ""..string.upper(str)..""..string.lower(sta)..""
	if n[2] then
	str = string.sub(n[2], 1, 1)
	sta = string.sub(n[2], 2, string.len(n[2]))
	name = name.." "..string.upper(str)..""..string.lower(sta)..""
	end
	if not pokes[name] then
	doPlayerSendCancel(cid, "Sorry, a pokemon with the name "..name.." doesn't exists.")
	return true
	end
print(""..name.." ball has been created by "..getPlayerName(cid)..".")
end

local genders = {
["male"] = 4,
["female"] = 3,
["1"] = 4,
["0"] = 3}

if t[3] then
	if genders[t[3]] then
		gender = genders[t[3]]
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
	end
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
end

local mypoke = pokes[name]
local happy = 255

local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", name)
doItemSetAttribute(item, "hp", 1)
if t[2] and tonumber(t[2]) > 0 and tonumber(t[2]) <= 50 then
   doItemSetAttribute(item, "boost", tonumber(t[2]))
end
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
if name == "Shiny Hitmonchan" or name == "Hitmonchan" then
   doItemSetAttribute(item, "hands", 0)
end
doItemSetAttribute(item, "description", "Contains a "..name..".")


doItemSetAttribute(item, "addon", 0)
doItemSetAttribute(item, "fakedesc", "Contains a "..name..".")
local x = icons[getItemAttribute(item, "poke")]
	    doPlayerAddItemEx(cid, item, true)		
		doItemSetAttribute(item, "ball", "Icone")
		doItemSetAttribute(item, "icon", "yes")
		doItemSetAttribute(item, "morta", "no")
	    doTransformItem(item, x.on)		
return 1
end

 

ue nao uso nao aqui ta sem icone ta normal kkkkkkkkkkkk

 

mas vo testa sua script 

 

Deu Este BUG @Deadpool

 

[08/08/2020 17:55:22] [Error - TalkAction Interface] 
[08/08/2020 17:55:22] data/talkactions/scripts/createpokeball.lua:onSay
[08/08/2020 17:55:22] Description: 
[08/08/2020 17:55:22] data/talkactions/scripts/createpokeball.lua:13: attempt to index global 'typess' (a nil value)
[08/08/2020 17:55:22] stack traceback:
[08/08/2020 17:55:22] 	data/talkactions/scripts/createpokeball.lua:13: in function <data/talkactions/scripts/createpokeball.lua:1>

 

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

  • 0

erro meu ^^

 

Spoiler

function onSay(cid, words, param)

if param == "" then
doPlayerSendCancel(cid, 'Command needs parameters, function structure: "/cb [Pokemon Name], [boost], [Gender]".')
return 0
end

local t = string.explode(param, ",")

local name = ""
local gender = 0
local btype = "ultra"              
local typeee = "ultra" 

if t[1] then
	local n = string.explode(t[1], " ")
	local str = string.sub(n[1], 1, 1)
	local sta = string.sub(n[1], 2, string.len(n[1]))
	name = ""..string.upper(str)..""..string.lower(sta)..""
	if n[2] then
	str = string.sub(n[2], 1, 1)
	sta = string.sub(n[2], 2, string.len(n[2]))
	name = name.." "..string.upper(str)..""..string.lower(sta)..""
	end
	if not pokes[name] then
	doPlayerSendCancel(cid, "Sorry, a pokemon with the name "..name.." doesn't exists.")
	return true
	end
print(""..name.." ball has been created by "..getPlayerName(cid)..".")
end

local genders = {
["male"] = 4,
["female"] = 3,
["1"] = 4,
["0"] = 3}

if t[3] then
	if genders[t[3]] then
		gender = genders[t[3]]
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
	end
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
end

local mypoke = pokes[name]
local happy = 255

local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", name)
doItemSetAttribute(item, "hp", 1)
if t[2] and tonumber(t[2]) > 0 and tonumber(t[2]) <= 50 then
   doItemSetAttribute(item, "boost", tonumber(t[2]))
end
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
if name == "Shiny Hitmonchan" or name == "Hitmonchan" then
   doItemSetAttribute(item, "hands", 0)
end
doItemSetAttribute(item, "description", "Contains a "..name..".")


doItemSetAttribute(item, "addon", 0)
doItemSetAttribute(item, "fakedesc", "Contains a "..name..".")
local x = icons[getItemAttribute(item, "poke")]
	    doPlayerAddItemEx(cid, item, true)		
		doItemSetAttribute(item, "ball", "Icone")
		doItemSetAttribute(item, "icon", "yes")
		doItemSetAttribute(item, "morta", "no")
	    doTransformItem(item, x.on)		
return 1
end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0
32 minutos atrás, Deadpool disse:

erro meu ^^

 

  Ocultar conteúdo


function onSay(cid, words, param)

if param == "" then
doPlayerSendCancel(cid, 'Command needs parameters, function structure: "/cb [Pokemon Name], [boost], [Gender]".')
return 0
end

local t = string.explode(param, ",")

local name = ""
local gender = 0
local btype = "ultra"              
local typeee = "ultra" 

if t[1] then
	local n = string.explode(t[1], " ")
	local str = string.sub(n[1], 1, 1)
	local sta = string.sub(n[1], 2, string.len(n[1]))
	name = ""..string.upper(str)..""..string.lower(sta)..""
	if n[2] then
	str = string.sub(n[2], 1, 1)
	sta = string.sub(n[2], 2, string.len(n[2]))
	name = name.." "..string.upper(str)..""..string.lower(sta)..""
	end
	if not pokes[name] then
	doPlayerSendCancel(cid, "Sorry, a pokemon with the name "..name.." doesn't exists.")
	return true
	end
print(""..name.." ball has been created by "..getPlayerName(cid)..".")
end

local genders = {
["male"] = 4,
["female"] = 3,
["1"] = 4,
["0"] = 3}

if t[3] then
	if genders[t[3]] then
		gender = genders[t[3]]
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
	end
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
end

local mypoke = pokes[name]
local happy = 255

local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", name)
doItemSetAttribute(item, "hp", 1)
if t[2] and tonumber(t[2]) > 0 and tonumber(t[2]) <= 50 then
   doItemSetAttribute(item, "boost", tonumber(t[2]))
end
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
if name == "Shiny Hitmonchan" or name == "Hitmonchan" then
   doItemSetAttribute(item, "hands", 0)
end
doItemSetAttribute(item, "description", "Contains a "..name..".")


doItemSetAttribute(item, "addon", 0)
doItemSetAttribute(item, "fakedesc", "Contains a "..name..".")
local x = icons[getItemAttribute(item, "poke")]
	    doPlayerAddItemEx(cid, item, true)		
		doItemSetAttribute(item, "ball", "Icone")
		doItemSetAttribute(item, "icon", "yes")
		doItemSetAttribute(item, "morta", "no")
	    doTransformItem(item, x.on)		
return 1
end

 

 

Nao funcionou =/

 

Nao deu ERRO nem nada porem quando crio ou uso o /cb ele cria com poke ball normal =/ 

Link para o comentário
Compartilhar em outros sites

  • 0
43 minutos atrás, lSainty disse:

function onSay(cid, words, param)

local typess = {
[1] = "normal",
[2] = "great",
[3] = "super",
[4] = "ultra"
}

if param == "" then
doPlayerSendCancel(cid, 'Command needs parameters, function structure: "/cb [Pokemon Name], [boost], [Gender]".')
return 0
end

local t = string.explode(param, ",")

local name = ""
local gender = 0
local btype = pokeballs["ultra"].on                --"normal"
local typeee = typess[math.random(1, 4)]

if t[1] then
	local n = string.explode(t[1], " ")
	local str = string.sub(n[1], 1, 1)
	local sta = string.sub(n[1], 2, string.len(n[1]))
	name = ""..string.upper(str)..""..string.lower(sta)..""
	if n[2] then
	str = string.sub(n[2], 1, 1)
	sta = string.sub(n[2], 2, string.len(n[2]))
	name = name.." "..string.upper(str)..""..string.lower(sta)..""
	end
	if not pokes[name] then
	doPlayerSendCancel(cid, "Sorry, a pokemon with the name "..name.." doesn't exists.")
	return true
	end
print(""..name.." ball has been created by "..getPlayerName(cid)..".")
end

local genders = {
["male"] = 4,
["female"] = 3,
["1"] = 4,
["0"] = 3}

if t[3] then
	if genders[t[3]] then
		gender = genders[t[3]]
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
	end
	else
	local rate = newpokedex[name].gender
		if rate == 0 then
			gender = 3
		elseif rate == 1000 then
			gender = 4
		elseif rate == -1 then
			gender = 0
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
end

local mypoke = pokes[name]
local happy = 255

local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", name)
doItemSetAttribute(item, "hp", 1)
if t[2] and tonumber(t[2]) > 0 and tonumber(t[2]) <= 50 then
   doItemSetAttribute(item, "boost", tonumber(t[2]))
end
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
if name == "Shiny Hitmonchan" or name == "Hitmonchan" then
   doItemSetAttribute(item, "hands", 0)
end
doItemSetAttribute(item, "description", "Contains a "..name..".")


doItemSetAttribute(item, "addon", 0)
doItemSetAttribute(item, "fakedesc", "Contains a "..name..".")
	    doPlayerAddItemEx(cid, item, true)		
		doItemSetAttribute(item, "ball", "Icone")
		doItemSetAttribute(item, "icon", "yes")
		doItemSetAttribute(item, "morta", "no")
	    doTransformItem(item, btype)		
return 1
end

 

Deu certo ^^

 

vlw ? 

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...