Raised This Month: $ Target: $400
 0% 

Custom respawn command won't work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Handmade.Mercury
Junior Member
Join Date: Aug 2010
Old 08-04-2010 , 16:26   Custom respawn command won't work
Reply With Quote #1

Hey, I've been tinkering around with other plugins to try to learn the language, and decided to try to write my own plugin that lets a player on a certain team respawn spectators. This is what I've got:

Code:
// ZM Respawn

#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "0.1"

public Plugin:myinfo = 
{
    name = "ZM Respawn",
    author = "Handmade.Mercury",
    description = "Allows the Zombie Master to respawn spectators.",
    version = PLUGIN_VERSION,
}

public OnPluginStart()
{
    RegConsoleCmd("sm_respawn", Command_ZMRespawn);
}

public Action:Command_ZMRespawn(client, args)
{

    PrintToServer("Mark 1");
    
    if (GetClientTeam(client) != 3)
    {
        PrintToServer("Only the Zombie Master can respawn players.");
        return Plugin_Handled;
    }
    
    PrintToServer("Mark 2");
    
    for (new i=0; i<=MaxClients; i++)
    {
        PrintToServer("Looping clients...");
        
        if (IsClientInGame(i) && !IsFakeClient(i) && GetClientTeam(i) == 1)
        {
            PrintToServer("Changing client team...");
            
            ChangeClientTeam(i, 2);
        }
    }
    
    PrintToServer("The Zombie Master has respawned all players.");
    
    return Plugin_Handled;
}
I reloaded the plugin on my server, and then asked the person on team 3 to type "!respawn". I was logged into my server via HLSW, and checked the console, and there was nothing there. In-game, nothing happens. Could someone maybe point out what I'm doing wrong?
Handmade.Mercury is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 08-04-2010 , 16:35   Re: Custom respawn command won't work
Reply With Quote #2

You're in the wrong section. This is for AMXX, just scroll down a bit on the index page to find SM. ;)
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Handmade.Mercury
Junior Member
Join Date: Aug 2010
Old 08-04-2010 , 16:36   Re: Custom respawn command won't work
Reply With Quote #3

Sorry, just realized that this is the wrong forum. Could someone delete this?
Handmade.Mercury 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 00:18.


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