Raised This Month: $ Target: $400
 0% 

[TF2] Making screen effects.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Alfonso Crawford
Member
Join Date: Feb 2012
Old 07-12-2013 , 20:32   Re: [TF2] Making screen effects.
Reply With Quote #4

Aw, yeah! That's what I was looking for!

I've tried to implement it, but it's not working, though. Here's the relevant code, that ultimately results in nothing. What am I doing incorrectly?

PHP Code:
...

new 
String:StunOverlay[17] = "overlays/firestun";
new 
String:StunOverlay_VTF[31] = "materials/overlays/firestun.vtf";
new 
String:StunOverlay_VMT[31] = "materials/overlays/firestun.vmt";

...

public 
OnMapStart() {
    
AddFileToDownloadsTable(StunOverlay_VTF);
    
AddFileToDownloadsTable(StunOverlay_VMT);
    
PrecacheDecal(StunOverlay_VTFtrue);
}

public 
OnGameFrame() {
    if(!
CvarMasterSwitch) return;

    new 
Float:tick GetTickInterval();

    for(new 
1<= MaxClientsi++) {
        if(!
IsClientInGame(i) || !IsPlayerAlive(i) || TF2_GetPlayerClass(i) == TFClass_Pyro || !TF2_IsPlayerInCondition(iTFCond_OnFire)) BurnTimers[i] = 0.0;
        else if(
TF2_IsPlayerInCondition(iTFCond_OnFire)) {
            if(
CvarPanic && BurnTimers[i] >= 0.0) {
                
BurnTimers[i] -= tick;
                if(
BurnTimers[i] <= 0.0) {
                    
Client_SetScreenOverlay(i"off");
                    
Client_SetScreenOverlay(i"");
                    
BurnTimers[i] = 0.0;
                }
                else if(
CvarPanic) {
                    
Client_SetScreenOverlay(iStunOverlay_VTF);

                    if(
TF2_GetPlayerClass(i) == TFClass_ScoutSetEntPropFloat(iProp_Send"m_flMaxspeed"GetConVarFloat(CvarScoutPanic));
                    else if(
TF2_GetPlayerClass(i) == TFClass_SoldierSetEntPropFloat(iProp_Send"m_flMaxspeed"GetConVarFloat(CvarSoldierPanic));
                    else 
SetEntPropFloat(iProp_Send"m_flMaxspeed"GetConVarFloat(CvarPanicSpeed));
                }
            }
        }
    }
}

... 
I ripped the code from CS:Online Overlays, which may have been where I went wrong.
Alfonso Crawford is offline
 



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 21:28.


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