Raised This Month: $140 Target: $400
 35% 

Direct advertisement


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Munoon
Junior Member
Join Date: Jul 2018
Old 08-09-2018 , 14:47   Direct advertisement
Reply With Quote #1

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.
Munoon is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Old 08-09-2018 , 14:54   Re: Direct advertisement
Reply With Quote #2

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;
}
Drixevel is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Location: Not your business.
Old 08-09-2018 , 15:12   Re: Direct advertisement
Reply With Quote #3

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;

__________________
Taking requests, add me on Steam.

mug1wara.xyz

Never call me a weeb.
mug1wara is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Old 08-09-2018 , 15:39   Re: Direct advertisement
Reply With Quote #4

Quote:
Originally Posted by mug1wara View Post
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
Drixevel is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Location: Not your business.
Old 08-09-2018 , 15:51   Re: Direct advertisement
Reply With Quote #5

Both are command listeners.
__________________
Taking requests, add me on Steam.

mug1wara.xyz

Never call me a weeb.
mug1wara is offline
Munoon
Junior Member
Join Date: Jul 2018
Old 08-10-2018 , 03:10   Re: Direct advertisement
Reply With Quote #6

Thx, your plugin work, but can you also make that users massage deleted?
Quote:
Originally Posted by mug1wara View Post
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;

Munoon is offline
Reply


Thread Tools
Display Modes

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 18:05.


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