Raised This Month: $47 Target: $400
 11% 

Playbackrate of animations


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lux
Veteran Member
Join Date: Jan 2015
Location: Brexit
Old 11-06-2015 , 18:10   Playbackrate of animations
Reply With Quote #1

I'm trying to make the charger's playback animation playback rate go really fast in left 4 dead 2
NEW CODE
Code:
public Action:SetPummleSpeed(Handle:timer, any:client)
{
    if(client>0 && IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 3)
    { 
        new class = GetEntProp(client, Prop_Send, "m_zombieClass");
        if(class==6)
        {
            new Float:speed;
            speed=GetConVarFloat(g_iSpeed);
            if(speed>10.0)
            {
                SetEntPropFloat(client, Prop_Send,"m_flPlaybackRate", speed);             
                if(speed<1.0)
                {
                    new hp=GetEntProp(client, Prop_Send, "m_iHealth");
                    new newhp=RoundFloat(hp*speed);
                    SetEntProp(client, Prop_Send, "m_iHealth", newhp);
                    SetEntProp(client, Prop_Send, "m_iMaxHealth", newhp); 
                }        
            }
        } 
    }     
}

I have rewritten so i can have more hp like a supercharger but the playbackrate still dont work :c
OLD CODE
Code:
g_iChargePlayback =    FindSendPropInfo("Charger", "m_flPlaybackRate");

public CPummle(Handle:hEvent, const String:name[], bool:dontBroadcast)
{
    new iPvm = GetClientOfUserId(GetEventInt(hEvent, "userid"));
    
    if(iPvm < 1 || iPvm > MaxClients) 
        return;
    
    if(!IsClientInGame(iPvm) || GetClientTeam(iPvm) != 3)
        return;
    
    if(GetEntProp(iPvm, Prop_Send, "m_zombieClass") != ZOMBIECLASS_CHARGER)
        return;
        
    SetEntDataFloat(iPvm, g_iChargePlayback, 1.0/hCvar_ChargePlayback, true);
    
    return Plugin_Handled;
    
}

I'm still a noob coder but im not sure it just crashes my game asoon as i get charged

Last edited by Lux; 11-11-2015 at 06:56. Reason: Rewritten code
Lux is offline
SoulSharD
Member
Join Date: Oct 2013
Location: United Kingdom
Old 11-07-2015 , 09:32   Re: Playbackrate of animations
Reply With Quote #2

Not certain if this'll work, but perhaps try this instead.

PHP Code:
SetVariantFloat(2.0); // Double animation speed.
AcceptEntityInput(iPvm"SetPlaybackRate"); 
__________________

SoulSharD is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Brexit
Old 11-08-2015 , 07:56   Re: Playbackrate of animations
Reply With Quote #3

Nope it did not :c i'm still new to all this and i'v not saw anyone do this besides with the gunreload animation, so bit in the dark for char animation speed
Lux 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 20:13.


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