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

[ALL] Simple 'Move To Spec' plugin


Post New Thread Reply   
 
Thread Tools Display Modes
bebe9b
Veteran Member
Join Date: May 2009
Location: Romania
Old 05-29-2018 , 12:18   Re: [ALL] Simple 'Move To Spec' plugin
Reply With Quote #11

Hi,
Pls fix plugin:
L 05/28/2018 - 112:29: [SM] Exception reported: Language phrase "No matching client" not found
L 05/28/2018 - 112:29: [SM] Blaming: SendToSpec.smx
L 05/28/2018 - 112:29: [SM] Call stack trace:
L 05/28/2018 - 112:29: [SM] [0] ReplyToCommand
L 05/28/2018 - 112:29: [SM] [1] Line 103, C:\Users\Arkarr\Desktop\120$\scripting\includ e\commandfilters.inc::ReplyToTargetError
L 05/28/2018 - 112:29: [SM] [2] Line 56, C:\Users\Arkarr\Desktop\120$\scripting\SendTo Spec.sp::ForceSendPlayerAFK
L 05/28/2018 - 112:29: [SM] Exception reported: Language phrase "No matching client" not found

Thx,
__________________
respecta si vei fi respectat
bebe9b is offline
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 05-29-2018 , 12:56   Re: [ALL] Simple 'Move To Spec' plugin
Reply With Quote #12

Add -> LoadTranslations("common.phrases"); to OnPluginStart to fix this error.
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
bebe9b
Veteran Member
Join Date: May 2009
Location: Romania
Old 01-13-2019 , 06:48   Re: [ALL] Simple 'Move To Spec' plugin
Reply With Quote #13

Hi,
I did as you said but when I compiled the plugin, this message appears:
compile\addons\sourcemod\scripting\SendToSpec .sp(1 : warning 217: lose indentation

public OnPluginStart()
{
RegConsoleCmd("sm_spec", SendPlayerAFK, "Send player to spec team.");
RegConsoleCmd("sm_afk", SendPlayerAFK, "Send player to spec team.");
RegAdminCmd("sm_fspec", ForceSendPlayerAFK, ADMFLAG_GENERIC, "Force a player to be in spec team.");
LoadTranslations("common.phrases");
}
__________________
respecta si vei fi respectat

Last edited by bebe9b; 01-13-2019 at 06:48.
bebe9b is offline
Jezis
AlliedModders Donor
Join Date: Jul 2016
Location: Czech Republic
Old 01-13-2019 , 06:58   Re: [ALL] Simple 'Move To Spec' plugin
Reply With Quote #14

I compiled it without any errors, so here you go.
Attached Files
File Type: sp Get Plugin or Get Source (SendToSpec.sp - 95 views - 2.1 KB)
File Type: smx SendToSpec.smx (11.5 KB, 83 views)
__________________

Jezis is offline
Send a message via ICQ to Jezis
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 01-13-2019 , 08:19   Re: [ALL] Simple 'Move To Spec' plugin
Reply With Quote #15

Fixed plugin. Updated translation missing.
__________________
Want to check my plugins ?
Arkarr is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 01-13-2019 , 10:37   Re: [ALL] Simple 'Move To Spec' plugin
Reply With Quote #16

This is how your plugin should look like:

PHP Code:

#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <cstrike>

public Plugin myinfo 
{
    
name "Send player to spec",
    
author "Arkarr",
    
description "A simple spectator manager.",
    
version "1.0",
    
url "http://www.sourcemod.net"
};

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_spec"Command_Spectator"Send player to spec team.");
    
RegConsoleCmd("sm_afk"Command_Spectator"Send player to spec team.");
    
RegAdminCmd("sm_fspec"ForceSendPlayerAFKADMFLAG_GENERIC"sage: sm_fspec <#userid|name>");
    
    
LoadTranslations("common.phrases");
}

public 
Action Command_Spectator(int clientint args)
{
    if (
client// commands can be executed by Console (client == 0)
    
{
        
SendPlayerToSpectators(client);
    }
    
    return 
Plugin_Handled;
}

public 
Action ForceSendPlayerAFK(int clientint args)
{
    if (
args 1)
    {
        
ReplyToCommand(client"[SM] Usage: sm_fspec <#userid|name>");
        return 
Plugin_Handled;
    }
    
    
char arg[MAX_TARGET_LENGTH];
    
GetCmdArg(1argsizeof(arg));
    
    
char target_name[MAX_TARGET_LENGTH];
    
int target_list[MAXPLAYERS], target_count;
    
bool tn_is_ml;
    
    if ((
target_count ProcessTargetString(
            
arg,
            
client
            
target_list
            
MAXPLAYERS
            
COMMAND_FILTER_CONNECTED,
            
target_name,
            
sizeof(target_name),
            
tn_is_ml)) > 0)
    {
        for (
int i 0target_counti++)
        {
            
SendPlayerToSpectators(target_list[i]);
        }
    }
    else
    {
        
ReplyToTargetError(clienttarget_count);
    }
    
    return 
Plugin_Handled;
}

void SendPlayerToSpectators(int client)
{
    if (
GetClientTeam(client) != CS_TEAM_SPECTATOR)
    {
        if (
IsPlayerAlive(client))
        {
            
ForcePlayerSuicide(client);
        }
        
        
ChangeClientTeam(clientCS_TEAM_SPECTATOR);
    }

Use the new syntax and you should kill the player if he's alive (for csgo: if he's the last player alive and he moves to spec with these commands, then the round will not end).
__________________
Ilusion9 is offline
bebe9b
Veteran Member
Join Date: May 2009
Location: Romania
Old 01-13-2019 , 14:14   Re: [ALL] Simple 'Move To Spec' plugin
Reply With Quote #17

Thx all.
Multumesc pentru raspuns.
__________________
respecta si vei fi respectat
bebe9b is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 01-13-2019 , 15:13   Re: [ALL] Simple 'Move To Spec' plugin
Reply With Quote #18

Quote:
Originally Posted by Ilusion9 View Post
[...]
Yeah, I guess.
That plugin is old, I should rewrite it.

Thanks for the code tho.
__________________
Want to check my plugins ?
Arkarr is offline
bebe9b
Veteran Member
Join Date: May 2009
Location: Romania
Old 01-13-2019 , 15:28   Re: [ALL] Simple 'Move To Spec' plugin
Reply With Quote #19

Hi,
When i want to compile plugin , this message appears:

/groups/sourcemod/compiler-1.7/include/sdktools_engine.inc(49) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_engine.inc(59) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_engine.inc(59) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_engine.inc(69) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(47) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(5 : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(5 : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(6 : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(81) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(90) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(102) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(102) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(102) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(102) : fatal error 189: too many error messages on one line

Compilation aborted.
14 Errors.

Thx,
__________________
respecta si vei fi respectat
bebe9b is offline
Cruze
Veteran Member
Join Date: May 2017
Old 01-13-2019 , 23:56   Re: [ALL] Simple 'Move To Spec' plugin
Reply With Quote #20

Quote:
Originally Posted by bebe9b View Post
Hi,
When i want to compile plugin , this message appears:

/groups/sourcemod/compiler-1.7/include/sdktools_engine.inc(49) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_engine.inc(59) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_engine.inc(59) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_engine.inc(69) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(47) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(5 : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(5 : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(6 : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(81) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(90) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(102) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(102) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(102) : error 147: new-style declarations are required
/groups/sourcemod/compiler-1.7/include/sdktools_functions.inc(102) : fatal error 189: too many error messages on one line

Compilation aborted.
14 Errors.

Thx,
Update your include files!
__________________
Taking paid private requests! Contact me
Cruze 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 12:49.


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