Boose

Adding a Remove Respect option on death

57 posts in this topic

Can easily be done.

 

Open ExileServer_object_player_event_onMpKilled.sqf

Look for :

_victim setVariable ["ExileIsDead", true];

Add after:

_victimScore = _victim getVariable ["ExileScore",0];
_victim setVariable ["ExileScore", _victimScore - 100];

I don't know if the respect would sync with the DB, give it a try.

Edited by GR8
  • Like 1

Share this post


Link to post
Share on other sites
Advertisement

Yah that works man , Just need the update DB command now

 

After

_victimScore = _victim getVariable ["ExileScore",0];
_victim setVariable ["ExileScore", _victimScore - 100];

Add

_newScore = _victim getVariable ["ExileScore", 0];
_victim setVariable ["ExileScore", _newScore];
format["setAccountScore:%1:%2", _newScore,getPlayerUID _victim] call ExileServer_system_database_query_fireAndForget;

That should work

Share this post


Link to post
Share on other sites

After

_victimScore = _victim getVariable ["ExileScore",0];
_victim setVariable ["ExileScore", _victimScore - 100];

Add

_newScore = _victim getVariable ["ExileScore", 0];
_victim setVariable ["ExileScore", _newScore];
format["setAccountScore:%1:%2", _newScore,getPlayerUID _victim] call ExileServer_system_database_query_fireAndForget;

That should work

Would you know how i can make it so it only takes it if the player is killed by another player - rather than arma?

Would something like this work

if (isPlayer _killer) then
            {
            _curRespect = _victim getVariable ["ExileScore", 0];
                    _respect    = _curRespect * 0.05;
                    _newRespect = _curRespect - _respect;
                    _victim setVariable ["ExileScore", _newrespect ];
                    ExileClientPlayerScore = _newRespect;
                    (owner _victim) publicVariableClient "ExileClientPlayerScore";
                    ExileClientPlayerScore = nil;
                    format["setAccountMoneyAndRespect:%1:%2:%3", _victim getVariable ["ExileMoney", 0], _newRespect, (getPlayerUID _victim)] call ExileServer_system_database_query_fireAndForget;
            
                    ExileClientPlayerScore = _Respect;
                   (owner _victim) publicVariableClient "ExileClientPlayerScore";
                    format["setAccountMoneyAndRespect:%1:%2:%3", _killer getVariable ["ExileMoney", 0], _respect , (getPlayerUID _killer)] call ExileServer_system_database_query_fireAndForget;
                    
                    };
        };    

 

 

Share this post


Link to post
Share on other sites

Would you know how i can make it so it only takes it if the player is killed by another player - rather than arma?

Would something like this work

Hidden Content

 

 

I think so yes.

if not replace the first line with

if ((isPlayer _killer) && {_killer isKindOf "Exile_Unit_Player"}) then

 

Share this post


Link to post
Share on other sites

Seeing how this request thread is very similar to what I am aiming to do I will just go ahead and raise it from the dead.

I'm trying to add respect for killing a unit from a particular side (Bluefor/west) .... this is what I have so far:

private ["_unit", "_killer", "_killerScore"," _newScore"];

if (isServer) then{

    if (side == west) then{
        _unit= (_this select 0);
        _unit addEventHandler ["killed",
        _unit= (_this select 0);
        _killer= (_this select 1);
        
        if ((isPlayer _killer) && {_killer isKindOf "Exile_Unit_Player"}) then{
            _killerScore = _killer getVariable ["ExileScore", 0];
            _newScore = _killerScore + 5
            _killer setVariable ["ExileScore", _newScore];
            format["setAccountScore:%1:%2", _newScore,getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget;
        };
            
    ]};
};

Would that work?  If so where would be the best place to init?

Thanks!

Share this post


Link to post
Share on other sites

Seeing how this request thread is very similar to what I am aiming to do I will just go ahead and raise it from the dead.

I'm trying to add respect for killing a unit from a particular side (Bluefor/west) .... this is what I have so far:

Hidden Content

Would that work?  If so where would be the best place to init?

Thanks!

Who is west? and who is east or independent? Players are independent and kill the west or east? so i don't understand why you should do this?

Share this post


Link to post
Share on other sites

west is the side of my zombies (which are the only occupiers of that particular side) .  I aim to reward players with respect for killing someone from side == west.

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.