Donnovan Posted May 21, 2014 Report Share Posted May 21, 2014 I will try to make a server side script that check all players position each second and make a alert or, preferably, disconnect player that moved more than 100 m in a second. 1) But how i access the "player" object for each player in the server? 2) Also, how can i disconnect a player? Thanks in advance! Link to comment Share on other sites More sharing options...
0 raymix Posted May 21, 2014 Report Share Posted May 21, 2014 In that particular order: https://community.bistudio.com/wiki/forEach https://community.bistudio.com/wiki/playableUnits https://community.bistudio.com/wiki/getPos https://community.bistudio.com/wiki/distance https://community.bistudio.com/wiki/endMission Link to comment Share on other sites More sharing options...
0 Donnovan Posted May 21, 2014 Author Report Share Posted May 21, 2014 Thank you a lot, raymix! Donnovan 1 Link to comment Share on other sites More sharing options...
0 Donnovan Posted May 21, 2014 Author Report Share Posted May 21, 2014 Raymix, about endMission, how can i do it for a specific player, from server side? Since there is no parameter to specify the player unit, can't see another way other than execute it localy, on the mission folder, for the player i want to send to the lobby. Link to comment Share on other sites More sharing options...
0 raymix Posted May 21, 2014 Report Share Posted May 21, 2014 Well, there is no point in reinventing the wheel, there are scripts out there that does it, great sources to learn from. Check out, for example Link to comment Share on other sites More sharing options...
0 Donnovan Posted May 23, 2014 Author Report Share Posted May 23, 2014 Thanks raymix, i apreciate, but seens its local, i will take a better look. Already did the code but not tested it, and to gain me some more motivation i will post it here. My lovely lovely small code. Intended to be server side. It check players average speed each second and kill who had more than 120 meters/second average speed. _don_max_speed = 120 //Max speed in meters per second _don_admins = ["123456789","987654321","192837465","564738291"]; while {true} do { don_ah_units = playableUnits; sleep 1; don_ah_units_pos = playableUnits; for "_up" from 0 to count don_ah_units_pos do { for "_u" from 0 to count don_ah_units do { if ((don_ah_units_pos select _up) !in _don_admins) && isPlayer (don_ah_units_pos select _up) && (don_ah_units_pos select _up) == (don_ah_units select _u)) then { _don_travel_m = (don_ah_units_pos select _up) distance (don_ah_units select _u); //distance moved in 1 second (see "sleep 1;" on line 6) if (_don_travel_m > _don_max_speed) then { (don_ah_units_pos select _up) setDamage 1.0; }; }; }; }; }; Link to comment Share on other sites More sharing options...
0 Cannon Posted May 23, 2014 Report Share Posted May 23, 2014 Catching hackers? nice idea. Do you know if a player could generate a false positive via ejecting from an aircraft or being thrown by a vehicle/explosion as sometimes happens? Link to comment Share on other sites More sharing options...
0 Donnovan Posted May 23, 2014 Author Report Share Posted May 23, 2014 Hi Cannon! Yes, its related to not allow players to teleport, what they cant do by default. Hacking yeah. May be! i will try to make a false positive on the tests. Link to comment Share on other sites More sharing options...
Question
Donnovan
I will try to make a server side script that check all players position each second and make a alert or, preferably, disconnect player that moved more than 100 m in a second.
1) But how i access the "player" object for each player in the server?
2) Also, how can i disconnect a player?
Thanks in advance!
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now