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

M3Respawn - Respawn a dead player


Post New Thread Reply   
 
Thread Tools Display Modes
Arcano
Junior Member
Join Date: Jun 2008
Old 07-11-2008 , 21:21   Re: M3Respawn - Respawn a dead player
Reply With Quote #11

yeah i already got the team respawning command figured out yesterday, but now im wondering about the auto respawn. im trying to respawn all players every 15 seconds (like dod:s) sort of like gg reinforcements or soemthing of the sort. im still looking around though before i go asking other people ;P

already tried looking at crontab by dubbeh but it only goes into minutes not seconds. Roundcron is my next option but i dont want to rely on wait commands.

Last edited by Arcano; 07-12-2008 at 09:53.
Arcano is offline
sessus
Senior Member
Join Date: May 2006
Old 10-13-2008 , 04:13   Re: M3Respawn - Respawn a dead player
Reply With Quote #12

Great and simple plugin. I am using it at the moment together with gungame as a CSSM replacement. I have removed the last part of the plugin to make it less noisy ;)
Attached Files
File Type: sp Get Plugin or Get Source (m3respawn (less noise).sp - 725 views - 1.1 KB)
sessus is offline
mikkelmaj
Member
Join Date: Apr 2008
Old 12-06-2008 , 05:59   Re: M3Respawn - Respawn a dead player
Reply With Quote #13

Here are a danish version
Code:
#pragma semicolon 1
#include <sourcemod>
#include <cstrike>
public Plugin:myinfo = {
 name = "M3Respawn - Respawn a dead player",
 author = "M3Studios, Inc.",
 description = "Let's admins respawn any dead player.",
 version = "0.1.0",
 url = "http://www.m3studiosinc.com/"
}
public OnPluginStart() {
 RegAdminCmd("sm_respawn", CmdRespawn, ADMFLAG_KICK, "sm_respawn <#userid|name>");
}
public Action:CmdRespawn(client, args) {
 if (args != 1) {
  return Plugin_Handled; 
 }
 
 new String:Target[64];
 GetCmdArg(1, Target, sizeof(Target));
 
 new String:targetName[MAX_TARGET_LENGTH];
 new targetList[MAXPLAYERS], targetCount;
 new bool:tnIsMl;
 
 targetCount = ProcessTargetString(Target, client, targetList, sizeof(targetList), COMMAND_FILTER_DEAD, targetName, sizeof(targetName), tnIsMl);
 if(targetCount == 0) {
  ReplyToTargetError(client, COMMAND_TARGET_NONE);
 } else {
  for (new i=0; i<targetCount; i++) {
   doRespawn(client, targetList[i]);
  }
 }
 
 return Plugin_Continue;
}
public doRespawn(client, target) {
 if(client != target) {
  new String:adminName[MAX_NAME_LENGTH];
  GetClientName(client, adminName, sizeof(adminName));
  
  PrintCenterText(target, "%s Har givet dig en ny chance", adminName);
 }
 
 CS_RespawnPlayer(target);
}
mikkelmaj is offline
recon0
Veteran Member
Join Date: Sep 2007
Location: US
Old 12-06-2008 , 06:25   Re: M3Respawn - Respawn a dead player
Reply With Quote #14

You guys should use translations.
__________________
recon0 is offline
mikkelmaj
Member
Join Date: Apr 2008
Old 12-06-2008 , 06:31   Re: M3Respawn - Respawn a dead player
Reply With Quote #15

??
mikkelmaj is offline
k4rnage
Member
Join Date: Aug 2007
Old 04-26-2009 , 08:05   Re: M3Respawn - Respawn a dead player
Reply With Quote #16

Works great !
k4rnage is offline
FrozenHaxor
Senior Member
Join Date: Jun 2009
Location: Poland
Old 06-25-2009 , 03:38   Re: M3Respawn - Respawn a dead player
Reply With Quote #17

Don't work for me. Running on CS:S...
FrozenHaxor is offline
NouveauJoueur
SourceMod Donor
Join Date: May 2009
Old 06-27-2009 , 12:09   Re: M3Respawn - Respawn a dead player
Reply With Quote #18

Same here, it used to work but doesn't work with the latest sourcemod version. I even compiled it my self so i was sure that it was the latest compiler version too, but still not working anyway "Unable to read file"

EDIT : My mistake i guess, just rerecompiled the plugin and it's loaded, I have to test it now.
EDIT2 : Works fine.

Last edited by NouveauJoueur; 07-01-2009 at 16:19.
NouveauJoueur is offline
jojo86
BANNED
Join Date: Mar 2009
Old 07-17-2009 , 10:11   Re: M3Respawn - Respawn a dead player
Reply With Quote #19

can you add this plugin to sourcemod admin menu ?
jojo86 is offline
[BlooD]+Jigsaw+
New Member
Join Date: Jul 2010
Old 07-23-2010 , 08:51   Re: M3Respawn - Respawn a dead player
Reply With Quote #20

I've made the plugin compatible to Adminmenu :

Code:
#pragma semicolon 1
#include <sourcemod>
#include <cstrike>
#include <colors>
#include <sdktools_functions>
#undef REQUIRE_PLUGIN
#include <adminmenu>

new Handle:hAdminMenu = INVALID_HANDLE;

// new Handle:g_Target[MAXPLAYERS+1];

#define PLUGIN_VERSION "1.0.102"


public Plugin:myinfo = {
    name = "M3Respawn - Respawn a dead player reloaded",
    author = "M3Studios, Inc.",
    description = "Let's admins respawn any dead player.",
    version = "1.1.0",
    url = "http://www.m3studiosinc.com/"
}

public OnPluginStart() {
    RegAdminCmd("sm_respawn", CmdRespawn, ADMFLAG_KICK, "sm_respawn <#userid|name>");
    
    new Handle:topmenu;
    if(LibraryExists("adminmenu") && ((topmenu = GetAdminTopMenu()) != INVALID_HANDLE))
    {
        OnAdminMenuReady(topmenu);
    }
}

public Action:CmdRespawn(client, args) {
    decl String:target[65];
    decl String:target_name[MAX_TARGET_LENGTH];
    decl target_list[MAXPLAYERS];
    decl target_count;
    decl bool:tn_is_ml;
    
    if (args < 1)
    {
        ReplyToCommand(client, "[SM] Usage: sm_respawn <#userid|name>");
        return Plugin_Handled;
    }
    
    GetCmdArg(1, target, sizeof(target));
    
    if((target_count = ProcessTargetString(
            target,
            client,
            target_list,
            MAXPLAYERS,
            0,
            target_name,
            sizeof(target_name),
            tn_is_ml)) <= 0)
    {
        ReplyToTargetError(client, target_count);
        return Plugin_Handled;
    }
        
    for (new i = 0; i < target_count; i++)
    {
        if (IsClientInGame(target_list[i]) && IsPlayerAlive(target_list[i]))
        {
            doRespawn(client, target_list[i]);
        }
    }
    return Plugin_Handled;
}

public OnLibraryRemoved(const String:name[])
{
    if (StrEqual(name, "adminmenu")) 
    {
        hAdminMenu = INVALID_HANDLE;
    }
}

public OnAdminMenuReady(Handle:topmenu)
{
    if (topmenu == hAdminMenu)
    {
        return;
    }
    
    hAdminMenu = topmenu;

    new TopMenuObject:player_commands = FindTopMenuCategory(hAdminMenu, ADMINMENU_PLAYERCOMMANDS);

    if (player_commands != INVALID_TOPMENUOBJECT)
    {
        AddToTopMenu(hAdminMenu,
            "sm_respawn",
            TopMenuObject_Item,
            AdminMenu_Respawn, 
            player_commands,
            "sm_respawn",
            ADMFLAG_KICK);
    }
}

public AdminMenu_Respawn( Handle:topmenu, TopMenuAction:action, TopMenuObject:object_id, param, String:buffer[], maxlength )
{
    if (action == TopMenuAction_DisplayOption)
    {
        Format(buffer, maxlength, "Respawn Dead Players");
    }
    else if( action == TopMenuAction_SelectOption)
    {
        DisplayPlayerMenu(param);
    }
}

DisplayPlayerMenu(client)
{
    new Handle:menu = CreateMenu(MenuHandler_Players);
    
    decl String:title[100];
    Format(title, sizeof(title), "Choose Player to Respawn:");
    SetMenuTitle(menu, title);
    SetMenuExitBackButton(menu, true);
    
    AddTargetsToMenu2(menu, client, COMMAND_FILTER_DEAD);
    if(GetMenuItemCount(menu) == 0)        
    {
        AddMenuItem(menu,"refresh","Refresh",ITEMDRAW_DEFAULT);
        AddMenuItem(menu,"no_client","No aviable client",ITEMDRAW_DISABLED);
    }
    
    DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

public MenuHandler_Players(Handle:menu, MenuAction:action, param1, param2)
{
    if (action == MenuAction_End)
    {
        CloseHandle(menu);
    }
    else if (action == MenuAction_Cancel)
    {
        if (param2 == MenuCancel_ExitBack && hAdminMenu != INVALID_HANDLE)
        {
            DisplayTopMenu(hAdminMenu, param1, TopMenuPosition_LastCategory);
        }
    }
    else if (action == MenuAction_Select)
    {
        decl String:info[32];
        new userid, target;
        
        GetMenuItem(menu, param2, info, sizeof(info));
        if(!StrEqual(info,"no_client",true) && !StrEqual(info,"refresh",true))
        {
            userid = StringToInt(info);

            if ((target = GetClientOfUserId(userid)) == 0)
            {
                CPrintToChat(param1, "{olive}[SM] {red}%s", "Player no longer available");
            }
            else if (!CanUserTarget(param1, target))
            {
                CPrintToChat(param1, "{olive}[SM] {red}%s", "Unable to target");
            }
            else
            {    
                decl String:targetname[60];
                GetClientName(target,targetname,sizeof(targetname));
                doRespawn(param1, target);
                CPrintToChatEx(param1,target,"{olive}[M3Respawn] {green}You have Respawned {teamcolor}%s",targetname); 
            }
            
            /* Re-draw the menu if they're still valid */
            if (IsClientInGame(param1) && !IsClientInKickQueue(param1))
            {
                DisplayPlayerMenu(param1);
            }
        }
        else
        {
            if(StrEqual(info,"refresh",true) && IsClientInGame(param1) && !IsClientInKickQueue(param1))        DisplayPlayerMenu(param1);
        }
    }
}

public doRespawn(client, target) {
    new String:adminName[MAX_NAME_LENGTH];
    GetClientName(client, adminName, sizeof(adminName));
        
    CPrintToChatEx(target,client,"{green}(ADMIN) {teamcolor}%s {olive}has given you another chance",adminName);
    
    CS_RespawnPlayer(target);
}


ATTENTION:

This plugin requires the latest version of

colors.inc by Exvel
( http://forums.alliedmods.net/attachm...3&d=1277457384 )

Last edited by [BlooD]+Jigsaw+; 07-23-2010 at 08:53.
[BlooD]+Jigsaw+ 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 16:00.


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