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

Chat Trigger, Open In-Game Browser?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
badwolf
Senior Member
Join Date: Apr 2010
Old 09-04-2010 , 11:17   Chat Trigger, Open In-Game Browser?
Reply With Quote #1

I'm looking to set up a chat trigger like '!go' on my server and have that open the in-game browser of the player that types it to a specific webpage. Any help is greatly appreciated.
badwolf is offline
Zylius
SourceMod Donor
Join Date: Nov 2009
Old 09-04-2010 , 12:16   Re: Chat Trigger, Open In-Game Browser?
Reply With Quote #2

If i understood you correctly I would do it like this.
PHP Code:
public OnPluginStart()
{    
    
RegConsoleCmd("say"Command_say);

}
public 
Action:Command_say(clientargs)
{
        
decl String:title[64];
    
title "Your page name";
    
decl String:url[256];
    
url "http://www.urlhere.com";
    
decl String:text[192], String:command[64];
    new 
startidx 0;
    if (
GetCmdArgString(textsizeof(text)) < 1)
    {
        return 
Plugin_Continue;
    }
    
    if (
text[strlen(text)-1] == '"')
    {
        
text[strlen(text)-1] = '\0';
        
startidx 1;
    }

    if (
strcmp(command"say2"false) == 0)
        
startidx += 4;

    if (
strcmp(text[startidx], "!go"true) == 0)
    {
        
ShowMOTDPanelclienttitleurlMOTDPANEL_TYPE_URL );
    }

Zylius is offline
badwolf
Senior Member
Join Date: Apr 2010
Old 09-04-2010 , 12:37   Re: Chat Trigger, Open In-Game Browser?
Reply With Quote #3

Yep, something just like that.. but that didn't work for me? I compiled it with the SM web compiler.

It gave only one warning:
warning 209: function "Command_say" should return a value

Edit:

I get this when I do sm plugins list:

<Bad Load> urltriggers.smx

Last edited by badwolf; 09-04-2010 at 12:45.
badwolf is offline
Zylius
SourceMod Donor
Join Date: Nov 2009
Old 09-04-2010 , 12:51   Re: Chat Trigger, Open In-Game Browser?
Reply With Quote #4

Quote:
Originally Posted by badwolf View Post
Yep, something just like that.. but that didn't work for me? I compiled it with the SM web compiler.

It gave only one warning:
warning 209: function "Command_say" should return a value

Edit:

I get this when I do sm plugins list:

<Bad Load> urltriggers.smx
Yes i forgot to write
PHP Code:
return Plugin_Continue
just before the end of Command_say. Thoe i don't know why it doesn't load... (were might be some loose indentation warnings too but i never do anything about them, too lazy , and from mine experience i can tell you they don't change plugin's performace)

Last edited by Zylius; 09-04-2010 at 13:02.
Zylius is offline
badwolf
Senior Member
Join Date: Apr 2010
Old 09-04-2010 , 14:12   Re: Chat Trigger, Open In-Game Browser?
Reply With Quote #5

That loads good, no warnings, but still doesn't work... :/
badwolf is offline
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 09-04-2010 , 14:40   Re: Chat Trigger, Open In-Game Browser?
Reply With Quote #6

What game is this for?
__________________
McFlurry is offline
Send a message via Skype™ to McFlurry
badwolf
Senior Member
Join Date: Apr 2010
Old 09-04-2010 , 14:43   Re: Chat Trigger, Open In-Game Browser?
Reply With Quote #7

Quote:
Originally Posted by McFlurry View Post
What game is this for?
TF2
badwolf is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 09-04-2010 , 15:23   Re: Chat Trigger, Open In-Game Browser?
Reply With Quote #8

Don't reinvent the wheel.

Use this: http://forums.alliedmods.net/showthread.php?p=510469
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
badwolf
Senior Member
Join Date: Apr 2010
Old 09-04-2010 , 15:40   Re: Chat Trigger, Open In-Game Browser?
Reply With Quote #9

Thank You!
badwolf is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 09-04-2010 , 20:00   Re: Chat Trigger, Open In-Game Browser?
Reply With Quote #10

Why that complicated ?

PHP Code:
public OnPluginStart()
{    
    
RegConsoleCmd("sm_go"Command_Go);

}
public 
Action:Command_Go(clientargs)
{
    
ShowMOTDPanel(client"Google""http://www.google.at");

__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni 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 00:52.


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