Raised This Month: $51 Target: $400
 12% 

Having TF2 Melee Troubles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
labelmaker
Member
Join Date: Mar 2009
Location: Kentucky USA
Old 06-08-2009 , 08:02   Having TF2 Melee Troubles
Reply With Quote #1

In popcorn i have a ability that will enable melee on everyone, taking all weapons except for melee, after the person who got the

ability dies, melee ends and everyone can go and pickup their weapons from resupply which is disabled during the melee session.

Everything seems to work until 5 minutes or so later weird things begin to happen. Players, namely the pyro, soldier, medic and spy,

begin losing their weapons until they are down to civilian. Im not sure if its just my code or the new update and could really use

some help with this, im stumped and I was just on the way of solving our melee issue on the server where some players wanted to

play and some did not, arguments got started and gunfire .

Heres the section of code for melee

PHP Code:
public Action:megapop(client)//g_runeActive set to 9
{
    if (
pop_megapopActive || pop_arenaMap)
    {
        
uberpop(client);
        return;
    }
    
pop_megapopActive true;
    
g_runeExtra[client] = 0;
    
g_runeActive[client] = 9;
        
meleemash(client);
}
public 
Action:meleemash(client)//megapop
{
    
pop_meleemash true;
    new 
String:name[32];
    
GetClientName(clientnamesizeof(name));
    
PrintCenterTextAll("%s has begun Melee Mash!"name);
    
PrintCenterText(client"MegaPop: Melee Mash!");
    
runesound(client);
    
SetAlpha(client255);
    
SetEntityRenderMode(clientRENDER_NORMAL);
    
SetEntityRenderColor(client5025550255);
    
//function_DisableResupply(true);
    
for (new 1<= MaxClients; ++p)
    {
        new 
weaponIndex;
        
// Iterate through weapon slots
        
for ( new 05i++ )
        {
            
// Do not remove melee weapon slot
            
if ( ( weaponIndex GetPlayerWeaponSlotp) ) != -&& != )
            {
                
RemovePlayerItempweaponIndex );
                
RemoveEdictweaponIndex );
            }
        }
    }
}
public 
Action:meleemashTime(Handle:timerany:client)
{
    new 
weaponIndex;
    
// Iterate through weapon slots
    
for ( new 05i++ )
    {
        
// Do not remove melee weapon slot
        
if ( ( weaponIndex GetPlayerWeaponSlotclient) ) != -&& != )
        {
            
RemovePlayerItemclientweaponIndex );
            
RemoveEdictweaponIndex );
        }
    }
}
public 
PlayerDeathEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if (
IsClientInGame(client))
    {
        new 
runeType g_runeActive[client];
        switch (
runeType)
        {
            case 
9:
            {
                
pop_megapopActive false;
                if (
pop_meleemash)
                {
                    
pop_meleemash false;
                    
function_DisableResupply(false);
                    
PrintCenterTextAll("Melee Mash is over, Resupplies are now Active.");
                }
            }
                }
        }
}
public 
PlayerSpawnEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if (
client 0)
    {    
        
SetEntityMoveType(clientMOVETYPE_WALK);
        
SetEntityGravity(client1.0);
        
DoColorize(client);
        if (
g_targetOnline[client] == 1)
        {
            
SaveHealth(client);
            if (
g_runeActive[client] == 9)
            {
                
pop_megapopActive false;
                
pop_frankenstein[0] = 0;
            }
            
g_runeActive[client] = 0;
            
g_runeExtra[client] = 0;
            
g_runeBox[client] = 0;
            
g_alreadykilled[client] = false;
            
g_targetTeam[client] = GetClientTeam(client);
            if (
pop_megapopActive)
            {
                if (
pop_meleemash)
                {
                    
//CreateTimer(0.1, meleemashTime, client);
                
}
            }
        }
    }
}
public 
PlayerDisconnectEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (
pop_meleemash && g_runeActive[client] == 9)
    {
        
pop_meleemash false;
        
pop_megapopActive false;
        
PrintCenterTextAll("Melee Mash is over, Resupplies are now Active.");
    }
    
g_targetOnline[client] = 0;
    
g_runeActive[client] = 0;
    
g_runeExtra[client] = 0;
    
g_runeBox[client] = 0;
    
g_targetTeam[client] = 0;

And heres the full popcorn script - popcorn.smx its activated with pop_test for now til it gets fixed.
__________________

Come Check Out the Popcorn Mod Yourself!!

Last edited by labelmaker; 06-08-2009 at 08:22.
labelmaker is offline
Send a message via Skype™ to labelmaker
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 15:02.


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