For that you will want your kick code to be set on Join In Progress (JIP) players too:
https://community.bistudio.com/wiki/...in_in_Progress
If you broadcast it with publicVariable it will be synchronized with all current players and any players that join in the future.
You have to be careful using publicVariable though, because most servers publicvariable.txt battleye filters are set to kick for all publicVariable broadcasts except specific exceptions. One of the exceptions for servers running infistar antihack right now is "PVAHR_0_".
That means you can do something like this and not get kicked:
Code:
private ["_name"];
_name = _this select 0;
if (isNil "PVAHR_0_banplayer") then {
PVAHR_0_banplayer = format["
if (name player == '%1') then {
failMission 'LOSER';
0 fadeSound 0;
for '_i' from 0 to 100 do {(findDisplay _i) closeDisplay 0;};
};", _name];
};
publicVariable "PVAHR_0_banplayer";
Or you could overwrite an existing publicVariable on the server that is not updated frequently with your kick code. That will be synchronized every time the player rejoins.
Note setVehicleInit and processInitCommands are also JIP compatible, but they are blocked by antihack, so don't even bother trying to use them.
You could also just loop your kick code with your remote exc. But that would be extremely inefficient, especially if the player never rejoins. If you wanted to do it anyway it would be something like this:
Code:
private ["_kick","_name"];
_name = _this select 0;
_kick = format["
if (name player == '%1') then {
failMission 'LOSER';
0 fadeSound 0;
for '_i' from 0 to 100 do {(findDisplay _i) closeDisplay 0;};
};
", _name];
while {1 == 1} do {
[_kick] execVM "YourScriptz\YourRE.sqf";
sleep 60;
};
I set it to loop every 60 seconds because that is about how long it takes a player to rejoin. Any faster than that and you would probably lag out the server.
Note the kick code I posted is based on name. If they change their name it will not work, so you should base it on playerID instead. Also don't use the variable names I used (since this is posted in a public forum).