Jump to content
Sign in to follow this  
finguide

How to make server add joining players to only one side?

Recommended Posts

This is really critical issue to me.

Is there any way / script to make server to add the joining players to only one side? Eg. if there are 20 players on BLUFOR and 30 players on OPFOR, server would add every joining player to OPFOR, not BLUFOR that has less players. In addition, it would be nice if server would not add joining players to any side if the OPFOR was full. And the last, even better if a player could be forced to only one side, so that he couldn't select slot from any other side.

If this would be possible to make true, it would save me from tens of hours of wasted time.

Thanks in advance,

finguide

Share this post


Link to post
Share on other sites

Only on mission script level, you will have to check which side player chose and drop him back into lobby if your conditions aren't met.

Example code which will drop player into lobby if he selected civilians or independents

if(!(playerSide in [west, east])) then {
endMission "LOSER";
};

Share this post


Link to post
Share on other sites

Thanks a lot SaMatra!

That would be perfect solution, if I had easily editable player UID list (maybe in external file, I mean not in the .pbo?) and make server to check the joining player's ID. The list must be easily editable and probably external (so that updating it doesn't require restarting of the mission), because it would be updated multiple, maybe even tens of times a day.

So, is using getPlayerUID to check every joining player's UID from external, easily editable file / list possible?

Share this post


Link to post
Share on other sites

There is a solution in making server-side addon which will have list of uids but this might get too complicated. A simple solution:

uids.sqf:

myUids = [
123123123,
321321321
];

init.sqf:

#include uids.sqf

true spawn {
//Wait until player is initialized
waitUntil {player == player};

//Check
if(!(getPlayerUID(player) in myUids) && playerSide == west) then {
	endMission "LOSER";
};
};

This should drop players into lobby if the joined BLUFOR and their uid is not in the list.

Share this post


Link to post
Share on other sites

Thanks again!

That's pretty nice. I'll use that if there is no possibility to edit the UID list when the mission runs.

Share this post


Link to post
Share on other sites
Thanks again!

That's pretty nice. I'll use that if there is no possibility to edit the UID list when the mission runs.

There is no unless you will use database which is very complicated.

Share this post


Link to post
Share on other sites

Is there a command or method to check also joining player's name at same time with UID, so that both have to match? For example user with registered / accepted ID could use only one nickname to play on that side.

Actually it would be even better, but not necessary if the players who were not whitelisted got kicked off instead of ending their mission.

Share this post


Link to post
Share on other sites

UID's will be better. (name player) will return the players name (locally) but I recommend using only the UIDs.

And no. Ending their mission is the same as kicking them. It only happens locally.

Share this post


Link to post
Share on other sites

Thanks for your post!

I meant in my previous post that both playername and UID should match. For example, if we have player registered as "FALCON12" with ID 7438912, he could only play on cop side if both nick and ID matched. For example, if that player would try to join with nick "Duplo", he would get still kicked off because his name doesn't match with the ID.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×