AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2]Save health, ammo, uber etc. (https://forums.alliedmods.net/showthread.php?t=316199)

MrTheBank 05-12-2019 05:57

[TF2]Save health, ammo, uber etc.
 
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:timerany:client){

    new 
vClip[3], Float:vEngClip[3], caberDetonatedcaberBrokenweapon;
    for(new 
0sizeof(vClip); i++){
        
weapon GetPlayerWeaponSlot(clienti);
        switch(
GetEntProp(weaponProp_Send"m_iItemDefinitionIndex")){
            case 
441,442,588:{
                
vEngClip[i] = GetEntPropFloat(weaponProp_Send"m_flEnergy");
            }
            
            case 
307:{
                
caberBroken GetEntProp(weaponProp_Send"m_bBroken");
                
caberDetonated GetEntProp(weaponProp_Send"m_iDetonated");
            }
            
            default:{
                
vClip[i] = GetEntProp(weaponProp_Data"m_iClip1");
            }
        }
        
    }

    new 
Float:drink    GetEntPropFloat(clientProp_Send"m_flEnergyDrinkMeter");
    new 
health        GetClientHealth(client); 
    new 
metal        GetEntProp(clientProp_Data"m_iAmmo"13);
    new 
Float:cloak    GetEntPropFloat(clientProp_Send"m_flCloakMeter");
    new 
cond        GetEntProp(clientProp_Send"m_nPlayerCond");
    
    
//
    
    
TF2_RegeneratePlayer(client);
    
    
//
    
    
for(new 0sizeof(vClip); i++){
        
weapon GetPlayerWeaponSlot(clienti);
        switch(
GetEntProp(weaponProp_Send"m_iItemDefinitionIndex")){
            case 
441,442,588:{
                
SetEntPropFloat(weaponProp_Send"m_flEnergy"vEngClip[i]);
            }
            
            case 
307:{
                
SetEntProp(weaponProp_Send"m_bBroken"caberBroken);
                
SetEntProp(weaponProp_Send"m_iDetonated"caberDetonated);
            }
            
            default:{
                
SetEntProp(weaponProp_Data"m_iClip1"vClip[i]);
            }
        }
        
    }
    
    
SetEntPropFloat(clientProp_Send"m_flEnergyDrinkMeter"drink);
    
SetEntityHealth(clienthealth);
    
SetEntProp(clientProp_Data"m_iAmmo"metal13);
    
SetEntPropFloat(clientProp_Send"m_flCloakMeter"cloak);
    
SetEntProp(clientProp_Send"m_nPlayerCond"cond);
    
    return 
Plugin_Stop;





All times are GMT -4. The time now is 19:22.

Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.