AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Custom respawn command won't work (https://forums.alliedmods.net/showthread.php?t=134436)

Handmade.Mercury 08-04-2010 16:26

Custom respawn command won't work
 
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?

DarkGod 08-04-2010 16:35

Re: Custom respawn command won't work
 
You're in the wrong section. This is for AMXX, just scroll down a bit on the index page to find SM. ;)

Handmade.Mercury 08-04-2010 16:36

Re: Custom respawn command won't work
 
Sorry, just realized that this is the wrong forum. Could someone delete this?


All times are GMT -4. The time now is 00:18.

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