fix for name function error (untested)

17:00:15 WARNING: Function 'name' - PLAYER is dead
This commit is contained in:
icomrade
2014-03-25 22:01:07 -04:00
parent 7812bcc7b0
commit 935ed7931d
6 changed files with 22 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
private ["_character","_traderid","_buyorsell","_data","_result","_key","_outcome","_clientID"];
private ["_character","_name","_traderid","_buyorsell","_data","_result","_key","_outcome","_clientID"];
_player = _this select 0;
_traderID = _this select 1;
@@ -9,11 +9,12 @@ _currency = _this select 5;
_qty = _this select 6;
_clientID = owner _player;
_price = format ["%2x %1",_currency,_qty];
_name = if (alive _character) then { name _character; } else { "Dead Player"; };
if (_buyorsell == 0) then { //Buy
diag_log format["EPOCH SERVERTRADE: Player: %1 (%2) bought a %3 in/at %4 for %5", (name _player), (getPlayerUID _player), _classname, _traderCity, _price];
diag_log format["EPOCH SERVERTRADE: Player: %1 (%2) bought a %3 in/at %4 for %5", _name, (getPlayerUID _player), _classname, _traderCity, _price];
} else { //SELL
diag_log format["EPOCH SERVERTRADE: Player: %1 (%2) sold a %3 in/at %4 for %5",(name _player), (getPlayerUID _player), _classname, _traderCity, _price];
diag_log format["EPOCH SERVERTRADE: Player: %1 (%2) sold a %3 in/at %4 for %5",_name, (getPlayerUID _player), _classname, _traderCity, _price];
};
if (DZE_ConfigTrader) then {