Jump to content
  • 0

Need some self action help


Asian Kid

Question

The actions can be click,  what they are suppose to do doesn't happen. 

I checks if the player has the item and then removes the item and does something

 

Here is the code

private ["_bunkercode"];
_Chance = 2;
_bunkercode = bunkercode;
_Humanity = player getVariable["humanity",0];
titleText ["Its top secret so...maybe.","PLAIN DOWN"]; titleFadeOut 3;
sleep 3;

if((_Humanity >= 15000) && (_Humanity <= 29999)) then {
	player playActionNow "Medic";
	cutText [format["Fine here. The code is %1 plz don't tell other players let them have a challenge or I change it.",_bunkercode,"%"], "PLAIN DOWN",10];
	} else {
	if((_Humanity >= -1999) && (_Humanity <= 14999)) then {
		if(random 100 <= _Chance) then {
		    player playActionNow "Medic";
			sleep 0.5;
			[] execVM "bunker\ask.sqf";
			};
		    }else{
			 cutText [format["Nahh no code for you but if you can give me something for it *wink*.",_bunkercode,"%"], "PLAIN DOWN"];
		} else {
		if((_Humanity <= -2000) && (_Humanity >= -15000)) then {
		    player playActionNow "Medic";
		    cutText [format["I told you its top secret so no!!!",_bunkercode,"%"], "PLAIN DOWN"];
		} else {
			cutText [format["Guess what I forgot it.....now leave me alone. ",_bunkercode,"%"], "PLAIN DOWN",3];
		};
	};
};

The other one

//###########################################
//ASIAN KID!!!!!!!!!!!!!!!!
//############################################
private ["_bunkercode"];
_bribe = bribe;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
_bunkercode = bunkercode;
_magazinesPlayer = magazines player;
 if (_bribe in _magazinesPlayer) then {
        bunkgold = true;
    } else { bunkgold = false;};
if(hasBagItem && _canDo) then {
        player playActionNow "Medic";
		player removeMagazine _bribe;
		cutText [format["Code is %1 plz don't tell other players let them have a challenge or I change it.",_bunkercode,"%"], titleFadeOut 3;
    } else {
cutText [format["You don't have 1%.",_bribe,"%"], "PLAIN DOWN"];
    };
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

update I edited the code and this is what I have

 

//###########################################
//ASIAN KID!!!!!!!!!!!!!!!!
//############################################
private ["_bunkercode"];
_Chance = 4;
_BanditBunker = BanditBunker;
_heroBunker = HeroBunker;
_SurviorBunker1 = BeforeHero;
_SurviorBunker2 = BerforeBandit;
_bunkercode = bunkercode;
_Humanity = player getVariable["humanity",0];
_roll = floor(random 100);
titleText ["Its top secret so...maybe.","PLAIN DOWN"]; titleFadeOut 3;
sleep 3;

if((_Humanity > _heroBunker)) exitWith {
	player playActionNow "Medic";
	cutText [format["Fine here. The code is %1 \n plz don't tell other players let them have a challenge or I change it.",_bunkercode,"%"], "PLAIN DOWN",10];
	};
	
if((_Humanity >= _SurviorBunker2) && (_Humanity <= _SurviorBunker1)) exitWith {
if(_roll <= _Chance) then 
	player playActionNow "Medic";
	sleep 0.5;
	[] execVM "bunker\ask3.sqf";	 
	}else{
	cutText [format["Sorry, its top secret but we could do a trade.......",_bunkercode,"%"], "PLAIN DOWN"];
	};
		
if((_Humanity < -_BanditBunker)) exitWith {
	player playActionNow "Medic";
	cutText [format["I told you its top secret so no!!!",_bunkercode,"%"], "PLAIN DOWN"];
	};

and

//###########################################
//ASIAN KID!!!!!!!!!!!!!!!!
//############################################
private ["_bunkercode"];
_bribe = bribe;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
_bunkercode = bunkercode;
_magazinesPlayer = magazines player;
 if (_bribe in _magazinesPlayer) exitWith {
        bunkgold = true;
    } else { bunkgold = false;};
	
if(hasBagItem) exitWith {
        player playActionNow "Medic";
		player removeMagazine _bribe;
		sleep 0.5;
		[] execVM "bunker\ask3.sqf";
    } else {
cutText [format["You don't have 1%.",_bribe,"%"], "PLAIN DOWN"];
    };
Link to comment
Share on other sites

  • 0

Does that work? exitWith might not work like that. It's supposed to be used only to escape loops but seems to work in some other cases too.

 

Here:

//###########################################
//ASIAN KID!!!!!!!!!!!!!!!!
//############################################
private ["_bunkercode"];
_Chance = 4;
_BanditBunker = BanditBunker;
_heroBunker = HeroBunker;
_SurviorBunker1 = BeforeHero;
_SurviorBunker2 = BerforeBandit;
_bunkercode = bunkercode;
_Humanity = player getVariable["humanity",0];
_roll = floor(random 100);
titleText ["Its top secret so...maybe.","PLAIN DOWN"]; titleFadeOut 3;
sleep 3;

if((_Humanity > _heroBunker)) then {
	player playActionNow "Medic";
	cutText [format["Fine here. The code is %1 \n plz don't tell other players let them have a challenge or I change it.",_bunkercode,"%"], "PLAIN DOWN",10];
};
	
if((_Humanity >= _SurviorBunker2) && (_Humanity <= _SurviorBunker1)) then {
    if(_roll <= _Chance) then {
	player playActionNow "Medic";
	sleep 0.5;
	[] execVM "bunker\ask3.sqf";	 
	}else{
	cutText [format["Sorry, its top secret but we could do a trade.......",_bunkercode,"%"], "PLAIN DOWN"];
    };
};
		
if((_Humanity < _BanditBunker)) then {
	player playActionNow "Medic";
	cutText [format["I told you its top secret so no!!!",_bunkercode,"%"], "PLAIN DOWN"];
};
//###########################################
//ASIAN KID!!!!!!!!!!!!!!!!
//############################################
private ["_bunkercode"];
_bribe = bribe;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
_bunkercode = bunkercode;
_magazinesPlayer = magazines player;

if(_bribe in _magazinesPlayer) then {
	bunkgold = true;
    }else{ 
	bunkgold = false;
};
	
if(hasBagItem) then {
        player playActionNow "Medic";
	player removeMagazine _bribe;
	sleep 0.5;
	[] execVM "bunker\ask3.sqf";
    }else{
	cutText [format["You don't have 1%.",_bribe,"%"], "PLAIN DOWN"];
};
Link to comment
Share on other sites

  • 0

 

Does that work? exitWith might not work like that. It's supposed to be used only to escape loops but seems to work in some other cases too.

 

Here:

//###########################################
//ASIAN KID!!!!!!!!!!!!!!!!
//############################################
private ["_bunkercode"];
_Chance = 4;
_BanditBunker = BanditBunker;
_heroBunker = HeroBunker;
_SurviorBunker1 = BeforeHero;
_SurviorBunker2 = BerforeBandit;
_bunkercode = bunkercode;
_Humanity = player getVariable["humanity",0];
_roll = floor(random 100);
titleText ["Its top secret so...maybe.","PLAIN DOWN"]; titleFadeOut 3;
sleep 3;

if((_Humanity > _heroBunker)) exitWith {
	player playActionNow "Medic";
	cutText [format["Fine here. The code is %1 \n plz don't tell other players let them have a challenge or I change it.",_bunkercode,"%"], "PLAIN DOWN",10];
};
	
if((_Humanity >= _SurviorBunker2) && (_Humanity <= _SurviorBunker1)) then {
if(_roll <= _Chance) then {
	player playActionNow "Medic";
	sleep 0.5;
	[] execVM "bunker\ask3.sqf";	 
	}else{
	cutText [format["Sorry, its top secret but we could do a trade.......",_bunkercode,"%"], "PLAIN DOWN"];
    };
};
		
if((_Humanity < _BanditBunker)) exitWith {
	player playActionNow "Medic";
	cutText [format["I told you its top secret so no!!!",_bunkercode,"%"], "PLAIN DOWN"];
};
//###########################################
//ASIAN KID!!!!!!!!!!!!!!!!
//############################################
private ["_bunkercode"];
_bribe = bribe;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
_bunkercode = bunkercode;
_magazinesPlayer = magazines player;

 if (_bribe in _magazinesPlayer) then {
	bunkgold = true;
    }else{ 
	bunkgold = false;
};
	
if(hasBagItem) then {
        player playActionNow "Medic";
	player removeMagazine _bribe;
	sleep 0.5;
	[] execVM "bunker\ask3.sqf";
    }else{
	cutText [format["You don't have 1%.",_bribe,"%"], "PLAIN DOWN"];
};

This parth doesnt work but the rest does

 

if((_Humanity >= _SurviorBunker2) && (_Humanity <= _SurviorBunker1)) then {
if(_roll <= _Chance) then 
	player playActionNow "Medic";
	sleep 0.5;
	[] execVM "bunker\ask3.sqf";	 
	}else{
	cutText [format["Sorry, its top secret but we could do a trade.......",_bunkercode,"%"], "PLAIN DOWN"];
	};

ANd this code doesn't work at all

 

//###########################################
//ASIAN KID!!!!!!!!!!!!!!!!
//############################################
private ["_bunkercode"];
_bribe = bribe;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
_bunkercode = bunkercode;
_magazinesPlayer = magazines player;
 if (_bribe in _magazinesPlayer) then {
        bunkgold = true;
    } else { bunkgold = false;};
	
if(hasBagItem) exitWith {
        player playActionNow "Medic";
		player removeMagazine _bribe;
		sleep 0.5;
		[] execVM "bunker\ask3.sqf";
    };
Link to comment
Share on other sites

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
  • Advertisement
  • Discord

×
×
  • Create New...