Raised This Month: $32 Target: $400
 8% 

I need this plugin! [CSGO]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
albiaps
Member
Join Date: Jun 2020
Old 06-19-2020 , 22:31   I need this plugin! [CSGO]
Reply With Quote #1

Hello People.

I need the !report plugin, simple command.
When the player writes "report", the menu of the players you want to report appears, after you click the player, the message will appear in the game as "Your report was sent to admin staff" if you could help me with this, as well as color , I would have thanked you. [SORRY FOR MY ENGLISH]

Like this: https://forums.alliedmods.net/showthread.php?p=1746332

I like this, just in this plugin i can't make COLORS, and this plugin not working for players, just admins can report. When player write "!report" dosn't show anything to her.

Thank u <3
__________________
albiaps is offline
tair
Junior Member
Join Date: Apr 2015
Location: OnGameFrame()
Old 06-20-2020 , 19:50   Re: I need this plugin! [CSGO]
Reply With Quote #2

Here you go,
I did not tested it yet, but it should be working.

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo = {
    
name        "Simple Report",
    
author      "Tair",
    
description "Simple plugin that enable you to report on other players in the server",
    
version     "1.0",
    
url         ""
};


public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_report" Cmd_Report);
}


public 
Action Cmd_Report(int clientint args)
{
    
Handle menu CreateMenu(ReportMenuHandler);
    
SetMenuTitle(menu"Choose a player:");

    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsValidClient(i)) continue;

        
char sID[4], sName[16];

        
GetClientName(isNamesizeof(sName));
        
Format(sIDsizeof(sID), "%d"i);

        
AddMenuItem(menusIDsName);
    }

    
SetMenuExitButton(menutrue);

    if (
GetMenuItemCount(menu) > 0)
    {
        
DisplayMenu(menuclient60);
    }
    else
    {
        
AddMenuItem(menu"""No players are currently online.");
        
DisplayMenu(menuclient30);
    }

    return 
Plugin_Handled;
}

public 
int ReportMenuHandler(Handle menuMenuAction actionint clientint itemNum)
{
    if (
action == MenuAction_Select)
    {
        
char sInfo[32];
        
GetMenuItem(menuitemNumsInfosizeof(sInfo));

        for (
int i 1<= MaxClientsi++)
        {
            if (!
IsValidClient(i) && (StringToInt(sInfo) != i)) continue;

            for (
int j 1<= MaxClientsj++)
            {
                if (
IsValidClient(j))
                {
                    if (
CheckCommandAccess(j""ADMFLAG_GENERIC))
                    {
                        
PrintToChat(j" \x04[SM] \x01The player \x04%N \x01reported on the player \x04%N\x01."clienti);
                    }
                }
            }

            
PrintToChat(client" \x04[SM] \x01Your report about (\x04%N\x01) was sent to admin staff."i);
            return;
        }
    }

    if (
action == MenuAction_End)
    {
        
CloseHandle(menu);
    }
}


stock bool IsValidClient(int client)
{
    if (
client <= || client MaxClients || !IsClientConnected(client) || (IsFakeClient(client)))
    {
        return 
false;
    }
    return 
IsClientInGame(client);


Last edited by tair; 06-20-2020 at 19:54.
tair is offline
albiaps
Member
Join Date: Jun 2020
Old 06-22-2020 , 17:21   Re: I need this plugin! [CSGO]
Reply With Quote #3

Ohh thanks bro, i didn't test but, this plugin have a text document like "report_logs.txt" to configs or something, when a player report the report going in this text document ??
Or if you can make it, you will help me so much <3 Anyway thank you again
__________________
albiaps is offline
albiaps
Member
Join Date: Jun 2020
Old 06-22-2020 , 19:55   Re: I need this plugin! [CSGO]
Reply With Quote #4

Quote:
Originally Posted by tair View Post
Here you go,
I did not tested it yet, but it should be working.

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo = {
    
name        "Simple Report",
    
author      "Tair",
    
description "Simple plugin that enable you to report on other players in the server",
    
version     "1.0",
    
url         ""
};


public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_report" Cmd_Report);
}


public 
Action Cmd_Report(int clientint args)
{
    
Handle menu CreateMenu(ReportMenuHandler);
    
SetMenuTitle(menu"Choose a player:");

    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsValidClient(i)) continue;

        
char sID[4], sName[16];

        
GetClientName(isNamesizeof(sName));
        
Format(sIDsizeof(sID), "%d"i);

        
AddMenuItem(menusIDsName);
    }

    
SetMenuExitButton(menutrue);

    if (
GetMenuItemCount(menu) > 0)
    {
        
DisplayMenu(menuclient60);
    }
    else
    {
        
AddMenuItem(menu"""No players are currently online.");
        
DisplayMenu(menuclient30);
    }

    return 
Plugin_Handled;
}

public 
int ReportMenuHandler(Handle menuMenuAction actionint clientint itemNum)
{
    if (
action == MenuAction_Select)
    {
        
char sInfo[32];
        
GetMenuItem(menuitemNumsInfosizeof(sInfo));

        for (
int i 1<= MaxClientsi++)
        {
            if (!
IsValidClient(i) && (StringToInt(sInfo) != i)) continue;

            for (
int j 1<= MaxClientsj++)
            {
                if (
IsValidClient(j))
                {
                    if (
CheckCommandAccess(j""ADMFLAG_GENERIC))
                    {
                        
PrintToChat(j" \x04[SM] \x01The player \x04%N \x01reported on the player \x04%N\x01."clienti);
                    }
                }
            }

            
PrintToChat(client" \x04[SM] \x01Your report about (\x04%N\x01) was sent to admin staff."i);
            return;
        }
    }

    if (
action == MenuAction_End)
    {
        
CloseHandle(menu);
    }
}


stock bool IsValidClient(int client)
{
    if (
client <= || client MaxClients || !IsClientConnected(client) || (IsFakeClient(client)))
    {
        return 
false;
    }
    return 
IsClientInGame(client);

It's Working bro, but without reasons, when you type !report, shows the menu of the players, i will press one nick likee "test" and don't show me reasons or something, just "albiaps report the Tair player." just like this without reasons [RESPECT]
__________________
albiaps is offline
tair
Junior Member
Join Date: Apr 2015
Location: OnGameFrame()
Old 06-22-2020 , 21:48   Re: I need this plugin! [CSGO]
Reply With Quote #5

Quote:
Originally Posted by albiaps View Post
It's Working bro, but without reasons, when you type !report, shows the menu of the players, i will press one nick likee "test" and don't show me reasons or something, just "albiaps report the Tair player." just like this without reasons [RESPECT]
You didn't mentioned anything about a menu with "reasons".
tair is offline
MarkV
New Member
Join Date: Apr 2020
Old 06-23-2020 , 06:17   Re: I need this plugin! [CSGO]
Reply With Quote #6

Quote:
Originally Posted by tair View Post
Here you go,
I did not tested the statement of purpose format yet, but it should be working.

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo = {
    
name        "Simple Report",
    
author      "Tair",
    
description "Simple plugin that enable you to report on other players in the server",
    
version     "1.0",
    
url         ""
};


public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_report" Cmd_Report);
}


public 
Action Cmd_Report(int clientint args)
{
    
Handle menu CreateMenu(ReportMenuHandler);
    
SetMenuTitle(menu"Choose a player:");

    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsValidClient(i)) continue;

        
char sID[4], sName[16];

        
GetClientName(isNamesizeof(sName));
        
Format(sIDsizeof(sID), "%d"i);

        
AddMenuItem(menusIDsName);
    }

    
SetMenuExitButton(menutrue);

    if (
GetMenuItemCount(menu) > 0)
    {
        
DisplayMenu(menuclient60);
    }
    else
    {
        
AddMenuItem(menu"""No players are currently online.");
        
DisplayMenu(menuclient30);
    }

    return 
Plugin_Handled;
}

public 
int ReportMenuHandler(Handle menuMenuAction actionint clientint itemNum)
{
    if (
action == MenuAction_Select)
    {
        
char sInfo[32];
        
GetMenuItem(menuitemNumsInfosizeof(sInfo));

        for (
int i 1<= MaxClientsi++)
        {
            if (!
IsValidClient(i) && (StringToInt(sInfo) != i)) continue;

            for (
int j 1<= MaxClientsj++)
            {
                if (
IsValidClient(j))
                {
                    if (
CheckCommandAccess(j""ADMFLAG_GENERIC))
                    {
                        
PrintToChat(j" \x04[SM] \x01The player \x04%N \x01reported on the player \x04%N\x01."clienti);
                    }
                }
            }

            
PrintToChat(client" \x04[SM] \x01Your report about (\x04%N\x01) was sent to admin staff."i);
            return;
        }
    }

    if (
action == MenuAction_End)
    {
        
CloseHandle(menu);
    }
}


stock bool IsValidClient(int client)
{
    if (
client <= || client MaxClients || !IsClientConnected(client) || (IsFakeClient(client)))
    {
        return 
false;
    }
    return 
IsClientInGame(client);

Thanks! Let's try it out!

Last edited by MarkV; 07-06-2020 at 06:08.
MarkV 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 09:43.


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