Raised This Month: $ Target: $400
 0% 

Help With This Code Please


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
{7~11} TROLL
Senior Member
Join Date: Oct 2008
Location: Atlanta,Georgia
Old 01-03-2009 , 14:52   Help With This Code Please
Reply With Quote #1

ok i been working on this radio code for a while now and for some reason when somone types the command to start the player the stop player function comes up can somone help me figure out what i did wrong?

Code:
/* Plugin Template generated by Pawn Studio */
#include <sourcemod>
public Plugin:myinfo = 
{
 name = "Simple Source Radio",
 author = "{7~11} Troll",
 description = "Simple Source Radio",
 version = "1.0.1",
 url = "www.711clan.net"
}
new Handle:g_href = INVALID_HANDLE;
public OnPluginStart()
{
 RegConsoleCmd("listen", RadioOn);
 RegConsoleCmd("stopmusic", RadioOff);
    g_href = CreateConVar("sm_radio_href", "www.radio.711clan.net", "href link to clans internet radio or favorite winamp station");
    g_href = CreateConVar("sm_radio_off_href", "www.radio.711clan.net", "href link to radio stop page.");
}
public Action:RadioOn(client,args)
{
 decl String:href[255];
 GetConVarString(g_href, href, sizeof(href));
 ShowMOTDPanel(client, "Simple Source Radio: On", href, MOTDPANEL_TYPE_URL);
 return Plugin_Continue;
}
public Action:RadioOff(client,args)
{
    decl String:href[255];
 GetConVarString(g_href, href, sizeof(href));
 ShowMOTDPanel(client, "Simple Source Radio: Off", href, MOTDPANEL_TYPE_URL);
    return Plugin_Continue;
}
__________________

Last edited by {7~11} TROLL; 01-03-2009 at 18:33.
{7~11} TROLL is offline
Kigen
BANNED
Join Date: Feb 2008
Old 01-03-2009 , 21:52   Re: Help With This Code Please
Reply With Quote #2

Can't use the same variable for two things.

new Handle:g_href = INVALID_HANDLE;

You need two different variables, one for each mode.
Kigen is offline
{7~11} TROLL
Senior Member
Join Date: Oct 2008
Location: Atlanta,Georgia
Old 01-03-2009 , 22:08   Re: Help With This Code Please
Reply With Quote #3

whats a different command that does the same thing?


edit

got it thanks
__________________

Last edited by {7~11} TROLL; 01-03-2009 at 23:21.
{7~11} TROLL is offline
zerak
Senior Member
Join Date: Feb 2008
Old 01-04-2009 , 05:44   Re: Help With This Code Please
Reply With Quote #4

radio off should go to blank page, the the radio plugin
zerak 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 10:52.


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