level 6
hzyzd
楼主
作者:Krixes
在客户端PBO文件里:
init.sqf 里 progressLoadingScreen 1.0;前加 call compile preprocessFileLineNumbers "config\selfbb.sqf";
-----------------------------------------------------------
config文件夹里 新建selfbb.sqf文件 写入:fnc_usec_selfActions = compile preprocessFileLineNumbers "init\fn_selfActions.sqf";
---------------------------------------------------------
然后init文件夹里fn_selfActions.sqf里 写入
_mags = magazines player;
// Krixes Self Bloodbag
if ("ItemBloodbag" in _mags) then {
hasBagItem = true;
} else { hasBagItem = false;};
if((speed player <= 1) && hasBagItem && _canDo) then {
if (s_player_selfBloodbag < 0) then {
s_player_selfBloodbag = player addaction[("<t color=""#c70000"">" + ("Self Bloodbag") +"</t>"),"config\player_selfbloodbag.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_selfBloodbag;
s_player_selfBloodbag = -1;
};
----------------------------------------------------------------------------------------------------
config里 新建player_selfbloodbag.sqf文件
该文件内容为:
player removeAction s_player_selfBloodbag; //remove the action from users scroll menu
player playActionNow "Medic"; //play bloodbag animation
sleep 5; //wait 5 seconds for animation to finish
player removeMagazine "ItemBloodbag"; //remove the used bloodbag from inventory
r_player_blood = r_player_bloodTotal; //set their blood to the maximum allowed
r_player_lowblood = false; //set lowblood setting to false
10 fadeSound 1; //slowly fade their volume back to maximum
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; //disable post processing blur effect
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5; //give them their colour back
r_player_lowblood = false; //just double checking their blood isnt low
player setVariable["USEC_BloodQty",r_player_bloodTotal,true]; //set their blood back up to maximum again
cutText [format["You have used a bloodbag on yourself!"], "PLAIN DOWN"]; //display text at bottom center of screen
if (random 10 < 1) then { //10% chance
r_player_infected = true; //set players client to show infection
player setVariable["USEC_infected",true,true]; //tell the server the player is infected
};
if (isServer) then { //if running on server
player setVariable["medForceUpdate",true]; //force the server to update the players medical status
};
2014年07月31日 16点07分
1
在客户端PBO文件里:
init.sqf 里 progressLoadingScreen 1.0;前加 call compile preprocessFileLineNumbers "config\selfbb.sqf";
-----------------------------------------------------------
config文件夹里 新建selfbb.sqf文件 写入:fnc_usec_selfActions = compile preprocessFileLineNumbers "init\fn_selfActions.sqf";
---------------------------------------------------------
然后init文件夹里fn_selfActions.sqf里 写入
_mags = magazines player;
// Krixes Self Bloodbag
if ("ItemBloodbag" in _mags) then {
hasBagItem = true;
} else { hasBagItem = false;};
if((speed player <= 1) && hasBagItem && _canDo) then {
if (s_player_selfBloodbag < 0) then {
s_player_selfBloodbag = player addaction[("<t color=""#c70000"">" + ("Self Bloodbag") +"</t>"),"config\player_selfbloodbag.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_selfBloodbag;
s_player_selfBloodbag = -1;
};
----------------------------------------------------------------------------------------------------
config里 新建player_selfbloodbag.sqf文件
该文件内容为:
player removeAction s_player_selfBloodbag; //remove the action from users scroll menu
player playActionNow "Medic"; //play bloodbag animation
sleep 5; //wait 5 seconds for animation to finish
player removeMagazine "ItemBloodbag"; //remove the used bloodbag from inventory
r_player_blood = r_player_bloodTotal; //set their blood to the maximum allowed
r_player_lowblood = false; //set lowblood setting to false
10 fadeSound 1; //slowly fade their volume back to maximum
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; //disable post processing blur effect
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5; //give them their colour back
r_player_lowblood = false; //just double checking their blood isnt low
player setVariable["USEC_BloodQty",r_player_bloodTotal,true]; //set their blood back up to maximum again
cutText [format["You have used a bloodbag on yourself!"], "PLAIN DOWN"]; //display text at bottom center of screen
if (random 10 < 1) then { //10% chance
r_player_infected = true; //set players client to show infection
player setVariable["USEC_infected",true,true]; //tell the server the player is infected
};
if (isServer) then { //if running on server
player setVariable["medForceUpdate",true]; //force the server to update the players medical status
};