need a help in @mute

Ezolile

Member
Joined
May 19, 2023
Messages
40
How To code @mute by custome timings???
I must state one thing first. Custom time for mutes or bans will not work when player leaves game or when your world is empty. There are possibilities to keep it working when your world not empty but it could cause other issues like lag and entity limits error so I do not recommend that. When your world is empty it will not work.
For example your command will be something like this: @mute player 2. Let's say number is in minutes.
You will use split text (msg) into an array with space delimiter (default) which will split your command into array elements at indexes
index 0: @mute
index 1: player
index 2: 2
Then you get element from array at index 0 and check if text is equal to @mute. If it is get element from index 1 of an array and select player by condition if player name equals then get element from index 2 of an array multiply it by 60 to get time in seconds and save result in %selected%_mute_time variable (Saved).
Then you will need loop (active all the time - 1 second intervals) which will select all players by condition if variable %selected%_mute_time is more than 0 and decrement it by 1.
Also you need Chat event If variable %player%_mute_time is more than 0 > Cancel event.

I might have mistaken with array indexing so if 0,1,2 is not working try 1,2,3 indexes.
 

ItchyDitchy

Member
Joined
Jun 30, 2023
Messages
61
I must state one thing first. Custom time for mutes or bans will not work when player leaves game or when your world is empty. There are possibilities to keep it working when your world not empty but it could cause other issues like lag and entity limits error so I do not recommend that. When your world is empty it will not work.
For example your command will be something like this: @mute player 2. Let's say number is in minutes.
You will use split text (msg) into an array with space delimiter (default) which will split your command into array elements at indexes
index 0: @mute
index 1: player
index 2: 2
Then you get element from array at index 0 and check if text is equal to @mute. If it is get element from index 1 of an array and select player by condition if player name equals then get element from index 2 of an array multiply it by 60 to get time in seconds and save result in %selected%_mute_time variable (Saved).
Then you will need loop (active all the time - 1 second intervals) which will select all players by condition if variable %selected%_mute_time is more than 0 and decrement it by 1.
Also you need Chat event If variable %player%_mute_time is more than 0 > Cancel event.

I might have mistaken with array indexing so if 0,1,2 is not working try 1,2,3 indexes.
Must support reasons, since dumb stuff. Must also be able to debug if player is not in game, if time isn't a number etc.
 

veddnt

Active member
Joined
Jun 2, 2023
Messages
179

get a translator or something...
 
Top