[Question] How can i trigger a player

Okay, to dispel doubleness i will explain.

I working on ban-function to players, like, i can ban player without kick/force to spectators.

So i tryed to do functions when you can ban a Event player, and also he will be appended in Array, and when he join again he will be freezed (banned)

But its just not works, i guess in array placing not like Battletag or something like this, maybe its just lobby ID, i dont know lol.

Like when player join, leave and join again i can see in inspector 2 players with same name, but its actually one player, which joined in different times.

So i guess each time he join creating new entity Event Player, even if it will be same player, in ID maybe it will be Raven1, Raven2… etc.

How can i trigger a player, which left the match and joined again to it?

My code:

4V86D

You can’t, when someone leave the game all variables with his player in it will be set to null and all his player variable will be reset.

But i mean not Player Variable, did you read my post?

I mean when i ban him, he appened in array, which contains banned players

rule("Ban a player")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Slot Of(Event Player) == 0;
		Horizontal Angle Towards(Event Player, Player Closest To Reticle(Event Player, All Teams)) < 10;
		Is Button Held(Event Player, Primary Fire) == True;
	}

	actions
	{
		Modify Global Variable(A, Append To Array, Player Closest To Reticle(Event Player, All Teams));
		Create HUD Text(Player Closest To Reticle(Event Player, All Teams), String("Banned", Null, Null, Null), Null, Null, Top, 0, Red,
			White, White, Visible To and String);
		Set Status(Player Closest To Reticle(Event Player, All Teams), Null, Frozen, 9999);
	}
}

So even if he leave this player will be in Array, question about this.

Like I said, every array values/variable with a certain player as value will be set to null when the player leaves.

You mean like if Array will contains in [0] element = Raven, it will mean that Array[0] = Null?

But why array contains not just null, but name of event player, even when player already left?

When a player leaves a game and joins again, the inspector tool will actually list the player twice with the same name.

So what I think happens when you save a player named “Raven” in an array for example, and that player rejoins, then the rejoining Raven will count as a different player, even though both players show up as “Raven” to you in the Inspector.

I may be wrong though :slight_smile:

So, for my joiner/leaver-tool I made some tests on what happens if a player leaves. Its true that the player object gets deleted, including all of the player’s variables. However, if you save any of his variables before he leaves, the saved data remains.
If you save the player himself, only his name gets stored in the variable, like you did in array A.

As I see in your code you tried to compare the event player with the stored name. I think in this case the event player gets handled as the player object, so it doesnt work.

You could try to save the player in a player variable and compare the player variable with the stored name:

rule - Banned player joined
event - player joined match

condition:
- none

action:
- set player variable(event player, A, event player)
- skip if(array contains(global variable(A), player variable(event player, A)), 1)
- abort()
- create hud text(etc.)
- set status(frozen)

No, sry, its anyway doesn’t work. As i said, i think Blizzard Workshop count any joined player as new player, even if he joined again, so i dont think i can force it to work.

57NQF

Did you try my suggestion? Because the idea is to convert the player object into a string of his name and compare this - its just an idea, I cant try it out.

Yes, if you read my post i also attached code, and said its not work.

I did read your post, I just wasnt sure if you actually tested my suggestion, because I didnt test it.

Yea sry, I had no time to open workshop and load the code, so I didnt look into it.

Unfortunately I have no other idea to work around the problem.

Actually its not your problem :slight_smile:
If even pro-skilled workshoper like you dont know any decision it means that Workshop just havent instruments for it :slight_smile:
I also tested with my friends much and i also think that current version of workshop just cant allow us it.

Maybe later Blizzard will add something about mode rowdy and instruments for ban them :blush:

1 Like

Thats so nice, thx :heart:

1 Like

Easy, just assume their gender.