Raised This Month: $ Target: $400
 0% 

Why Does My Plugin not work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xsamar
New Member
Join Date: Dec 2007
Old 12-11-2007 , 19:34   Why Does My Plugin not work?
Reply With Quote #1

Hello,

I have been coding a plugin for CS 1.6 to CONSTANTLY be monitoring to balance teams. When there is 2 people more on one team than the other, it should move one player over when they die.

Here is what i have so far, and i cant seem to see whats missing:

Code:
#include <amxmodx>
#include <engine>

#define MAXPLAYERS 32

new g_MaxPlayers
new g_UserTeam[MAXPLAYERS+1]

public plugin_init() 
{
    register_plugin("Munda Team balancer","1.0.0","GGW")
 
    g_MaxPlayers = get_maxplayers()
}

public client_putinserver(id)
{
    if(is_user_hltv(id))
        return PLUGIN_CONTINUE
    else
    {
        g_UserTeam[id] = -1
        AutoAssignPlayer(id)
    }
    return PLUGIN_CONTINUE
}

stock get_team(id) return entity_get_int(id,EV_INT_team)
stock AutoAssignPlayer(id)
{
    //client_cmd(id,"autoassign")
    engclient_cmd(id,"autoassign")
    g_UserTeam[id] = -1
    
    new Name[32]
    get_user_name(id,Name,31)
}

public Event_RoundEnd()
{
    remove_task(1)
}
xsamar is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 12-12-2007 , 00:44   Re: Why Does My Plugin not work?
Reply With Quote #2

Looks a lot like pieces EKS' NS Team Balancer code. I believe its customary to give credit where credit's due.
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 12-12-2007 , 05:33   Re: Why Does My Plugin not work?
Reply With Quote #3

There is no way that plugin was written from scratch.

new g_MaxPlayers
new g_UserTeam[MAXPLAYERS+1]

When are either of these used?
What is that task for?

Have you realised this only does anything on client-put-in-server?

And why do you have a "get user team" stock, which is never used?
(And could be done more efficiently with a #DEFINE)

Why do you get the user's name into a variable and then never use it?

And last but not least: Do you have a clue?
purple_pixie is offline
xsamar
New Member
Join Date: Dec 2007
Old 12-12-2007 , 19:33   Re: Why Does My Plugin not work?
Reply With Quote #4

It is bits and pieces from the NS plugin, and he will be given credit, when it works. No i dont have a clue what im doing.
xsamar 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 11:00.


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