JakeHekesFists

Negative Points for SafeZone Campers

17 posts in this topic

Simple Script. requires editing 2 files in the server.pbo
Basically if the victim is too close to a trader zone, The killer gets negative points.
For the sake of the easily offended,  I've removed/censored some choice 4 letter words beginning with F and C from my functions/messages :P

ExileServer_system_process_preInit.sqf
add
 

isTraderCampingC = {
	private["_position","_radius","_isNearby"];
	_position = _this;
	_radius = 600;	// set this to whatever range you like
	_isNearby = false;
	{
		if (getMarkerType _x == "ExileTraderZone") then {
			if ((getMarkerPos _x) distance2D _position < _radius) exitWith {_isNearby = true;};
		};
	} forEach allMapMarkers;
	_isNearby

}; 

just above
 

private["_MySql"];

 

next...
ExileServer_object_player_event_onMpKilled.sqf
add
 

if ((getPosATL _victim) call isTraderCampingC) then {
				
					_addKillStat = false;
					_addDeathStat = false;
					_fragAttributes pushBack "Trader Camping C***";
					_killerRespectPoints pushBack ["TRADER CAMPING C***", -100]; // change the -100 to whatever score you wish to set
				};

just above

if (_victim getVariable["ExileIsBambi", false]) then
				{
					_addKillStat = false;
					_addDeathStat = false;
					_fragAttributes pushBack "Bambi Slayer";
					_killerRespectPoints pushBack ["BAMBI SLAYER", (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Frags" >> "bambi"))];
				}

save files, re-pbo it and upload.
not providing additional support, I just seen some people complaining about trader camping on these forums, and thought my deterrent might help some admins.

enjoy

4 people like this

Share this post


Link to post
Share on other sites

I like this idea, very handy and Thank you for sharing. I set mine like:

_killerRespectPoints pushBack ["TRADER CAMPING C***", -1000];  // They tend to only do it once when they loose 1k respect from trader camping ;)

Hint for those that do not know how to:

Instead of actually changing the file in the server.pbo, you could also use the substitution method in the config.cpp:

class CfgExileCustomCode 
{

ExileServer_system_process_preInit.sqf = "Overwrites\Exile_Server\ExileServer_system_process_preInit.sqf";

ExileServer_object_player_event_onMpKilled.sqf = "Overwrites\Exile_Server\ExileServer_object_player_event_onMpKilled.sqf";

};

The first file shown is in the exile_server.pbo that you are substituting. The second one is stored in the mission file in the path shown (or whatever path you choose) and contains your modifications. This way they don't have to tamper with the released code from the Dev's and it will be easier to track down any issues if the Devs change the file you modified in any future release. Just unpack the exile_serverpbo, find the files in the code directory, save them to your desktop, edit, then place them in your mission file in whatever path you want. Just make sure the path you choose is called for like  = "path\path\bablabla.sqf"; 

 

PS, I would have LIKED your post but I have reached my limit for the day of 10 likes. I will come back tomorrow and followup with a LIKE ;)

Edited by Zoranth

Share this post


Link to post
Share on other sites
Advertisement

It would be nicer if they lose money & respect say 1k respect & 5k poptabs and the gear they had on.  Or just let the camper die by Safezone camping suicide

Share this post


Link to post
Share on other sites

just something for all of you to keep in mind.  most of the people that camp/bambi kill could care less about money/respect.

 

there are they to only cause mayhem and nothing more.

 

a better solution would be to kick instead of taking money/respect.

 

:)

 

1 person likes this

Share this post


Link to post
Share on other sites
On 11/17/2015, 3:22:37, Z80CPU said:

just something for all of you to keep in mind.  most of the people that camp/bambi kill could care less about money/respect.

 

there are they to only cause mayhem and nothing more.

 

a better solution would be to kick instead of taking money/respect.

 

:)

 

I really like this idea. Can someone explain how I would change it to a kick rather than deducting respect or poptabs?

Might be nice to also teleport them to another location as well. So they don't just log back in and kill again. It will inconvenience them by making them run back to their camping location.

Edited by Omen

Share this post


Link to post
Share on other sites

Hmm... any chance to change respect point for poptabs ???

Respect lost its not a big punish for rich players with ready bases...

1 person likes this

Share this post


Link to post
Share on other sites
On 09.11.2015 at 1:11 AM, JakeHekesFists said:

Simple Script. requires editing 2 files in the server.pbo
Basically if the victim is too close to a trader zone, The killer gets negative points.
For the sake of the easily offended,  I've removed/censored some choice 4 letter words beginning with F and C from my functions/messages :P

ExileServer_system_process_preInit.sqf
add
 


isTraderCampingC = {
	private["_position","_radius","_isNearby"];
	_position = _this;
	_radius = 600;	// set this to whatever range you like
	_isNearby = false;
	{
		if (getMarkerType _x == "ExileTraderZone") then {
			if ((getMarkerPos _x) distance2D _position < _radius) exitWith {_isNearby = true;};
		};
	} forEach allMapMarkers;
	_isNearby

}; 

just above
 


private["_MySql"];

 

next...
ExileServer_object_player_event_onMpKilled.sqf
add
 


if ((getPosATL _victim) call isTraderCampingC) then {
				
					_addKillStat = false;
					_addDeathStat = false;
					_fragAttributes pushBack "Trader Camping C***";
					_killerRespectPoints pushBack ["TRADER CAMPING C***", -100]; // change the -100 to whatever score you wish to set
				};

just above


if (_victim getVariable["ExileIsBambi", false]) then
				{
					_addKillStat = false;
					_addDeathStat = false;
					_fragAttributes pushBack "Bambi Slayer";
					_killerRespectPoints pushBack ["BAMBI SLAYER", (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Frags" >> "bambi"))];
				}

save files, re-pbo it and upload.
not providing additional support, I just seen some people complaining about trader camping on these forums, and thought my deterrent might help some admins.

enjoy

You can publish the modified file ExileServer_object_player_event_onMpKilled? Please?

Share this post


Link to post
Share on other sites

Okay so I got this to work on my server the code has changed a hell of a lot since this was released. By no means am I an expert at this so you if you know what you're doing feel free to change it. 

First Edit your @exileserver/addons/exile_server_config/config.cpp

Add this

traderkill = 20; // Killing a player near trader will cost you -20%

with this

unlucky = 0; // Dying for an unknown reason costs you 1% respect
crash = 1; // Crashing your car costs you 1% respect
suicide = 2; // Comitting suicide costs you 2% of your respect
friendyFire = 3; // Friendly fire costs you 3% 
npc = 2; // Being killed by an NPC costs you 4%
bambiKill = 5; // Killing a bambi costs you 5%
frag = 5; // Killing someone will get you 5% and remove 5% from the victim

and it should look like 

Spoiler

class Percentages 
        {
            unlucky = 0; // Dying for an unknown reason costs you 1% respect
            crash = 1; // Crashing your car costs you 1% respect
            suicide = 2; // Comitting suicide costs you 2% of your respect
            friendyFire = 3; // Friendly fire costs you 3% 
            npc = 2; // Being killed by an NPC costs you 4%
            bambiKill = 5; // Killing a bambi costs you 5%
            frag = 5; // Killing someone will get you 5% and remove 5% from the victim
            traderkill = 20; // Killing a player near trader will cost you -20%
          };

 

Next go into your mission config and create a folder called Custom

In that folder create the following files:

ExileServer_system_process_preInit.sqf

Spoiler

/**
 * ExileServer_system_process_preInit
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */

isTraderCampingC = {    //Trader Camping code start
    private["_position","_radius","_isNearby"];
    _position = _this;
    _radius = 250;    // set this to whatever range you like
    _isNearby = false;
    {
        if (getMarkerType _x == "ExileTraderZone") then {
            if ((getMarkerPos _x) distance2D _position < _radius) exitWith {_isNearby = true;};
        };
    } forEach allMapMarkers;
    _isNearby

};  //Trader Camping code end
private["_MySql"];
"Server is loading..." call ExileServer_util_log;
call ExileServer_system_rcon_initialize;
finishMissionInit;
ExileSessionIDs = [];
ExileServerGraveyardGroup = grpNull;
ExileServerBreachingCharges = [];
independent setFriend [sideEnemy, 1];
call ExileServer_system_process_noobFilter;
_MySql_connection = [] call ExileServer_system_database_connect;
call ExileServer_system_network_setupEventHandlers;
if !(getRemoteSensorsDisabled) then
{
    disableRemoteSensors true;
};
PublicServerIsLoaded = false; 
PublicServerVersion = getText(configFile >> "CfgMods" >> "Exile" >> "version");
publicVariable "PublicServerVersion";

 
 
 
 

ExileServer_util_getFragType.sqf

Spoiler

/**
 * ExileServer_util_getFragType
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_victim","_killer","_killingPlayer","_type","_victimClanId","_killerClanId"];
_victim = _this select 0;
_killer = _this select 1;
_killingPlayer = _this select 2;
_type = 0;
try 
{
    if (_victim getVariable ["IsPlayingRussianRoulette", false]) then 
    {
        throw 2;
    };
    if (_victim isEqualTo _killer) then
    {
        throw 1;
    };
    if ((vehicle _victim) isEqualTo _killer) then
    {
        throw 3;
    };
    if (isNull _killer) then
    {
        throw 0;
    };
    if (isNull _killingPlayer) then 
    {
        throw 4;
    };
    if ((group _victim) isEqualTo (group _killingPlayer)) then 
    {
        throw 5;
    };
    _victimClanId = _victim getVariable ["ExileClanID", -2];
    _killerClanId = _killer getVariable ["ExileClanID", -3];
    if (!(_victimClanId isEqualTo -1) && (_victimClanId isEqualTo _killerClanId)) then
    {
        throw 5;
    };        
    if (_victim getVariable ["ExileIsBambi", false]) then 
    {
        throw 6;
    };
    if ((getPosATL _victim) call isTraderCampingC) then //Trader camping start
    {
            throw 7;
    }    //Trader camping end
    throw 8;
}
catch 
{
    _type = _exception;
};
_type

 
 
 
 

ExileServer_object_player_event_onMpKilled.sqf

Spoiler

/**
 * ExileServer_object_player_event_onMpKilled
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_victim","_killer","_countDeath","_countKill","_killSummary","_killingPlayer","_killType","_oldVictimRespect","_newVictimRespect","_oldKillerRespect","_newKillerRespect","_systemChat","_modifyVictimRespect","_respectLoss","_perks","_minRespectTransfer","_respectTransfer","_perkNames","_killerStatsNeedUpdate","_newKillerFrags","_victimStatsNeedUpdate","_newVictimDeaths","_victimPosition"];
_victim = _this select 0;
_killer = _this select 1;
if (!isServer || hasInterface || isNull _victim) exitWith {};
_victim setVariable ["ExileDiedAt", time];
if !(isPlayer _victim) exitWith {};
_victim setVariable ["ExileIsDead", true]; 
_victim setVariable ["ExileName", name _victim, true]; 
_countDeath = false;
_countKill = false;
_killSummary = [];
_killingPlayer = _killer call ExileServer_util_getFragKiller;
_killType = [_victim, _killer, _killingPlayer] call ExileServer_util_getFragType;
_oldVictimRespect = _victim getVariable ["ExileScore", 0];
_newVictimRespect = _oldVictimRespect;
_oldKillerRespect = 0;
if !(isNull _killingPlayer) then 
{
    _oldKillerRespect = _killingPlayer getVariable ["ExileScore", 0];
};
_newKillerRespect = _oldKillerRespect;
switch (_killType) do 
{
    default 
    {
        _countDeath = true;
        _systemChat = format ["%1 died for an unknown reason!", name _victim];
        _newVictimRespect = _oldVictimRespect - round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "unlucky")));
    };
    case 1:
    {
        _countDeath = true;
        _modifyVictimRespect = true;
        _systemChat = format ["%1 commited suicide!", name _victim];
        _newVictimRespect = _oldVictimRespect - round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "suicide")));
    };
    case 2:
    {
        _countDeath = true;
        _countKill = false;
        _systemChat = format ["%1 died while playing Russian Roulette!", name _victim];
        _newVictimRespect = _oldVictimRespect; 
        _victim call ExileServer_system_russianRoulette_event_onPlayerDied;
    };
    case 3:
    {
        _countDeath = true;
        _countKill = false;
        _systemChat = format ["%1 crashed to death!", name _victim];
        _newVictimRespect = _oldVictimRespect - round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "crash")));
    };
    case 4:
    {
        _countDeath = true;
        _countKill = false;
        _systemChat = format ["%1 was killed by an NPC!", name _victim];
        _newVictimRespect = _oldVictimRespect - round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "npc")));
    };
    case 5:
    {
        _countDeath = false;
        _countKill = false;
        _systemChat = format ["%1 was team-killed by %2!", name _victim, name _killingPlayer];
        _respectLoss = round ((abs _oldKillerRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "friendyFire")));
        _newKillerRespect = _oldKillerRespect - _respectLoss;
        _killSummary pushBack ["FRIENDLY FIRE", -1 * _respectLoss];
    };
    case 6:
    {
        _countDeath = false;
        _countKill = false;
        _systemChat = format ["%1 was killed by %2! (BAMBI SLAYER)", name _victim, name _killingPlayer];
        _respectLoss = round ((abs _oldKillerRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "bambiKill")));
        _newKillerRespect = _oldKillerRespect - _respectLoss;
        _killSummary pushBack ["BAMBI SLAYER", -1 * _respectLoss];
    };
    case 7: //Trader Camping Start
    {
        _countDeath = false;
        _countKill = false;
        _systemChat = format ["%1 was killed by %2! (TRADER CAMPER)", name _victim, name _killingPlayer];
        _respectLoss = round ((abs _oldKillerRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "traderkill")));
        _newKillerRespect = _oldKillerRespect - _respectLoss;
        _killSummary pushBack ["TRADER CAMPER", -1 * _respectLoss];
    };         //Trader Camping End
    case 8:
    {
        _countDeath = true;
        _countKill = true;
        _perks = [_victim, _killer, _killingPlayer] call ExileServer_util_getFragPerks;
        _minRespectTransfer = getNumber (configFile >> "CfgSettings" >> "Respect" >> "minRespectTransfer");
        _respectTransfer = round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "frag")));
        if (_respectTransfer < _minRespectTransfer) then
        {
            _respectTransfer = _minRespectTransfer;
        };
        _newVictimRespect = _oldVictimRespect - _respectTransfer;
        _newKillerRespect = _oldKillerRespect + _respectTransfer;
        _killSummary pushBack ["ENEMY FRAGGED", _respectTransfer];
        if (_perks isEqualTo []) then 
        {
            _systemChat = format ["%1 was killed by %2!", name _victim, name _killingPlayer];
        }
        else 
        {
            _perkNames = [];
            {
                _perkNames pushBack (_x select 0);
                _killSummary pushBack _x;
                _newKillerRespect = _newKillerRespect + (_x select 1);
            } 
            forEach _perks;
            _systemChat = format ["%1 was killed by %2! (%3)", name _victim, name _killingPlayer, _perkNames joinString ", "];
        };
    };
};
if !(isNull _killingPlayer) then 
{
    if !(_killSummary isEqualTo []) then 
    {    
        [_killingPlayer, "showFragRequest", [_killSummary]] call ExileServer_system_network_send_to;
    };
};
if !(isNull _killingPlayer) then 
{
    _killerStatsNeedUpdate = false;
    if (_countKill) then
    {
        _newKillerFrags = _killingPlayer getVariable ["ExileKills", 0];
        _newKillerFrags = _newKillerFrags + 1;
        _killerStatsNeedUpdate = true;
        _killingPlayer setVariable ["ExileKills", _newKillerFrags];
        format["addAccountKill:%1", getPlayerUID _killingPlayer] call ExileServer_system_database_query_fireAndForget;
    };
    if !(_newKillerRespect isEqualTo _oldKillerRespect) then 
    {
        _killingPlayer setVariable ["ExileScore", _newKillerRespect];
        _killerStatsNeedUpdate = true;
        format["setAccountScore:%1:%2", _newKillerRespect, getPlayerUID _killingPlayer] call ExileServer_system_database_query_fireAndForget;
    };
    if (_killerStatsNeedUpdate) then 
    {
        _killingPlayer call ExileServer_object_player_sendStatsUpdate;
    };
};
_victimStatsNeedUpdate = false;
if (_countDeath) then
{
    _newVictimDeaths = _victim getVariable ["ExileDeaths", 0];
    _newVictimDeaths = _newVictimDeaths + 1;
    _victim setVariable ["ExileDeaths", _newVictimDeaths];
    _victimStatsNeedUpdate = true;
    format["addAccountDeath:%1", getPlayerUID _victim] call ExileServer_system_database_query_fireAndForget;
};
if !(_newVictimRespect isEqualTo _oldVictimRespect) then 
{
    _victim setVariable ["ExileScore", _newVictimRespect];
    _victimStatsNeedUpdate = true;
    format["setAccountScore:%1:%2", _newVictimRespect, getPlayerUID _victim] call ExileServer_system_database_query_fireAndForget;
};
if (_victimStatsNeedUpdate) then 
{
    _victim call ExileServer_object_player_sendStatsUpdate;
};
if ((vehicle _victim) isEqualTo _victim) then 
{
    if !(underwater _victim) then 
    {
        if !(_victim call ExileClient_util_world_isInTraderZone) then 
        {
            _victim call ExileServer_object_flies_spawn;
        };
    };
};
if !(_systemChat isEqualTo "") then 
{
    if ((getNumber (configFile >> "CfgSettings" >> "KillFeed" >> "showKillFeed")) isEqualTo 1) then 
    {
        ["systemChatRequest", [_systemChat]] call ExileServer_system_network_send_broadcast;
    };
};
if !(_systemChat isEqualTo "") then 
{
    if ((getNumber (configFile >> "CfgSettings" >> "Logging" >> "deathLogging")) isEqualTo 1) then
    {
        "extDB2" callExtension format["1:DEATH:%1", _systemChat];
    };
};
_victimPosition = getPos _victim;
format["insertPlayerHistory:%1:%2:%3:%4:%5", getPlayerUID _victim, name _victim, _victimPosition select 0, _victimPosition select 1, _victimPosition select 2] call ExileServer_system_database_query_fireAndForget;
format["deletePlayer:%1", _victim getVariable ["ExileDatabaseId", -1]] call ExileServer_system_database_query_fireAndForget;
true

 
 
 
 

Next open your mission file Config.cpp and add this to your CfgExileCustomCode

ExileServer_object_player_event_onMpKilled = "Custom\ExileServer_object_player_event_onMpKilled.sqf"; //Trader Camping
ExileServer_system_process_preInit = "Custom\ExileServer_system_process_preInit.sqf"; // Trader Camping
ExileServer_util_getFragType = "Custom\ExileServer_util_getFragType.sqf"; // Trader Camping

so it should look a little something like this

class CfgExileCustomCode 
{	
	ExileServer_object_player_event_onMpKilled = "Custom\ExileServer_object_player_event_onMpKilled.sqf"; //Trader Camping
	ExileServer_system_process_preInit = "Custom\ExileServer_system_process_preInit.sqf"; // Trader Camping
	ExileServer_util_getFragType = "Custom\ExileServer_util_getFragType.sqf"; // Trader Camping
	/*
		You can overwrite every single file of our code without touching it.
		To do that, add the function name you want to overwrite plus the 
		path to your custom file here. If you wonder how this works, have a
		look at our bootstrap/fn_preInit.sqf function.

		Simply add the following scheme here:

		<Function Name of Exile> = "<New File Name>";

		Example:

		ExileClient_util_fusRoDah = "myaddon\myfunction.sqf";
	*/
};

That should be it hope this helps guys

 

Edited by TheChimpa
1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

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 account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.