Ajutor Filterscript - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Română/Romanian (
https://sampforum.blast.hk/forumdisplay.php?fid=40)
+---- Thread: Ajutor Filterscript (
/showthread.php?tid=432762)
Ajutor Filterscript -
CrayZee09 - 24.04.2013
Am un filterscript radio si vreau sa il fac doar pentru cei cu rank donator
Code:
////////////////////////////////////////////////////////////////////////////////
//*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;
}
Dar cand scriu orice comanda, chiar si /exit dintr-o casa, imi arata mesajul setat "Nu esti vip...etc". Cum fac sa imi arate mesajul doar la comanda asta?
Code:
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;
}
Partea cu probleme ^