Aller au contenu

Question

Posté(e)

Version de Minecraft : 1.19
Version de Skript : LATEST

Addons utilisés: SKQuery

Type du skript : Custom economy skript that allow player to share money between their team

Description du script :

Hello,
I'm a beginner at skript but i search a way to make skript command that allow the player to create custom shared account with their friend, see their money, withdraw and put money on it

anybody to help me ?
thanks for all !

5 réponses à cette question

Messages recommandés

  • 0
Posté(e)
Le 19/11/2022 à 19:11, chilli_pepper a dit :

Version de Minecraft : 1.19
Version de Skript : LATEST

Addons utilisés: SKQuery

Type du skript : Custom economy skript that allow player to share money between their team

Description du script :

Hello,
I'm a beginner at skript but i search a way to make skript command that allow the player to create custom shared account with their friend, see their money, withdraw and put money on it

anybody to help me ?
thanks for all !

Révélation

command /account [<text>] [<text>]:
	trigger:
		if arg-1 is not set:
			send "&4&lError &8: &cPlease, enter an argument !" to player
			stop
		else:
			if arg-1 is not "create", "delete", "add", "remove", "leave", "put", "withdraw", "see" or "accept":
				send "&4&lError &8: &cThe argument &8'&6%arg-1%&8' &cdoesn't exists !" to player
				stop
			else:
				if arg 1 is "create":
					if {Account::%player%::State} is not set:
						set {Account::%player%::State} to "true"
						set {Account::%player%::Owner} to player
						set {Account::%player%::Money} to 0
						
						send "&6&lAccount &8: &fAccount Successfully Created !" to player
						send "&6&lAccount &8: &fTo invite another player, do &8: &8/account add <player>" to player
						stop
					else:
						send "&4&lError &8: &cYou can't create a new account !" to player
						stop
						
				if arg 1 is "delete":
					if {Account::%player%::State} is set:
						if {Account::%player%::Owner} is player:
							if {Account::%player%::Money} = 0:
								loop {Account::%player%::Members}:
									delete {Account::%loop-value%::State}
									delete {Account::%loop-value%::Money}
									delete {Account::%loop-value%::Owner}
									
								delete {Account::%player%::State}
								delete {Account::%player%::Money}
								delete {Account::%player%::Owner}
							
								send "&6&lAccount &8: &fAccount Successfully Deleted !" to player
								stop
							else:
								send "&4&lError : &cThe account's money should be at 0 !" to player
								stop
						else:
							send "&4&lError &8: &cYou aren't the owner of this account !" to player
							stop
					else:
						send "&4&lError &8: &cYou do no have an account !" to player
						stop
						
				if arg 1 is "add":
					if arg 2 is not set:
						send "&4&lError &8: &cPlease, enter a player !" to player
						stop
					else:
						if (arg 2 parsed as offline player) is not online:
							send "&4&lError &8: &cThat player isn't online !" to player
							stop
						else:
							if {Account::%player%::State} is set:
								if {Account::%player%::Owner} is player:
									add player to {Account::%(arg 2 parsed as offline player)%::Ask}
									
									send "&6&lAccount &8: &fA join request as been send to &e%arg-2% &f!" to player
									send formatted "&6&lAccount &8: &e%player% &fask you to join his account, click <cmd:/account accept %player%><ttp:&7Click !>&ahere<reset> &fto accept" to (arg 2 parsed as offline player)
									stop
									
				if arg 1 is "remove":
					if arg 2 is not set:
						send "&4&lError &8: &cPlease, enter a player !" to player
						stop
					else:
						if {Account::%player%::State} is set:
							if {Account::%player%::Owner} is player:
								if {Account::%player%::Members} contains (arg 2 parsed as offline player):
									delete {Account::%(arg 2 parsed as offline player)%::State}
									delete {Account::%(arg 2 parsed as offline player)%::Owner}
									remove (arg 2 parsed as offline player) from {Account::%player%::Members}
									
									send "&6&lAccount &8: &fThat player has been removed from the account !" to player
									stop
								else:
									send "&4&lError &8: &cThat player isn't in your account !" to player
									stop
							else:
								send "&4&lError &8: &cYou're not the owner of this account !" to player
								stop
						else:
							send "&4&lError &8: &cYou do no have an account !" to player
							stop
							
				if arg 1 is "leave":
					if {Account::%player%::State} is set:
						if {Account::%player%::Owner} is not player:
							delete {Account::%player%::State}
							remove player from {Account::%{Account::%player%::Owner}%::Members}
							
							send "&6&lAccount &8: &fYou have leave that account !" to player
							stop
						else:
							send "&4&lError &8: &cYou can't leave your own account !" to player
							stop
					else:
						send "&4&lError &8: &cYou do no have an account !" to player
						stop
						
				if arg 1 is "put":
					if arg 2 is not set:
						send "&4&lError &8: &cPlease, enter an integer !" to player
						stop
					else:
						if {Account::%player%::State} is set:
							add (arg-2 parsed as integer) to {Account::%{Account::%player%::Owner}%::Money}
							remove (arg-2 parsed as integer) from player's balance
									
							send "&6&lAccount &8: &fYou have give &e%arg-2%$ &fto your account !" to player
							stop
						else:
							send "&4&lError &8: &cYou do no have an account !" to player
							stop
							
				if arg 1 is "withdraw":
					if arg 2 is not set:
						send "&4&lError &8: &cPlease, enter an integer !" to player
						stop
					else:
						if {Account::%player%::State} is set:
							if {Account::%{Account::%player%::Owner}%::Money} > 0:
								if {Account::%{Account::%player%::Owner}%::Money} >= (arg-2 parsed as integer):
									remove (arg-2 parsed as integer) from {Account::%{Account::%player%::Owner}%::Money}
									add (arg-2 parsed as integer) to player's balance
									
									send "&6&lAccount &8: &fYou have received &e%arg-2%$ &f!" to player
									stop
								else:
									send "&4&lError &8: &cThere's not enough money on your account !" to player
									stop
							else:
								send "&4&lError &8: &cThere's no money on your account !" to player
								stop
						else:
							send "&4&lError &8: &cYou do no have an account !" to player
							stop
				
				if arg 1 is "see":
					if {Account::%player%::State} is set:
						send " " to player
						send "&7Account Owner : &f%{Account::%player%::Owner}%" to player
						send "&7Account Money : &f%{Account::%{Account::%player%::Owner}%::Money}%" to player
						loop {Account::%{Account::%player%::Owner}%::Members}:
							if {Account::%player%::Owner} is loop-value:
								send "  &8- &f%loop-value% &4[OWNER]" to player
							else:
								send "  &8- &f%loop-value%" to player
						send " " to player
						stop
					else:
						send "&4&lError &8: &cYou do no have an account !" to player
						stop
							
				if arg 1 is "accept":
					if arg 2 is not set:
						send "&4&lError &8: &cPlease, enter a player !" to player
						stop
					else:
						if {Account::%player%::State} is not set:
							if size of {Account::%player%::Ask} > 0:
								if {Account::%player%::Ask} contains arg-2:
									clear {Account::%player%::Ask}
									add player to {Account::%(arg 2 parsed as offline player)%::Members}
									set {Account::%player%::State} to "true"
									set {Account::%player%::Owner} to (arg 2 parsed as offline player)
									stop
								else:
									send "&4&lError &8: &cYou we're not invited by that player !" to player
									stop
							else:
								send "&4&lError &8: &cNobody has invited you !" to player
								stop
						else:
							send "&4&lError &8: &cYou're already in a account !" to player
							stop

 

😉

Invité
Ce sujet ne peut plus recevoir de nouvelles réponses.
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.