Ir para conteúdo

Featured Replies

Postado

então oque pega é o seguinte o script é de moto por action ao usar item, mas o jogador n pode usar se estiver com o pokémon solto ou se for free essa parte ta ok
mas ai o jogador vip tira o pokémon e sobe na moto ate ai ok, mas em seguida ele pode chamar o pokemon  eu quero q não possa chamar o pokémon mesmo depois de já ter subido na moto ou seja ele tem que descer da moto pra poder chamar o pokemon
outra coisa, se eu tirar essa parte que esta em vermelho o script funciona 100% porem qualquer jogador tanto free como vip pode usa-lo

Script

Spoiler

local function BikSpeedOn(cid, t)                  
setPlayerStorageValue(cid, t.s, t.speed)
doChangeSpeed(cid, -getCreatureSpeed(cid))
doChangeSpeed(cid, t.speed)
end

local function BikeSpeedOff(cid, t)
setPlayerStorageValue(cid, t.s, -1)
doRegainSpeed(cid)
end

local t = {text='Mount, Motobike!', dtext='Demount, Motobike!', s=5701, speed = 1000}

function onUse(cid, item, fromPosition, itemEx, toPosition)

 

local pos = getThingPos(cid)

if #getCreatureSummons(cid) >= 1 then
return doPlayerSendCancel(cid, "Return your pokemon.")
end

if not isPremium(cid) then
doPlayerSendTextMessage(cid,22,"Este item so pode ser usado por jogadores vip!") return false end

if getPlayerStorageValue(cid, 17002) >= 1 or getPlayerStorageValue(cid, 63216) >= 1 or
getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 75847) >= 1 or
getPlayerStorageValue(cid, 6598755) >= 1 or getPlayerStorageValue(cid, 6598756) >= 1 then   --alterado v1.9
   return doPlayerSendCancel(cid, "You can't do that right now.")
end

if getPlayerStorageValue(cid, t.s) <= 0 then
   doSendMagicEffect(pos, 177)
   doCreatureSay(cid, t.text, 19)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a motobike.')
   BikeSpeedOn(cid, t)
   if getPlayerSex(cid) == 1 then
      doSetCreatureOutfit(cid, {lookType = 2212}, -1)
   else
       doSetCreatureOutfit(cid, {lookType = 2212}, -1)
   end
else
   doSendMagicEffect(pos, 177)
   doCreatureSay(cid, t.dtext, 19)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a motobike.')
   BikeSpeedOff(cid, t)
   doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end

 

 

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

  • Respostas 8
  • Visualizações 360
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Não fica citando o code, só me marca usando (@)   local function BikeSpeedOn(cid, t) setPlayerStorageValue(cid, t.s, t.speed) doChangeSpeed(cid, -getCreatureSpeed(cid)) d

  • Como que eu impediria para soltar pokemon? Isso é uma storage, uma condition? O que? Como faco para soltar o pokemon?

Postado

Só removi o negócio de ser VIP, porque o resto eu não entendi porra nenhuma porque não sei nada de pokemon, e nem quero aprender :p

 

local function BikSpeedOn(cid, t)                  
	setPlayerStorageValue(cid, t.s, t.speed)
	doChangeSpeed(cid, -getCreatureSpeed(cid))
	doChangeSpeed(cid, t.speed)
end

local function BikeSpeedOff(cid, t)
	setPlayerStorageValue(cid, t.s, -1)
	doRegainSpeed(cid)
end

local t = {text='Mount, Motobike!', dtext='Demount, Motobike!', s=5701, speed = 1000}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local pos = getThingPos(cid)
	if #getCreatureSummons(cid) >= 1 then
		return doPlayerSendCancel(cid, "Return your pokemon.")
	end

	if getPlayerStorageValue(cid, 17002) >= 1 or getPlayerStorageValue(cid, 63216) >= 1 or
	getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 75847) >= 1 or
	getPlayerStorageValue(cid, 6598755) >= 1 or getPlayerStorageValue(cid, 6598756) >= 1 then   --alterado v1.9
	   return doPlayerSendCancel(cid, "You can't do that right now.")
	end

	if getPlayerStorageValue(cid, t.s) <= 0 then
	   doSendMagicEffect(pos, 177)
	   doCreatureSay(cid, t.text, 19)
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a motobike.')
	   BikeSpeedOn(cid, t)
	   if getPlayerSex(cid) == 1 then
		  doSetCreatureOutfit(cid, {lookType = 2212}, -1)
	   else
		   doSetCreatureOutfit(cid, {lookType = 2212}, -1)
	   end
	else
	   doSendMagicEffect(pos, 177)
	   doCreatureSay(cid, t.dtext, 19)
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a motobike.')
	   BikeSpeedOff(cid, t)
	   doRemoveCondition(cid, CONDITION_OUTFIT)
	end
	return true
end 

Mas provavel que você faca o que você quer na linha 20 do script, boa sorte.

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

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Postado
  • Autor
24 minutos atrás, vankk disse:

Só removi o negócio de ser VIP, porque o resto eu não entendi porra nenhuma porque não sei nada de pokemon, e nem quero aprender :p

 


local function BikSpeedOn(cid, t)                  
	setPlayerStorageValue(cid, t.s, t.speed)
	doChangeSpeed(cid, -getCreatureSpeed(cid))
	doChangeSpeed(cid, t.speed)
end

local function BikeSpeedOff(cid, t)
	setPlayerStorageValue(cid, t.s, -1)
	doRegainSpeed(cid)
end

local t = {text='Mount, Motobike!', dtext='Demount, Motobike!', s=5701, speed = 1000}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local pos = getThingPos(cid)
	if #getCreatureSummons(cid) >= 1 then
		return doPlayerSendCancel(cid, "Return your pokemon.")
	end

	if getPlayerStorageValue(cid, 17002) >= 1 or getPlayerStorageValue(cid, 63216) >= 1 or
	getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 75847) >= 1 or
	getPlayerStorageValue(cid, 6598755) >= 1 or getPlayerStorageValue(cid, 6598756) >= 1 then   --alterado v1.9
	   return doPlayerSendCancel(cid, "You can't do that right now.")
	end

	if getPlayerStorageValue(cid, t.s) <= 0 then
	   doSendMagicEffect(pos, 177)
	   doCreatureSay(cid, t.text, 19)
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a motobike.')
	   BikeSpeedOn(cid, t)
	   if getPlayerSex(cid) == 1 then
		  doSetCreatureOutfit(cid, {lookType = 2212}, -1)
	   else
		   doSetCreatureOutfit(cid, {lookType = 2212}, -1)
	   end
	else
	   doSendMagicEffect(pos, 177)
	   doCreatureSay(cid, t.dtext, 19)
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a motobike.')
	   BikeSpeedOff(cid, t)
	   doRemoveCondition(cid, CONDITION_OUTFIT)
	end
	return true
end 

Mas provavel que você faca o que você quer na linha 20 do script, boa sorte.

 

 

é mas essa parte de ser vip tem q ficar pois a moto é apenas para jogadores vip
acredito q tenha que juntar essa parte que deixei em vermelho com esta outra que impede o jogador de usar de uma forma funcional
if getPlayerStorageValue(cid, 17002) >= 1 or getPlayerStorageValue(cid, 63216) >= 1 or
getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 75847) >= 1 or
getPlayerStorageValue(cid, 6598755) >= 1 or getPlayerStorageValue(cid, 6598756) >= 1 then   --alterado v1.9
   return doPlayerSendCancel(cid, "You can't do that right now.")
end
n estou conseguindo

Postado

?

local function BikSpeedOn(cid, t)                  
	setPlayerStorageValue(cid, t.s, t.speed)
	doChangeSpeed(cid, -getCreatureSpeed(cid))
	doChangeSpeed(cid, t.speed)
end

local function BikeSpeedOff(cid, t)
	setPlayerStorageValue(cid, t.s, -1)
	doRegainSpeed(cid)
end

local t = {text='Mount, Motobike!', dtext='Demount, Motobike!', s=5701, speed = 1000}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPremium(cid) then
		if #getCreatureSummons(cid) >= 1 then
			return doPlayerSendCancel(cid, "Return your pokemon.")
		end

		if getPlayerStorageValue(cid, 17002) >= 1 or getPlayerStorageValue(cid, 63216) >= 1 or
		getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 75847) >= 1 or
		getPlayerStorageValue(cid, 6598755) >= 1 or getPlayerStorageValue(cid, 6598756) >= 1 then   --alterado v1.9
		   return doPlayerSendCancel(cid, "You can't do that right now.")
		end
		
		local pos = getThingPos(cid)
		if getPlayerStorageValue(cid, t.s) <= 0 then
		   doSendMagicEffect(pos, 177)
		   doCreatureSay(cid, t.text, 19)
		   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a motobike.')
		   BikeSpeedOn(cid, t)
		   if getPlayerSex(cid) == 1 then
			  doSetCreatureOutfit(cid, {lookType = 2212}, -1)
		   else
			   doSetCreatureOutfit(cid, {lookType = 2212}, -1)
		   end
		else
		   doSendMagicEffect(pos, 177)
		   doCreatureSay(cid, t.dtext, 19)
		   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a motobike.')
		   BikeSpeedOff(cid, t)
		   doRemoveCondition(cid, CONDITION_OUTFIT)
		end
	else
		doPlayerSendTextMessage(cid,22,"Este item so pode ser usado por jogadores vip!") 
	end
	return true
end 

 

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Postado
  • Autor
1 hora atrás, vankk disse:

?


local function BikSpeedOn(cid, t)                  
	setPlayerStorageValue(cid, t.s, t.speed)
	doChangeSpeed(cid, -getCreatureSpeed(cid))
	doChangeSpeed(cid, t.speed)
end

local function BikeSpeedOff(cid, t)
	setPlayerStorageValue(cid, t.s, -1)
	doRegainSpeed(cid)
end

local t = {text='Mount, Motobike!', dtext='Demount, Motobike!', s=5701, speed = 1000}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPremium(cid) then
		if #getCreatureSummons(cid) >= 1 then
			return doPlayerSendCancel(cid, "Return your pokemon.")
		end

		if getPlayerStorageValue(cid, 17002) >= 1 or getPlayerStorageValue(cid, 63216) >= 1 or
		getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 75847) >= 1 or
		getPlayerStorageValue(cid, 6598755) >= 1 or getPlayerStorageValue(cid, 6598756) >= 1 then   --alterado v1.9
		   return doPlayerSendCancel(cid, "You can't do that right now.")
		end
		
		local pos = getThingPos(cid)
		if getPlayerStorageValue(cid, t.s) <= 0 then
		   doSendMagicEffect(pos, 177)
		   doCreatureSay(cid, t.text, 19)
		   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a motobike.')
		   BikeSpeedOn(cid, t)
		   if getPlayerSex(cid) == 1 then
			  doSetCreatureOutfit(cid, {lookType = 2212}, -1)
		   else
			   doSetCreatureOutfit(cid, {lookType = 2212}, -1)
		   end
		else
		   doSendMagicEffect(pos, 177)
		   doCreatureSay(cid, t.dtext, 19)
		   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a motobike.')
		   BikeSpeedOff(cid, t)
		   doRemoveCondition(cid, CONDITION_OUTFIT)
		end
	else
		doPlayerSendTextMessage(cid,22,"Este item so pode ser usado por jogadores vip!") 
	end
	return true
end 

 

seguinte erro

[Error - Action Interface]
[17/11/2015 16:16:33] data/actions/scripts/moto.lua:onUse
[17/11/2015 16:16:33] Description:
[17/11/2015 16:16:33] data/actions/scripts/moto.lua:31: attempt to call global 'BikeSpeedOn' (a nil value)
[17/11/2015 16:16:33] stack traceback:
[17/11/2015 16:16:34]     data/actions/scripts/moto.lua:31: in function <data/actions/scripts/moto.lua:14>

 

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.7k

Informação Importante

Confirmação de Termo