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

Solved [CS:GO] [TTT] Mark players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jezis
AlliedModders Donor
Join Date: Jul 2016
Location: Czech Republic
Old 09-20-2017 , 13:50   [CS:GO] [TTT] Mark players
Reply With Quote #1

Hello,

I would like to request a plugin, that will let CT when the round starts mark a specific player by aiming on him and pressing a specific color in menu to a green, red or netural(none) color.


Example: I write !mark, a menu pops up and i can mark a player in front of me green, because he is innocent, or red if he is suspicious. Also no color would be great, if missclick...


Thank you in advance <3
__________________


Last edited by Jezis; 09-27-2017 at 09:42.
Jezis is offline
Send a message via ICQ to Jezis
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 09-20-2017 , 16:45   Re: [CS:GO] [TTT] Mark players
Reply With Quote #2

Try this:
PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_AUTHOR "Hexah"
#define PLUGIN_VERSION "1.00"


public Plugin myinfo 
{
    
name "Mark Players"
    
author PLUGIN_AUTHOR
    
description ""
    
version PLUGIN_VERSION
    
url "https://forums.alliedmods.net/showthread.php?t=301424"
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_mark"Cmd_Mark);
}

public 
Action Cmd_Mark(int clientint args)
{
    if (!
IsPlayerAlive(client))
    {
        
ReplyToCommand(client"[SM] You must be alive to do this!");
        return 
Plugin_Handled;
    }
    if (
GetClientTeam(client) != CS_TEAM_CT)
    {
        
ReplyToCommand(client"[SM] You must be CT to do this command!");
        return 
Plugin_Handled;
    }
    
    
Menu menu = new Menu(ColorMenuHandler);
    
    
menu.SetTitle("Aim and Mark!");
    
    
menu.AddItem("Red""Red");
    
menu.AddItem("Green""Green");
    
menu.AddItem("NoColor""No Color");
    
    
menu.Display(clientMENU_TIME_FOREVER);
    return 
Plugin_Handled;
}

public 
int ColorMenuHandler(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_Select)
    {
        
        if (!
IsPlayerAlive(param1))
        {
            
PrintToChat(param1"[SM] You must be alive to do this!");
            return;
        }
        if (
GetClientTeam(param1) != CS_TEAM_CT)
        {
            
PrintToChat(param1"[SM] You must be CT to mark someone!");
            return;
        }
        
        
char info[32];
        
menu.GetItem(param2infosizeof(info));
        
        
int target GetClientAimTarget(param1);
        
        if (
target == -1)
            return;
        
        if (
StrEqual(info"Red"))
        {
            
SetEntityRenderColor(target25500255);
        }
        else if (
StrEqual(info"Green"))
        {
            
SetEntityRenderColor(target02550255);
        }
        else
        {
            
SetEntityRenderColor(target);
        }
    }
    else if (
action == MenuAction_End)
    {
        
delete menu;
    }

All CTs Can do !mark to mark someone.

Not tested.
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!

Last edited by Papero; 09-21-2017 at 08:32. Reason: Updated Thx nhnkil
Papero is offline
nhnkl159
Senior Member
Join Date: Jul 2012
Location: Israel 3>
Old 09-20-2017 , 17:01   Re: [CS:GO] [TTT] Mark players
Reply With Quote #3

Quote:
Originally Posted by Papero View Post
Try this:
PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_AUTHOR "Hexah"
#define PLUGIN_VERSION "1.00"


public Plugin myinfo 
{
    
name "Mark Players"
    
author PLUGIN_AUTHOR
    
description ""
    
version PLUGIN_VERSION
    
url "https://forums.alliedmods.net/showthread.php?t=301424"
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_mark"Cmd_Mark);
}

public 
Action Cmd_Mark(int clientint args)
{
    if (!
IsPlayerAlive(client))
    {
        
ReplyToCommand(client"[SM] You must be alive to do this!");
        return 
Plugin_Handled;
    }
    if (
GetClientTeam(client) != CS_TEAM_CT)
    {
        
ReplyToCommand(client"[SM] You must be CT to do this command!");
        return 
Plugin_Handled;
    }
    
    
Menu menu = new Menu(ColorMenuHandler);
    
    
menu.SetTitle("Aim and Mark!");
    
    
menu.AddItem("Red""Red");
    
menu.AddItem("Green""Green");
    
menu.AddItem("NoColor""No Color");
    
    return 
Plugin_Handled;
}

public 
int ColorMenuHandler(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_Select)
    {
        
char info[32];
        
menu.GetItem(param2infosizeof(info));
        
        
int target GetClientAimTarget(param1);
        
        if (
target == -1)
            return;
        
        if (
StrEqual(info"Red"))
        {
            
SetEntityRenderColor(target25500255);
        }
        else if (
StrEqual(info"Green"))
        {
            
SetEntityRenderColor(target02550255);
        }
        else
        {
            
SetEntityRenderColor(target);
        }
    }
    else if (
action == MenuAction_End)
    {
        
delete menu;
    }

All CTs Can do !mark to mark someone.

Not tested.
You aren't displaying the menu to anyone, plus always check if the player is in the correct team even inside the handler.
__________________
nhnkl159 is offline
Send a message via Skype™ to nhnkl159
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 09-20-2017 , 17:13   Re: [CS:GO] [TTT] Mark players
Reply With Quote #4

Quote:
Originally Posted by nhnkl159 View Post
You aren't displaying the menu to anyone, plus always check if the player is in the correct team even inside the handler.
I forgot completely about displaying. I will add a check also for the team in the handler also.

EDIT: Updated the first post.
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!

Last edited by Papero; 09-21-2017 at 08:32.
Papero is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 09-20-2017 , 18:09   Re: [CS:GO] [TTT] Mark players
Reply With Quote #5

I think he wants something like in the Gmod TTT where you could 'mark' players as being suspicious or dead or friendly. Some player could use this to determine that a player is considered innocent instead of remembering it all round.
Mitchell is offline
Jezis
AlliedModders Donor
Join Date: Jul 2016
Location: Czech Republic
Old 09-27-2017 , 09:41   Re: [CS:GO] [TTT] Mark players
Reply With Quote #6

Works great! Thank you
__________________

Jezis is offline
Send a message via ICQ to Jezis
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 00:42.


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