Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Must set banHammerClassname = "AMMO_CLASSNAME"; for the ban hammer weapon
- fnc_banHammer =
- {
- player addEventHandler ["handledamage",{
- _source = _this select 3;
- _weapon = _this select 4;
- _adminUID = getPlayerUID _source;
- _playerUID = getPlayerUID;
- _length = 24;
- //Might remove the MySQL Check with an setVariable on isAdmin objects
- [[_adminUID], "fnc_checkAdmin", false, false] spawn BIS_fnc_MP;
- }];
- }
- //Once again, might be removed with an isAdmin variable attached to all player objects
- fnc_checkAdmin =
- {
- _adminUID = _this select 0;
- _result = "Arma2Net.Unmanaged" callExtension format ["Arma2NetMySQLCommand ['life', 'SELECT * FROM usertable WHERE uid = '%1' AND isAdmin = 1']", _adminUID];
- _result = call compile _result;
- _result = (_result select 0);
- if(count(_result) == 1) then {
- _isAdmin = true;
- [[_isAdmin], "fnc_finishBanHammer", false, false] spawn BIS_fnc_MP;
- } else {
- //Fail
- };
- }
- fnc_finishBanHammer =
- {
- _isAdmin = _this select 0;
- if(_isAdmin = true) then {
- if(_weapon == banHammerClassname) then {
- //Run the Database Case - Add ban
- [[_playerUID, _length, _adminUID], "fnc_banHammerServer", false, false] spawn BIS_fnc_MP;
- //Lightening Bolt
- [player, 0, true] call BIS_fnc_moduleLightning;
- //TODO: Announce the ban
- };
- } else {
- //They're not an admin - KILL THEM NAO!
- player setDamage 1;
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement