Raised This Month: $ Target: $400
 0% 

[TF2]Save health, ammo, uber etc.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrTheBank
Junior Member
Join Date: Mar 2017
Old 05-12-2019 , 05:57   [TF2]Save health, ammo, uber etc.
Reply With Quote #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: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;


MrTheBank is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:47.


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