Skocz do zawartości
  • 0

PVP ON/OFF


PLEnderPL

Pytanie

Witam mam problem z skript, chciałem osiągnąć żeby gracz mógł włączać i wyłączać pvp

Tutaj jest cały kod :

variables:
    {ochrona::%player%} = false

on first join:
    set {ochrona::%player%} to true
    send "&fPvP dla ciebie jest wylaczone, wpisz komede /pvp"
    
on damage:
    if {ochrona::%player%} is true:
        cancel event
        send "PVP &jest nie aktywne"
    if {ochrona::%player%} is true:
        cancel event
        if {ochrona.gracz.%attacker%} is true:
            message "" to atacker
        else:
            send "&7Nie mozesz zaatakowac &7%victim%&7 poniewaz ma ochrone" to attacker

command /pvp [<text>]:
    trigger:
        arg 1 is not set:
            send ""
            send "&f/pvp on  - &a&lAktywne"
            send "&f/pvp off - &c&lNieaktywne"
            send ""
        arg 1 is "on":
            send " &aPVP &fjest aktywne"
            set {ochrona::%player%} to false
        arg 1 is "off":
            send " &aPVP &fjest nieaktywne"
            set {ochrona::%player%} to true

Odnośnik do komentarza
https://skript.pl/temat/22544-pvp-onoff/
Udostępnij na innych stronach

7 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
 variables:
    {ochrona::%player%} = false

on join:
    if {ochrona::%player%} is false:
    	send "&fPvP dla ciebie jest wylaczone, wpisz komede /pvp"
    
on damage:
    if {ochrona::%victim%} is true:
		cancel event
        send "&7Nie mozesz zaatakowac &7%victim%&7 poniewaz ma ochrone" to attacker

command /pvp [<text>]:
    trigger:
        arg 1 is not set:
            send ""
            send "&f/pvp on  - &a&lAktywne"
            send "&f/pvp off - &c&lNieaktywne"
            send ""
        arg 1 is "on":
            send " &aPVP &fjest aktywne"
            set {ochrona::%player%} to true
        arg 1 is "off":
            send " &aPVP &fjest nieaktywne"
            set {ochrona::%player%} to false 

Sprawdz czy dziala, nie testowane

Odnośnik do komentarza
https://skript.pl/temat/22544-pvp-onoff/#findComment-153422
Udostępnij na innych stronach

  • 0
variables:
	{ochrona::%player%} = false

on first join:
	set {ochrona::%player%} to true
	send "&fPvP dla ciebie jest wylaczone, wpisz komede /pvp"
	
on damage:
	if attacker is a player:
		if victim is a player:
			if {ochrona::%attacker%} is true:
				cancel event
				send "PVP jest nie aktywne"
			if {ochrona::%victim%} is true:
				cancel event
				send "&7Nie mozesz zaatakowac &7%victim%&7 poniewaz ma ochrone" to attacker

command /pvp [<text>]:
	trigger:
		arg 1 is not set:
			send ""
			send "&f/pvp on  - &a&lAktywne"
			send "&f/pvp off - &c&lNieaktywne"
			send ""
		arg 1 is "on":
			send " &aPVP &fjest aktywne"
			set {ochrona::%player%} to false
		arg 1 is "off":
			send " &aPVP &fjest nieaktywne"
			set {ochrona::%player%} to true

 

Odnośnik do komentarza
https://skript.pl/temat/22544-pvp-onoff/#findComment-153737
Udostępnij na innych stronach

  • 1
4 godziny temu, Bielecki napisał:

Pragnę jedynie zauważyć, że podczas jakiejkolwiek klepy, ziomek przegrywając wpisuje /pvp i nie ginie, dziękuję, dobranoc.

 variables:
    {ochrona::%player%} = false

on join:
    if {ochrona::%player%} is false:
    	send "&fPvP dla ciebie jest wylaczone, wpisz komede /pvp"
    
on damage:
    if {ochrona::%victim%} is true:
		cancel event
        send "&7Nie mozesz zaatakowac &7%victim%&7 poniewaz ma ochrone" to attacker

every 5 seconds:
	loop all players:
		if {cooldown.%loop-player%} is set:
			set {_cooldown.%loop-player%} to yaml value "cooldown" from file "Zmienne/%loop-player%.yml"
			set {_cooldown.%loop-player%} to {_cooldown.%loop-player%} parsed as number
			remove 5 from {_cooldown.%loop-player%}
			set yaml value "cooldown" from file "Zmienne/%loop-player%" to "%{_cooldown.%loop-player%}%"
			set {_cooldown.%loop-player%} to yaml value "cooldown" from file "Zmienne/%loop-player%.yml"
			set {_cooldown.%loop-player%} to {_cooldown.%loop-player%} parsed as number
			if {_cooldown.%loop-player%} is smaller or equal to 0:
				delete {cooldown.%loop-player%}
				delete yaml value "cooldown" from file "Zmienne/%loop-player%.yml"
				
command /pvp [<text>]:
    trigger:
  		set {_cooldown.%player%} to yaml value "cooldown" from file "Zmienne/%player%.yml"
		set {_cooldown.%player%} to {_cooldown.%player%} parsed as number
  		if {_cooldown.%player%} is not set:
            arg 1 is not set:
            	send ""
              	send "&f/pvp on  - &a&lAktywne"
              	send "&f/pvp off - &c&lNieaktywne"
              	send ""
          	arg 1 is "on":
              	send " &aPVP &fjest aktywne"
              	set {ochrona::%player%} to true
  			  	set yaml value "cooldown" from file "Zmienne/%player%.yml" to "30"  
          	arg 1 is "off":
              	send " &aPVP &fjest nieaktywne"
              	set {ochrona::%player%} to false
  		else:
  			send "&cNie mozesz jeszcze uzyc tej komendy!"
  			stop

 

Już naprawione.

Odnośnik do komentarza
https://skript.pl/temat/22544-pvp-onoff/#findComment-153752
Udostępnij na innych stronach

  • 0
Dnia 31.10.2017 o 09:36, Bielecki napisał:

Pragnę jedynie zauważyć, że podczas jakiejkolwiek klepy, ziomek przegrywając wpisuje /pvp i nie ginie, dziękuję, dobranoc.

do tego jest coś takiego jak "antylogout" który blokuje komendy podczas walki.

Odnośnik do komentarza
https://skript.pl/temat/22544-pvp-onoff/#findComment-155719
Udostępnij na innych stronach

  • 0
15 minut temu, LordziaK napisał:

do tego jest coś takiego jak "antylogout" który blokuje komendy podczas walki.

Jak chcesz już odkopywać wątek sprzed 11 dni, to zależy to od tego, który z pluginów ma wyższy priorytet. Zazwyczaj jest to Skript, więc tyle z Twojego "Antylogouta".

Odnośnik do komentarza
https://skript.pl/temat/22544-pvp-onoff/#findComment-155724
Udostępnij na innych stronach

  • 0

A tutaj jeżeli używasz essentials

on first join:
    execute console command "pex user %player% add essentials.protect.pvp"
command /pvp [<text>]:
    trigger:
        if arg 1 is not set:
            send ""
            send "&f/pvp on  - &a&lAktywne"
            send "&f/pvp off - &c&lNieaktywne"
            send ""
        if arg 1 is on:
            execute console command "pex user %player% add essentials.protect.pvp"
            send " &aPVP &fjest aktywne"
        if arg 1 is off:
            execute console command "pex user %player% remove essentials.protect.pvp"
        stop

 

Odnośnik do komentarza
https://skript.pl/temat/22544-pvp-onoff/#findComment-155725
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...