AB
pedido

[PEDIDP] Exausted em talkaction

Por aberick, 19 de mar. de 2013 em Scripts

duvida
exated
resolvido
script
17
2k
aberickA
19 de março de 2013 às 18:46

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 Março 19 por Roksas

adicionado spoilers

RoksasR
19 de março de 2013 às 18:59

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

 

aberickA
19 de março de 2013 às 19:05

n funciono não parça :S

StyloMaldosoS
19 de março de 2013 às 19:15

n funfa exausted com god ou com acc de god..

aberickA
19 de março de 2013 às 19:24

mas n é com god, esse comando é pra players.. eu testei em player e não fico exuasted!

StyloMaldosoS
19 de março de 2013 às 19:28

tava na CONTA do GOD?

.

.

apareçeu erro console quando tento digita o comando 2x seguida ?

Editado Março 19 por StyloMaldoso

aberickA
19 de março de 2013 às 19:30

n ta na conta do god, n apareçeu erro tambem da pra usa de boa so que não fica exausted

RoksasR
19 de março de 2013 às 19:34

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

 

aberickA
19 de março de 2013 às 19:43

puts, ainda nao foi kk

RoksasR
19 de março de 2013 às 19:51

Amigo, por a caso você ta dando

/reload globalevents

 

?

SlicerS
19 de março de 2013 às 19:53

@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 Março 19 por Slicer

StyloMaldosoS
19 de março de 2013 às 19:54

Amigo, por a caso você ta dando

/reload globalevents

 

?

function onSay(cid, words, param, channel)

 

reload globalevents? q isso.. huahua prestando muita atenção '--'

RoksasR
19 de março de 2013 às 19:57

Estou desorientado, preocupado com outras coisas.

aberickA
19 de março de 2013 às 19:59

n so burro não mano.. to dando talkaction ¬¬

 

ainda não funciono @slicer

Editado Março 19 por Aberick

SlicerS
19 de março de 2013 às 20:30

@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 Março 19 por Slicer