Diddl3s

How to add / remove poptabs ?

6 posts in this topic

ExileClientPlayerMoney used to work before the update but doesn't work for changing poptabs anymore.

Any ideas of what to use instead of it ?

 

Thanks

Share this post


Link to post
Share on other sites
 (player getVariable ["ExileMoney", 0]); 

 

Share this post


Link to post
Share on other sites
Advertisement

Posted (edited)

Thanks for the reply but I'm not really sure how I would use that in order to edit the pops.

I used the following before

_newPoptabs = ExileClientPlayerMoney + (500);

 

Any chance you could shed some light on it for me ? :)

Edited by Diddl3s

Share this post


Link to post
Share on other sites
5 hours ago, Mr Sin said:

 (player getVariable ["ExileMoney", 0]); 

 

 

6 hours ago, Diddl3s said:

ExileClientPlayerMoney used to work before the update but doesn't work for changing poptabs anymore.

Any ideas of what to use instead of it ?

 

Thanks

 

add:

player setVariable ["ExileMoney", 1251, true];

remove:

player setVariable ["ExileMoney", 154, true];

get:

player getVariable ["ExileMoney",  -1]; //-1 is a default value if "ExileMoney" dosent exist.

 

1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

Thanks for the reply here, it is much appreciated..

Could I be as bold as to question you a little further.. :)

 

I'm trying to get the exilez zombies to add some poptabs per kill, but having tried multiple times with what you have given me above, I can only manage to get the pops to increase but not save to the database.

Any chance you would know what to change here to make it work correctly ?

// ExileZ 2.0 by Patrix87 of http:\\multi-jeux.quebec //
// Original script by eraser1 and IT07 //
 
private [
"_unit",
"_killer",
"_playerObj",
"_veh",
"_killMsg",
"_killMsgRoad",
"_roadKilled",
"_respect",
"_respectChange",
"_roadKillBonus",
"_money",
"_zombieMoney",
"_zombieRespect",
"_distanceBonusDivider",
"_minDistance",
"_cqbDistance",
"_cqbBonus",
"_distance",
"_killerRespectPoints",
"_safetoblow",
"_explode"
];

_unit           		= _this select 0;
_killer         		= _this select 1;
_playerObj      		= objNull;
_roadKilled    			= false;
_respectChange  		= 0;
_killerRespectPoints 	= [];
_safetoblow				= true;
_explode				= false;

//Parameters
_zombieMoney			= ZombieMoney;				//default = 5;	// Money per zombie kill
_zombieRespect			= ZombieRespect;			//default = 10;	// Respect per zombie kill
_roadKillBonus			= RoadKillBonus;			//default = -5;	// Bonus Respect if roadkill
_minDistance			= MinDistance;				//default = 50;	// Minimal distance for range bonus
_cqbDistance			= CqbDistance;				//default = 10;	// Minimal ditance for close quarter bonus
_cqbBonus				= CqbBonus;					//default = 40;	// Respect for close quarter bonus at 1 meter
_distanceBonusDivider 	= DistanceBonusDivider;		//default = 10;	// Distance divided by that number = respect E.G. 300m / [20] = 15 Respect
//

_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;
_killMsgRoad = ["ZOMBIE ROADKILL","ZOMBIE SMASHED","ERMAHGERD ROADKILL"] call BIS_fnc_selectRandom;

if(ExplosiveZombies) then 
{
	if (ExplosiveZombiesRatio > random 100) then
	{	
		_killerRespectPoints pushBack [(format ["%1",ExplosiveZombieWarning]), ExplosiveRespect];
		_explode = true;
	};
};


//Roadkill or not
if (isPlayer _killer) then
{
	_veh = vehicle _killer;
	_playerObj = _killer;
	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;
	};
};

_respect = _playerObj getVariable ["ExileScore", 0];
_money = _playerObj getVariable ["ExileMoney", 0];

//Scoring
if ((!isNull _playerObj) && {((getPlayerUID _playerObj) != "") && {_playerObj isKindOf "Exile_Unit_Player"}}) then
{
	//Default
	_killerRespectPoints pushBack [(format ["%1",_killMsg]), _zombieRespect];
	//RoadkillBonus
	if (_roadKilled) then
	{
		_killerRespectPoints pushBack [(format ["%1",_killMsgRoad]), _roadKillBonus];
	}
	else
	//DistanceBonus
	{
		_distance = _unit distance _playerObj;
		if (_distance > _minDistance) then
		{
			_distanceBonus = (floor (_distance / _distanceBonusDivider));
			_killerRespectPoints pushBack [(format ["%1m RANGE BONUS", (round _distance)]), _distanceBonus];			
		};
		if (_distance <= _cqbDistance) then
		{
			_distanceBonus = round((floor ((_cqbDistance + 1) - _distance)) * ( _cqbBonus /_cqbDistance));
			_killerRespectPoints pushBack [(format ["%1m CQB BONUS", (round _distance)]), _distanceBonus];
		};
	};
	
	// Calculate killer's respect and money
	{
		_respectChange = (_respectChange + (_x select 1));
	}
	forEach _killerRespectPoints;
	_respect = (_respect + _respectChange);
	_money = (_money + _zombieMoney);
	
	// Send message
	// [_playerObj, "showFragRequest", [_killerRespectPoints]] call ExileServer_system_network_send_to;
	// [_playerObj, "moneyReceivedRequest", [str _money, "Killing Zombies"]] call ExileServer_system_network_send_to;
	
	// Set client's respect and money
	_playerObj setVariable ["ExileScore", _respect];
	_playerObj setVariable ["ExileMoney", _money];
	
	ExileClientPlayerScore = _respect;
	(owner _playerObj) publicVariableClient "ExileClientPlayerScore";
	ExileClientPlayerScore = nil;
	
	// Update client database entry
	format["setAccountMoneyAndRespect:%1:%2:%3", _money, _respect, (getPlayerUID _playerObj)] call ExileServer_system_database_query_fireAndForget;
};

if(_explode) then 
{
	{
		if (((_x select 0) distance (position _unit)) < (_x select 1)) exitwith {_safetoblow = false};
	}Foreach SafeZonePositions;
	if (_safetoblow) then 
	{
		sleep ExplosionDelay;
		ExplosiveType createvehicle position _unit;
	};
};

 

Edited by Diddl3s

Share this post


Link to post
Share on other sites

Posted (edited)

I think "setAccountMoneyAndRespect" got changed or removed - not sure what happened. Trying to sort this one out too.

Edited by Bulleit

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.