This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Spell limits for teleport//tiny


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 10-27-2014 , 18:44   Spell limits for teleport//tiny
Reply With Quote #1

There's some bugs associated with these spells, and I didn't see any snippets to limit them so I wrote this. Probably some people will be using tf_spells_enabled 1, since it's available now. Basically, teleport allows people to escape maps, and tiny bugs out and allows people to fall through maps when they become normal sized (sometimes).
You'll still get the infinite jump/rapid fire boost from the cond though. I replaced teleport with a respawn and random high tier spell summon. Also, since there's no limit on how many spell drops can spawn (if you get some kind of loop where players die a lot, or you set the tf_player_spell_drop_on_death_rate to 1 and such, you may get tons of spells. You can limit that by time. I set it to 2 seconds.

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <tf2_stocks>
#include <sdkhooks>

public Plugin:myinfo =
{
    
name "Spell Limits",
    
author "Friagram",
    
description "Derp",
    
version "1.1",
    
url "http://steamcommunity.com/groups/poniponiponi"
};

public 
TF2_OnConditionAdded(clientTFCond:condition)
{
    if(
condition == TFCond_HalloweenTiny)
    {
        
TF2_RemoveCondition(clientTFCond_HalloweenTiny);
    }
}

public 
OnEntityCreated(entity, const String:classname[])
{
    static 
lastspell;

    if(
StrEqual(classname"tf_projectile_spelltransposeteleport"))
    {
        
SDKHook(entitySDKHook_SpawnPostCheckSpellSpawn);
    }
    else if(
StrEqual(classname"tf_spell_pickup"))
    {
        new 
time GetTime();
        if(
lastspell time)
        {
            
SDKHook(entitySDKHook_SpawnPostPickupSpawn);
        }
        
lastspell time 2;
    }
}

public 
Action:PickupSpawn(entity)
{
    
AcceptEntityInput(entity"Kill");
}

public 
Action:CheckSpellSpawn(entity)
{
    
RequestFrame(CheckSpellOwnerEntIndexToEntRef(entity));

    
SDKUnhook(entitySDKHook_SpawnPostCheckSpellSpawn);
}

public 
CheckSpellOwner(any:ref)
{
    new 
entity EntRefToEntIndex(ref);
    if(
entity != INVALID_ENT_REFERENCE)
    {
        new 
client GetEntPropEnt(entityProp_Send"m_hOwnerEntity");

        if(
client >&& client<=MaxClients && IsClientInGame(client))
        {
            
AcceptEntityInput(client"RollRareSpell");
        }
        
AcceptEntityInput(entity"Kill");
    }

__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 10-27-2014 at 19:46.
friagram is offline
Reply



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 03:03.


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