Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ////////////////////////////////////////////////////
- ZKilled.sqf - WIP
- WIP Credits to eraser1 and IT07
- for their respective onKilled.sqf's (DMS & VEMF)
- ////////////////////////////////////////////////////
- */
- private ["_unit","_killer","_playerObj","_veh","_respect","_repGain","_killMsg","_dist","_bonus","_roadKilled"/*,"_message"*/];
- _unit = _this select 0;
- _killer = _this select 1;
- _playerObj = objNull;
- _roadKilled = false;
- if (isPlayer _killer) then
- {
- _veh = vehicle _killer;
- _playerObj = _killer;
- // Fix for players killing AI from mounted vehicle guns
- if (!(_killer isKindOf "Exile_Unit_Player") && {!isNull (gunner _killer)}) then
- {
- _playerObj = gunner _killer;
- };
- if (!(_veh isEqualTo _killer) && {(driver _veh) isEqualTo _killer}) then
- {
- _playerObj = driver _veh;
- _roadKilled = true;
- };
- };
- if ((!isNull _playerObj) && {((getPlayerUID _playerObj) != "") && {_playerObj isKindOf "Exile_Unit_Player"}}) then
- {
- _repGain = 10;
- if (_roadKilled) then
- {
- //_killMsg = ["ROADKILL?! -20 REP! DONT BE A PUSSY!","ROADKILL!? -20 REP FOR BEING LAME!","ERMAHGERD ROADKILL! -20 REP!"] call BIS_fnc_selectRandom;
- _repGain = -20;
- _bonus = 0;
- };
- _respect = _playerObj getVariable ["ExileScore", 0];
- //_message = [[]];
- _killMsg = ["ZOMBIE WACKED","ZOMBIE CLIPPED","ZOMBIE DISABLED","ZOMBIE DISQUALIFIED","ZOMBIE WIPED","ZOMBIE WIPED","ZOMBIE ERASED","ZOMBIE LYNCHED","ZOMBIE WRECKED","ZOMBIE NEUTRALIZED","ZOMBIE SNUFFED","ZOMBIE WASTED","ZOMBIE ZAPPED"] call BIS_fnc_selectRandom;
- _killMsgPssy = ["ROADKILL?! -20 REP! DONT BE A PUSSY!","ROADKILL!? -20 REP FOR BEING LAME!","ERMAHGERD ROADKILL! -20 REP!"] call BIS_fnc_selectRandom;
- //(_message select 0) pushBack [_killMsg, _repGain + _bonus];
- _dist = _unit distance _playerObj;
- /*switch true do
- {
- case (_roadKilled):
- {
- (_message select 0) pushBack ["ROADKILL?! -20 REP! DONT BE A PUSSY!",-20 + 0] // OR vvvv
- _killMsg = ["ROADKILL?! -20 REP! DONT BE A PUSSY!","ROADKILL!? -20 REP FOR BEING LAME!","ERMAHGERD ROADKEEL! -20 REP!"] call BIS_fnc_selectRandom;
- _repGain = -21;
- _bonus = 0;
- };
- };*/
- _bonus = round (_dist / 4);
- // Set client's respect
- _respect = _respect + _repGain + _bonus;
- _playerObj setVariable ["ExileScore", _respect];
- // Send frag message
- if (_roadKilled) then
- {
- [_playerObj, "showFragRequest", [[[_killMsgPssy, _repGain + _bonus]]]] call ExileServer_system_network_send_to;
- }
- else
- {
- [_playerObj, "showFragRequest", [[[_killMsg, _repGain + _bonus]]]] call ExileServer_system_network_send_to;
- };
- ExileClientPlayerScore = _respect;
- (owner _playerObj) publicVariableClient "ExileClientPlayerScore";
- ExileClientPlayerScore = nil;
- // Update client database entry
- format["setAccountMoneyAndRespect:%1:%2:%3", _playerObj getVariable ["ExileMoney", 0], _respect, (getPlayerUID _playerObj)] call ExileServer_system_database_query_fireAndForget;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement