Junior Member
|

05-12-2019
, 05:57
[TF2]Save health, ammo, uber etc.
|
#1
|
Well, I use TF2_RegeneratePlayer function and its regenerate everything. I don't want this function to regenerate health, ammo, clock etc. So anyone have a function which will save health, ammo and set it after TF2_RegeneratePlayer? Thanks!
This is script and its not working. It's only working for health.
PHP Code:
public Action:Timer_Resupply_Post(Handle:timer, any:client){
new vClip[3], Float:vEngClip[3], caberDetonated, caberBroken, weapon;
for(new i = 0; i < sizeof(vClip); i++){
weapon = GetPlayerWeaponSlot(client, i);
switch(GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex")){
case 441,442,588:{
vEngClip[i] = GetEntPropFloat(weapon, Prop_Send, "m_flEnergy");
}
case 307:{
caberBroken = GetEntProp(weapon, Prop_Send, "m_bBroken");
caberDetonated = GetEntProp(weapon, Prop_Send, "m_iDetonated");
}
default:{
vClip[i] = GetEntProp(weapon, Prop_Data, "m_iClip1");
}
}
}
new Float:drink = GetEntPropFloat(client, Prop_Send, "m_flEnergyDrinkMeter");
new health = GetClientHealth(client);
new metal = GetEntProp(client, Prop_Data, "m_iAmmo", 1, 3);
new Float:cloak = GetEntPropFloat(client, Prop_Send, "m_flCloakMeter");
new cond = GetEntProp(client, Prop_Send, "m_nPlayerCond");
//
TF2_RegeneratePlayer(client);
//
for(new i = 0; i < sizeof(vClip); i++){
weapon = GetPlayerWeaponSlot(client, i);
switch(GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex")){
case 441,442,588:{
SetEntPropFloat(weapon, Prop_Send, "m_flEnergy", vEngClip[i]);
}
case 307:{
SetEntProp(weapon, Prop_Send, "m_bBroken", caberBroken);
SetEntProp(weapon, Prop_Send, "m_iDetonated", caberDetonated);
}
default:{
SetEntProp(weapon, Prop_Data, "m_iClip1", vClip[i]);
}
}
}
SetEntPropFloat(client, Prop_Send, "m_flEnergyDrinkMeter", drink);
SetEntityHealth(client, health);
SetEntProp(client, Prop_Data, "m_iAmmo", metal, 1, 3);
SetEntPropFloat(client, Prop_Send, "m_flCloakMeter", cloak);
SetEntProp(client, Prop_Send, "m_nPlayerCond", cond);
return Plugin_Stop;
}
|
|