AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved Direct advertisement (https://forums.alliedmods.net/showthread.php?t=309855)

Munoon 08-09-2018 14:47

Direct advertisement
 
Hi guys! Can you help me? I just need private advertisement. Like if some one want steam group link, he just type message “.steam” and plugin directly send him massage with link.

Drixevel 08-09-2018 14:54

Re: Direct advertisement
 
Code:

#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>

public Plugin myinfo =
{
        name = "private ad",
        author = "",
        description = "",
        version = "1.0.0",
        url = ""
};

public void OnPluginStart()
{
        RegConsoleCmd(".steam", Command_Steam);
}

public Action Command_Steam(int client, int args)
{
        PrintToChat(client, "INSERT LINK HERE");
        return Plugin_Handled;
}


mug1wara 08-09-2018 15:12

Re: Direct advertisement
 
anotha wae

PHP Code:

#include <sourcemod>

#pragma semicolon 1

char g_sCommands[][] =
{
    
"a command",
    
"another one",
    
"and another one",
};

public 
void OnPluginStart()
{
    
AddCommandListener(Callback_Command"say");
    
AddCommandListener(Callback_Command"say_team");
}

public 
Action Callback_Command(int iClient, const char[] sCommandint iArgs)
{
    if (
iClient MaxClients && IsClientInGame(iClient))
    {
        
char sArgs[256];
        
GetCmdArgString(sArgssizeof(sArgs));
        
        
StripQuotes(sArgs);
        
        if (
StrEqual(sArgsg_sCommands[sizeof(g_sCommands) - 1]))
            
PrintToChat(iClient"your shit");
    }
    
    return 
Plugin_Handled;



Drixevel 08-09-2018 15:39

Re: Direct advertisement
 
Quote:

Originally Posted by mug1wara (Post 2609334)
anotha wae

PHP Code:

#include <sourcemod>

#pragma semicolon 1

char g_sCommands[][] =
{
    
"a command",
    
"another one",
    
"and another one",
};

public 
void OnPluginStart()
{
    
AddCommandListener(Callback_Command"say");
    
AddCommandListener(Callback_Command"say_team");
}

public 
Action Callback_Command(int iClient, const char[] sCommandint iArgs)
{
    if (
iClient MaxClients && IsClientInGame(iClient))
    {
        
char sArgs[256];
        
GetCmdArgString(sArgssizeof(sArgs));
        
        
StripQuotes(sArgs);
        
        if (
StrEqual(sArgsg_sCommands[sizeof(g_sCommands) - 1]))
            
PrintToChat(iClient"your shit");
    }
    
    return 
Plugin_Handled;



https://sm.alliedmods.net/new-api/co...ayCommand_Post

mug1wara 08-09-2018 15:51

Re: Direct advertisement
 
Both are command listeners.

Munoon 08-10-2018 03:10

Re: Direct advertisement
 
Thx, your plugin work, but can you also make that users massage deleted?
Quote:

Originally Posted by mug1wara (Post 2609334)
anotha wae

PHP Code:

#include <sourcemod>

#pragma semicolon 1

char g_sCommands[][] =
{
    
"a command",
    
"another one",
    
"and another one",
};

public 
void OnPluginStart()
{
    
AddCommandListener(Callback_Command"say");
    
AddCommandListener(Callback_Command"say_team");
}

public 
Action Callback_Command(int iClient, const char[] sCommandint iArgs)
{
    if (
iClient MaxClients && IsClientInGame(iClient))
    {
        
char sArgs[256];
        
GetCmdArgString(sArgssizeof(sArgs));
        
        
StripQuotes(sArgs);
        
        if (
StrEqual(sArgsg_sCommands[sizeof(g_sCommands) - 1]))
            
PrintToChat(iClient"your shit");
    }
    
    return 
Plugin_Handled;





All times are GMT -4. The time now is 03:22.

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