Radio filterscript problem -
CrayZee09 - 24.04.2013
I have a radio filterscript, and i want to made it only for premium (donation ranks)
Код:
////////////////////////////////////////////////////////////////////////////////
//*Script is made By FiReMaNStone
//----------------------------------Include files-------------------------------
#include <a_samp>
#include <a_players>
#pragma tabsize 0
enum pInfo {
pDonateRank
};
new PlayerInfo[MAX_PLAYERS][pInfo];
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Radio system is starting..");
print(" Radio system has started.");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
print("\n--------------------------------------");
print(" Radio System has been shut down due to a Filterscript unload/Exit.");
print("--------------------------------------\n")
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Radio System by FiReMaNStone. Powered by FiReMaNStone");
print("----------------------------------\n");
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/muzica", cmdtext, true, 10) == 0) //Change this one to whatever you want.
{
if (PlayerInfo[playerid][pDonateRank]<1)
{
SendClientMessage(playerid, 0x99FF00, " Nu esti VIP. Pentru a cumpara www.exaid-gaming.tk !");
return 1;
}
ShowPlayerDialog(playerid,90,DIALOG_STYLE_LIST,"Posturi Disponibile","1. Kiss FM\r\n2. Radio ZU\r\n3. Radio Taraf","Select", "Cancel");
return 1;
}
if (strcmp("/stopradio", cmdtext, true, 10) == 0)
{
StopAudioStreamForPlayer(playerid);//This is the function we need to stop the audio from streaming the music.
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 90: //Remember the ID we changed in ShowPlayerDialog? (90) That's how the DialogResponse will get to know which Dialog it's going to use.
{
if(!response)// This one is used for option 2 which we changed to (Cancel).
{
SendClientMessage(playerid, 0x42F3F198, "Ai anulat radio.");//This one sends a message when you close the dialog using (Cancel).
return 1;
}
switch(listitem)//This one will list the items.
{
case 0://Case 0 is basically the first line we made in ShowPlayerDialog (1.)
{
PlayAudioStreamForPlayer(playerid, "http://www.kissfm.ro/live/");//This function will play our desired radio. So we have to put the url between its brackets.
SendClientMessage(playerid, 0x42F3F198, "Scrie /stopradio pentru a opri radio-ul."); //This line sends a message to the listener that he can stop it using /stopradio.
}
case 1://Case 1 is the second line we put in ShowPlayerDialog (\r\n2.)
{
PlayAudioStreamForPlayer(playerid, "http://live.radiozu.ro/");//This function will play our desired radio. So we have to put the url between its brackets.
SendClientMessage(playerid, 0x42F3F198, "Scrie /stopradio pentru a opri radio-ul.");//This line sends a message to the listener that he can stop it using /stopradio.
}
case 2://Case 2 is the third line we put in ShowPlayerDialog(\r\n3.)
{
PlayAudioStreamForPlayer(playerid, "http://www.radiotraditional.ro/asculta-live/asculta-online-manele");//This function will play our desired radio. So we have to put the url between its brackets.
SendClientMessage(playerid, 0x42F3F198, "Scrie /stopradio pentru a opri radio-ul.");//This line sends a message to the listener that he can stop it using /stopradio.
}
//You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /myradio command \r\n4. 4th \r\n5. 5th channel etc..
}
}
}
return 1;
}
But when i type anything in-game it says that message, "Nu esti VIP. Pentru a cumpara
www.exaid-gaming.tk !" - i set this message to send when you don't have a donate rank and you type /muzica (/music), but it appears even if i type /exit from a house. Even with rcon login.
PLEASE help me
Re: Radio filterscript problem -
DobbysGamertag - 24.04.2013
So it's saying you dont have "donator" even though you do?
For the /exit one. You must have conflicting dialogs. Check through where your /exit command is and look for:
pawn Код:
ShowPlayerDialog(playerid,90,); //doesnt matter too much on the rest of the dialog here. Try changing the ID.
Check it then. As for your "donator" i added an "else statement. Try this:
It compiles for me with no errors. I can't test it, as i dont have your VIP "check"
pawn Код:
//////////////////////////////////////////////////////////////////////////////////*Script is made By FiReMaNStone//----------------------------------Include files-------------------------------#include <a_samp>#include <a_players>#pragma tabsize 0enum pInfo
{pDonateRank
};
new PlayerInfo
[MAX_PLAYERS
][pInfo
];
#if defined FILTERSCRIPTpublic OnFilterScriptInit
(){ print("\n--------------------------------------");
print(" Radio system is starting..");
print(" Radio system has started.");
print("--------------------------------------\n");
return 1;
}public OnFilterScriptExit
(){ print("\n--------------------------------------");
print(" Radio System has been shut down due to a Filterscript unload/Exit.");
print("--------------------------------------\n") return 1;
}#elsemain
(){ print("\n----------------------------------");
print(" Radio System by FiReMaNStone. Powered by FiReMaNStone");
print("----------------------------------\n");
}#endifpublic OnPlayerCommandText
(playerid, cmdtext
[]){ if (strcmp("/muzica", cmdtext, true,
10) == 0) //Change this one to whatever you want. { if (PlayerInfo
[playerid
][pDonateRank
]>1) // changed from "<" to ">" { SendClientMessage
(playerid, 0x99FF00,
" Nu esti VIP. Pentru a cumpara http://www.exaid-gaming.tk !");
return 1;
} else ShowPlayerDialog
(playerid,
90,DIALOG_STYLE_LIST,
"Posturi Disponibile",
"1. Kiss FM\r\n2. Radio ZU\r\n3. Radio Taraf",
"Select",
"Cancel");
return 1;
} if (strcmp("/stopradio", cmdtext, true,
10) == 0) { StopAudioStreamForPlayer
(playerid
);
//This is the function we need to stop the audio from streaming the music. return 1;
} return 0;
}public OnDialogResponse
(playerid, dialogid, response, listitem, inputtext
[]){ switch(dialogid
) { case 90: //Remember the ID we changed in ShowPlayerDialog? (90) That's how the DialogResponse will get to know which Dialog it's going to use. { if(!response
)// This one is used for option 2 which we changed to (Cancel). { SendClientMessage
(playerid, 0x42F3F198,
"Ai anulat radio.");
//This one sends a message when you close the dialog using (Cancel). return 1;
} switch(listitem
)//This one will list the items. { case 0://Case 0 is basically the first line we made in ShowPlayerDialog (1.) { PlayAudioStreamForPlayer
(playerid,
"http://www.kissfm.ro/live/");
//This function will play our desired radio. So we have to put the url between its brackets. SendClientMessage
(playerid, 0x42F3F198,
"Scrie /stopradio pentru a opri radio-ul.");
//This line sends a message to the listener that he can stop it using /stopradio. } case 1://Case 1 is the second line we put in ShowPlayerDialog (\r\n2.) { PlayAudioStreamForPlayer
(playerid,
"http://live.radiozu.ro/");
//This function will play our desired radio. So we have to put the url between its brackets. SendClientMessage
(playerid, 0x42F3F198,
"Scrie /stopradio pentru a opri radio-ul.");
//This line sends a message to the listener that he can stop it using /stopradio. } case 2://Case 2 is the third line we put in ShowPlayerDialog(\r\n3.) { PlayAudioStreamForPlayer
(playerid,
"http://www.radiotraditional.ro/asculta-live/asculta-online-manele");
//This function will play our desired radio. So we have to put the url between its brackets. SendClientMessage
(playerid, 0x42F3F198,
"Scrie /stopradio pentru a opri radio-ul.");
//This line sends a message to the listener that he can stop it using /stopradio. } //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /myradio command \r\n4. 4th \r\n5. 5th channel etc.. } } } return 1;
}
Re: Radio filterscript problem -
CrayZee09 - 24.04.2013
I will try it, edit then.
Edit: Not working, i type /muzica and it says i don't have vip (pdonate), but i have donation rank3...
Re: Radio filterscript problem -
DobbysGamertag - 24.04.2013
Try now?
i changed the < to >
Re: Radio filterscript problem -
CrayZee09 - 24.04.2013
It work but everyone can use that command now..
Re: Radio filterscript problem -
CrayZee09 - 25.04.2013
Thanks all, solved.
TC