WA
suporte scripts

[TFS 0.4] Alguém edita essa script de !pvp on e !pvp off ? Por Favor

Por Wase Wiss, 04 de jan. de 2017 em Resolvidos

xx
4
2.4k
Wase WissW
04 de janeiro de 2017 às 22:22

Eae Galera blz ? Eu queria pedir a ajuda de vocês para editar essa script para min, o erro que está dando é que os comando ta indo ao contrario, eu falo !pvp on, desativa, falo !pvp off ativa, será que alguém poderia min ajuda por favor ? desde já, obrigado.

 

Spoiler

Creaturescript:

function onCombat(cid, target)    if isPlayer(cid) and isPlayer(target) then    	if getPlayerStorageValue(cid, 123456) == 1 then return false end    end    return trueendfunction onTarget(cid,target)	if isPlayer(cid) and isPlayer(target) then		if getPlayerStorageValue(cid,123456) == 1 then			doPlayerSendCancel(cid, "Reative o PVP para atacar um jogador.")			return false		end	end	return trueendfunction onLogin(cid)	registerCreatureEvent(cid, "PVPTarget")	registerCreatureEvent(cid, "PVPCombat")	return trueend

.xml :

 

<event type="login" name="PVPLogin" event="script" value="script.lua"/><event type="target" name="PVPTarget" event="script" value="script.lua"/><event type="combat" name="PVPCombat" event="script" value="script.lua"/>

talkactions:

 

function onSay(cid, words, param, channel)	if param == "" then		return doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.")	end	if isInArray({"on","off"}, param) then		local value = param == "on" and 1 or 0		local status = param == "on" and "ativou" or "desativou"		doPlayerSetStorageValue(cid, 123456, value)		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você "..status.." o PVP.")	else		doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.")	end	return trueend

Tag:

 

<talkaction words="!pvp" event="script" value="pvpsystem.lua"/>

 

Editado Janeiro 4 por Henrique Gomes

05 de janeiro de 2017 às 18:56
20 horas atrás, Henrique Gomes disse:

Eae Galera blz ? Eu queria pedir a ajuda de vocês para editar essa script para min, o erro que está dando é que os comando ta indo ao contrario, eu falo !pvp on, desativa, falo !pvp off ativa, será que alguém poderia min ajuda por favor ? desde já, obrigado.

 

  Ocultar conteúdo

Creaturescript:

function onCombat(cid, target)    if isPlayer(cid) and isPlayer(target) then    	if getPlayerStorageValue(cid, 123456) == 1 then return false end    end    return trueendfunction onTarget(cid,target)	if isPlayer(cid) and isPlayer(target) then		if getPlayerStorageValue(cid,123456) == 1 then			doPlayerSendCancel(cid, "Reative o PVP para atacar um jogador.")			return false		end	end	return trueendfunction onLogin(cid)	registerCreatureEvent(cid, "PVPTarget")	registerCreatureEvent(cid, "PVPCombat")	return trueend

.xml :

 

<event type="login" name="PVPLogin" event="script" value="script.lua"/><event type="target" name="PVPTarget" event="script" value="script.lua"/><event type="combat" name="PVPCombat" event="script" value="script.lua"/>

talkactions:

 

function onSay(cid, words, param, channel)	if param == "" then		return doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.")	end	if isInArray({"on","off"}, param) then		local value = param == "on" and 1 or 0		local status = param == "on" and "ativou" or "desativou"		doPlayerSetStorageValue(cid, 123456, value)		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você "..status.." o PVP.")	else		doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.")	end	return trueend

Tag:

 

<talkaction words="!pvp" event="script" value="pvpsystem.lua"/>

 

 

não sei o motivo do erro.

 

testa assim : (talkactions)

 

function onSay(cid, words, param, channel)	if param == "" then		return doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.")	end	if param == 'on' then		doPlayerSetStorageValue(cid, 123456, 1)		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ativou o PVP.")	elseif param == 'off' then		doPlayerSetStorageValue(cid, 123456, -1)		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desativou o PVP.")	else		doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.")	endreturn trueend

 

Wase WissW
06 de janeiro de 2017 às 15:26
20 horas atrás, Ed'Specter disse:

 

não sei o motivo do erro.

 

testa assim : (talkactions)

 

function onSay(cid, words, param, channel)	if param == "" then		return doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.")	end	if param == 'on' then		doPlayerSetStorageValue(cid, 123456, 1)		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ativou o PVP.")	elseif param == 'off' then		doPlayerSetStorageValue(cid, 123456, -1)		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desativou o PVP.")	else		doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.")	endreturn trueend

 

Não foi mano, está a mesma coisa, no tópico que eu peguei essa script era para TFS 0.3.6

rorixR
06 de janeiro de 2017 às 16:45

tenta assim então

function onSay(cid, words, param, channel)	if param == "" then		return doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.")	end	if param == 'on' then		doPlayerSetStorageValue(cid, 123456, -1)		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ativou o PVP.")	elseif param == 'off' then		doPlayerSetStorageValue(cid, 123456, 1)		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desativou o PVP.")	else		doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.")	endreturn trueend