AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Help With This Code Please (https://forums.alliedmods.net/showthread.php?t=83057)

{7~11} TROLL 01-03-2009 14:52

Help With This Code Please
 
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;
}


Kigen 01-03-2009 21:52

Re: Help With This Code Please
 
Can't use the same variable for two things.

new Handle:g_href = INVALID_HANDLE;

You need two different variables, one for each mode.

{7~11} TROLL 01-03-2009 22:08

Re: Help With This Code Please
 
whats a different command that does the same thing?


edit

got it thanks

zerak 01-04-2009 05:44

Re: Help With This Code Please
 
radio off should go to blank page, the the radio plugin :)


All times are GMT -4. The time now is 21:43.

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