Ir para conteúdo
  • 0

[PEDIDP] Exausted em talkaction


aberick

Pergunta

Aae galera queria uma ajuda.. como adcionar exuasted de 30 segundos para usar novamente o comando !go? ta ai o script

 

 

 

local config =

{

sexChangeable = false,

copyOutfitAndAddonsEverytime = false

}

 

function onSay(cid, words, param, channel)

party = getPlayerParty(cid)

if (config.sexChangeable == true) then

sex = getPlayerSex(cid)

end

if (party) then

if (party == cid) then

outfit = getCreatureOutfit(cid)

members = getPartyMembers(party)

if (#members >= 1) then

tmp = outfit

for i=1,#members do

if (config.sexChangeable == true) then

if (sex ~= getPlayerSex(members)) then

doPlayerSetSex(members, sex)

end

end

if(config.copyOutfitAndAddonsEverytime == false and canPlayerWearOutfit(members, tmp.lookType, tmp.lookAddons) ~= true) then

local tmpOutfit = getCreatureOutfit(members)

tmp.lookType = tmpOutfit.lookType

tmp.lookAddons = tmpOutfit.lookAddons

end

doCreatureChangeOutfit(members, tmp)

doSendMagicEffect(getCreaturePosition(members), 66)

end

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This command can use only leader of a party!")

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be in a party!")

end

return true

end

 

Editado por Roksas
adicionado spoilers
Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0

Tenta ai

 

 

local config =

{

sexChangeable = false,

exhausted_seconds = 30,

exhausted_storagevalue = 799,

copyOutfitAndAddonsEverytime = false

}

 

function onSay(cid, words, param, channel)

if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then

party = getPlayerParty(cid)

if (config.sexChangeable == true) then

sex = getPlayerSex(cid)

end

if (party) then

if (party == cid) then

outfit = getCreatureOutfit(cid)

members = getPartyMembers(party)

if (#members >= 1) then

tmp = outfit

for i=1,#members do

if (config.sexChangeable == true) then

if (sex ~= getPlayerSex(members)) then

doPlayerSetSex(members, sex)

setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)

end

end

if(config.copyOutfitAndAddonsEverytime == false and canPlayerWearOutfit(members, tmp.lookType, tmp.lookAddons) ~= true) then

local tmpOutfit = getCreatureOutfit(members)

tmp.lookType = tmpOutfit.lookType

tmp.lookAddons = tmpOutfit.lookAddons

end

doCreatureChangeOutfit(members, tmp)

doSendMagicEffect(getCreaturePosition(members), 66)

end

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This command can use only leader of a party!")

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be in a party!")

end

if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then

doSendMagicEffect(frompos, CONST_ME_POFF)

doPlayerSendCancel(cid, "You are exhausted.")

return false

end

return true

end

end

 

Link para o comentário
Compartilhar em outros sites

  • 0

Tenta assim:

 

 

local config =

{

sexChangeable = false,

exhausted_seconds = 30,

exhausted_storagevalue = 799,

copyOutfitAndAddonsEverytime = false

}

 

function onSay(cid, words, param, channel)

if not exhaustion.check(cid, 26588) then

party = getPlayerParty(cid)

if (config.sexChangeable == true) then

sex = getPlayerSex(cid)

end

if (party) then

if (party == cid) then

outfit = getCreatureOutfit(cid)

members = getPartyMembers(party)

if (#members >= 1) then

tmp = outfit

for i=1,#members do

if (config.sexChangeable == true) then

if (sex ~= getPlayerSex(members)) then

doPlayerSetSex(members, sex)

exhaustion.set(cid, 26588, 30*1000)

end

end

if(config.copyOutfitAndAddonsEverytime == false and canPlayerWearOutfit(members, tmp.lookType, tmp.lookAddons) ~= true) then

local tmpOutfit = getCreatureOutfit(members)

tmp.lookType = tmpOutfit.lookType

tmp.lookAddons = tmpOutfit.lookAddons

end

doCreatureChangeOutfit(members, tmp)

doSendMagicEffect(getCreaturePosition(members), 66)

end

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This command can use only leader of a party!")

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be in a party!")

end

return true

end

end

 

Link para o comentário
Compartilhar em outros sites

  • 0

@topic.. tenta assim..

 

local config = {
sexChangeable = false,
copyOutfitAndAddonsEverytime = false,
exhau_sto = 36599,
exhau_time = 30,  --em segundos
}

function onSay(cid, words, param, channel)
  local party = getPlayerParty(cid)
  local sex = getPlayerSex(cid)
  if exhaustion.check(cid, exhau_sto) then
  doPlayerSendTextMessage(cid, 20, "You need to wait ".. config.exhau_time .."segs to use this command again!")
  return true
  end
  if (party) then
  if (party == cid) then
	 outfit = getCreatureOutfit(cid)
	 members = getPartyMembers(party)
	 if (#members >= 1) then
		tmp = outfit
		for i=1,#members do
			if (config.sexChangeable == true) then
			   if (sex ~= getPlayerSex(members[i])) then
				  doPlayerSetSex(members[i], sex)
			   end
			end
			if(config.copyOutfitAndAddonsEverytime == false and canPlayerWearOutfit(members[i], tmp.lookType, tmp.lookAddons) ~= true) then
			   local tmpOutfit = getCreatureOutfit(members[i])
			   tmp.lookType = tmpOutfit.lookType
			   tmp.lookAddons = tmpOutfit.lookAddons
			end
			doCreatureChangeOutfit(members[i], tmp)
			doSendMagicEffect(getCreaturePosition(members[i]), 66)
			exhaustion.set(cid, config.exhau_sto, config.exhau_time)
		end
	 end
  else
	 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This command can use only leader of a party!")
  end
  else
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be in a party!")
  end
return true
end

 

 

@rok

globalevents? LOL LOL uahuah

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

  • 0

@topic

hum.. tenta assim..

 

local config = {
sexChangeable = false,
copyOutfitAndAddonsEverytime = false,
exhau_sto = 365998,
exhau_time = 30,  --em segundos
}

function onSay(cid, words, param, channel)
  local party = getPlayerParty(cid)
  local sex = getPlayerSex(cid)
  if getPlayerStorageValue(cid, config.exhau_sto) >= os.time() then
  doPlayerSendTextMessage(cid, 20, "You need to wait ".. config.exhau_time .."segs to use this command again!")
  return true
  end
  if (party) then
  if (party == cid) then
	 local outfit = getCreatureOutfit(cid)
	 local members = getPartyMembers(party)
	 if (#members >= 1) then
		local tmp = outfit
		for i=1,#members do
			if (config.sexChangeable == true) then
			   if (sex ~= getPlayerSex(members[i])) then
				  doPlayerSetSex(members[i], sex)
			   end
			end
			if(config.copyOutfitAndAddonsEverytime == false and canPlayerWearOutfit(members[i], tmp.lookType, tmp.lookAddons) ~= true) then
			   local tmpOutfit = getCreatureOutfit(members[i])
			   tmp.lookType = tmpOutfit.lookType
			   tmp.lookAddons = tmpOutfit.lookAddons
			end
			doCreatureChangeOutfit(members[i], tmp)
			doSendMagicEffect(getCreaturePosition(members[i]), 66)
			setPlayerStorageValue(cid, config.exhau_sto, os.time() + config.exhau_time)
		end
	 end
  else
	 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This command can use only leader of a party!")
  end
  else
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be in a party!")
  end
return true
end

 

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

×
×
  • Criar Novo...