Sign in to follow this  
Followers 0
Grayz_lost

how to update respect in database

4 posts in this topic

hi , 

is there a way of loosing respect when a player does an action , for eg , if i want players to loose respect when they deploy bike can i update there respect in databse form client side scripts ??

ive tried things like this but cant get it working ... any ideas please ?? 

        _respectLoss = 3000;
        // Set client's respect
        _playerRespect = _playerObject getVariable ["ExileScore", (_accountData select 0)];
        _playerRespect = _playerRespect - _respectLoss;
        _playerRespect = _playerObject;
        _playerObject setVariable ["ExileScore", _playerRespect];
        
    // Update respect in database
        format["setAccountScore:%1:%2", _respectLoss, (getPlayerUID _playerObject)]  call ExileServer_system_database_query_fireAndForget;    
    [_sessionID, "wasteDumpResponse", [0, str _playerRespect]]  call ExileServer_system_network_send_to;

 

 

Share this post


Link to post
Share on other sites

Look at how Exile Mod deducts respect for suicides and friendly kills. You should be able to see what needs to be tweaked.
ExileServer_object_player_event_onMpKilled.sqf

Share this post


Link to post
Share on other sites
Advertisement
5 hours ago, Grayz_lost said:

if i want players to loose respect when they deploy bike can i update there respect in databse form client side scripts ??

you can't directly do it from a client side script, when you create the bike on the server (i hope that's how you're doing it) just deduct the respect.

Share this post


Link to post
Share on other sites

Hi ,

thanks for the reply, i still cant get the respect to update from server side .. what am i missing ? 

// for respect loss
        _respectLoss = 3000;        
        _playerRespect = _player getVariable ["ExileScore", 0];            
        _playerRespect = _playerRespect - _respectLoss;
        _player setVariable ["ExileScore", _playerRespect];
    format["setAccountScore:%1:%2", _playerRespect, getPlayerUID _player] call ExileServer_system_database_query_fireAndForget;
call ExileServer_system_network_send_to;
        // Send updated respect value to client
        ExileClientPlayerScore = _playerRespect;
        (owner _player) publicVariableClient "ExileClientPlayerScore";
        ExileClientPlayerScore = nil;    

 

 

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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.