PHP код:
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_YELLOW 0xFFFF00AA
new Text:radio0;
new Text:radio1;
new Text:radio2;
new radio[MAX_PLAYERS];
new Text:groupradio0;
new Text:groupradio1;
new Text:groupradio2;
new groupradio[MAX_PLAYERS];
new Text:response0;
new Text:response1;
new Text:response2;
new responze[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" C' Radio System [LOADED]");
print("--------------------------------------\n");
radio0 = TextDrawCreate(15.000000, 162.000000, "Radio Commands");
TextDrawBackgroundColor(radio0, 255);
TextDrawFont(radio0, 3);
TextDrawLetterSize(radio0, 0.500000, 1.000000);
TextDrawColor(radio0, -65281);
TextDrawSetOutline(radio0, 0);
TextDrawSetProportional(radio0, 1);
TextDrawSetShadow(radio0, 1);
radio1 = TextDrawCreate(13.000000, 173.000000, "~n~~n~1. 'Cover Me'~n~2. 'You Take the Point'~n~3. 'Hold This Position'~n~4. 'Regroup Team'~n~5. 'Follow Me'");
TextDrawBackgroundColor(radio1, 255);
TextDrawFont(radio1, 1);
TextDrawLetterSize(radio1, 0.500000, 1.300000);
TextDrawColor(radio1, -1);
TextDrawSetOutline(radio1, 0);
TextDrawSetProportional(radio1, 1);
TextDrawSetShadow(radio1, 1);
radio2 = TextDrawCreate(13.000000, 244.000000, "~n~6. 'Taking Fire, Need Assistance'~n~~n~0. Exit");
TextDrawBackgroundColor(radio2, 255);
TextDrawFont(radio2, 1);
TextDrawLetterSize(radio2, 0.500000, 1.300000);
TextDrawColor(radio2, -1);
TextDrawSetOutline(radio2, 0);
TextDrawSetProportional(radio2, 1);
TextDrawSetShadow(radio2, 1);
groupradio0 = TextDrawCreate(15.000000, 162.000000, "Group Radio Commands");
TextDrawBackgroundColor(groupradio0, 255);
TextDrawFont(groupradio0, 3);
TextDrawLetterSize(groupradio0, 0.500000, 1.000000);
TextDrawColor(groupradio0, -65281);
TextDrawSetOutline(groupradio0, 0);
TextDrawSetProportional(groupradio0, 1);
TextDrawSetShadow(groupradio0, 1);
groupradio1 = TextDrawCreate(13.000000, 173.000000, "~n~~n~1. 'Go'~n~2. 'Fall Back'~n~3. 'Stick Together Team'~n~4. 'Get in Position'~n~5. 'Storm the Front'~n~6. 'Report In'");
TextDrawBackgroundColor(groupradio1, 255);
TextDrawFont(groupradio1, 1);
TextDrawLetterSize(groupradio1, 0.500000, 1.300000);
TextDrawColor(groupradio1, -1);
TextDrawSetOutline(groupradio1, 0);
TextDrawSetProportional(groupradio1, 1);
TextDrawSetShadow(groupradio1, 1);
groupradio2 = TextDrawCreate(13.000000, 284.000000, "0. Exit");
TextDrawBackgroundColor(groupradio2, 255);
TextDrawFont(groupradio2, 1);
TextDrawLetterSize(groupradio2, 0.500000, 1.300000);
TextDrawColor(groupradio2, -1);
TextDrawSetOutline(groupradio2, 0);
TextDrawSetProportional(groupradio2, 1);
TextDrawSetShadow(groupradio2, 1);
response0 = TextDrawCreate(15.000000, 162.000000, "Radio Responses/Reports");
TextDrawBackgroundColor(response0, 255);
TextDrawFont(response0, 3);
TextDrawLetterSize(response0, 0.500000, 1.000000);
TextDrawColor(response0, -65281);
TextDrawSetOutline(response0, 0);
TextDrawSetProportional(response0, 1);
TextDrawSetShadow(response0, 1);
response1 = TextDrawCreate(13.000000, 203.000000, "1. 'Affirmative~n~2. 'Negative'~n~3. 'Enemy Spotted'~n~4. 'Need Backup'~n~5. 'Sector Clear'~n~6. 'I'm in Position'~n~7. 'Reporting In'");
TextDrawBackgroundColor(response1, 255);
TextDrawFont(response1, 1);
TextDrawLetterSize(response1, 0.500000, 1.299999);
TextDrawColor(response1, -1);
TextDrawSetOutline(response1, 0);
TextDrawSetProportional(response1, 1);
TextDrawSetShadow(response1, 1);
response2 = TextDrawCreate(13.000000, 274.000000, "~n~8. 'She's gonna Blow!'~n~9. 'Enemy Down'~n~~n~0. Exit");
TextDrawBackgroundColor(response2, 255);
TextDrawFont(response2, 1);
TextDrawLetterSize(response2, 0.500000, 1.299999);
TextDrawColor(response2, -1);
TextDrawSetOutline(response2, 0);
TextDrawSetProportional(response2, 1);
TextDrawSetShadow(response2, 1);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
#endif
public OnPlayerText(playerid, text[])
{
if(radio[playerid] == 1)
{
if(text[0] == '1')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[RADIO] %s 'Cover Me'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/01.%20Radio%20Commands/1.%20Cover%20Me.mp3");
}
TextDrawHideForPlayer(playerid, radio0);
TextDrawHideForPlayer(playerid, radio1);
TextDrawHideForPlayer(playerid, radio2);
radio[playerid] = 0;
return 0;
}
if(text[0] == '2')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[RADIO] %s 'You Take the Point'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/01.%20Radio%20Commands/2.%20You%20Take%20the%20Point.mp3");
}
TextDrawHideForPlayer(playerid, radio0);
TextDrawHideForPlayer(playerid, radio1);
TextDrawHideForPlayer(playerid, radio2);
radio[playerid] = 0;
return 0;
}
if(text[0] == '3')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[RADIO] %s 'Hold This Position'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/01.%20Radio%20Commands/3.%20Hold%20This%20Position.mp3");
}
TextDrawHideForPlayer(playerid, radio0);
TextDrawHideForPlayer(playerid, radio1);
TextDrawHideForPlayer(playerid, radio2);
radio[playerid] = 0;
return 0;
}
if(text[0] == '4')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[RADIO] %s 'Regroup Team'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/01.%20Radio%20Commands/4.%20Regroup%20Team.mp3");
}
TextDrawHideForPlayer(playerid, radio0);
TextDrawHideForPlayer(playerid, radio1);
TextDrawHideForPlayer(playerid, radio2);
radio[playerid] = 0;
return 0;
}
if(text[0] == '5')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[RADIO] %s 'Follow Me'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/01.%20Radio%20Commands/5.%20Follow%20Me.mp3");
}
TextDrawHideForPlayer(playerid, radio0);
TextDrawHideForPlayer(playerid, radio1);
TextDrawHideForPlayer(playerid, radio2);
radio[playerid] = 0;
return 0;
}
if(text[0] == '6')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[128 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[RADIO] %s 'Taking Fire, Need Assistance'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/01.%20Radio%20Commands/6.%20Taking%20Fire,%20Need%20Assistance.mp3");
}
TextDrawHideForPlayer(playerid, radio0);
TextDrawHideForPlayer(playerid, radio1);
TextDrawHideForPlayer(playerid, radio2);
radio[playerid] = 0;
return 0;
}
if(text[0] == '0')
{
TextDrawHideForPlayer(playerid, radio0);
TextDrawHideForPlayer(playerid, radio1);
TextDrawHideForPlayer(playerid, radio2);
radio[playerid] = 0;
return 0;
}
}
if(groupradio[playerid] == 1)
{
if(text[0] == '1')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Group-Radio] %s 'Go Go Go'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://www.svtradio.site50.net/02.%20Group%20Radio%20Commands/1.%20Go%20Go%20Go.mp3");
}
TextDrawHideForPlayer(playerid, groupradio0);
TextDrawHideForPlayer(playerid, groupradio1);
TextDrawHideForPlayer(playerid, groupradio2);
groupradio[playerid] = 0;
return 0;
}
if(text[0] == '2')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Group-Radio] %s 'Team, Fall Backn'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://www.svtradio.site50.net/02.%20Group%20Radio%20Commands/2.%20Team,%20Fall%20Back.mp3");
}
TextDrawHideForPlayer(playerid, groupradio0);
TextDrawHideForPlayer(playerid, groupradio1);
TextDrawHideForPlayer(playerid, groupradio2);
groupradio[playerid] = 0;
return 0;
}
if(text[0] == '3')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Group-Radio] %s 'Stick Together'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://www.svtradio.site50.net/02.%20Group%20Radio%20Commands/3.%20Stick%20Together,%20Team.mp3");
}
TextDrawHideForPlayer(playerid, groupradio0);
TextDrawHideForPlayer(playerid, groupradio1);
TextDrawHideForPlayer(playerid, groupradio2);
groupradio[playerid] = 0;
return 0;
}
if(text[0] == '4')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Group-Radio] %s 'Get in Position and Wait for My Go'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/02.%20Group%20Radio%20Commands/4.%20Get%20in%20Position%20and%20Wait%20For%20My%20Go.mp3");
}
TextDrawHideForPlayer(playerid, groupradio0);
TextDrawHideForPlayer(playerid, groupradio1);
TextDrawHideForPlayer(playerid, groupradio2);
groupradio[playerid] = 0;
return 0;
}
if(text[0] == '5')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Group-Radio] %s 'Storm the Front'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/02.%20Group%20Radio%20Commands/5.%20Storm%20the%20Front.mp3");
}
TextDrawHideForPlayer(playerid, groupradio0);
TextDrawHideForPlayer(playerid, groupradio1);
TextDrawHideForPlayer(playerid, groupradio2);
groupradio[playerid] = 0;
return 0;
}
if(text[0] == '6')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Group-Radio] %s 'Report In, Team'.", pname);
SendClientMessage(playerid,COLOR_ORANGE, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/02.%20Group%20Radio%20Commands/6.%20Report%20In,%20Team.mp3");
}
TextDrawHideForPlayer(playerid, groupradio0);
TextDrawHideForPlayer(playerid, groupradio1);
TextDrawHideForPlayer(playerid, groupradio2);
groupradio[playerid] = 0;
return 0;
}
if(text[0] == '0')
{
TextDrawHideForPlayer(playerid, groupradio0);
TextDrawHideForPlayer(playerid, groupradio1);
TextDrawHideForPlayer(playerid, groupradio2);
groupradio[playerid] = 0;
return 0;
}
}
if(responze[playerid] == 1)
{
if(text[0] == '1')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Response] %s 'Affirmative'.", pname);
SendClientMessage(playerid,COLOR_YELLOW, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/03.%20Radio%20Responses-Reports/1.%20Affirmative.mp3");
}
TextDrawHideForPlayer(playerid, response0);
TextDrawHideForPlayer(playerid, response1);
TextDrawHideForPlayer(playerid, response2);
responze[playerid] = 0;
return 0;
}
if(text[0] == '2')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Response] %s 'Negative'.", pname);
SendClientMessage(playerid,COLOR_YELLOW, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/03.%20Radio%20Responses-Reports/8.%20Negative.mp3");
}
TextDrawHideForPlayer(playerid, response0);
TextDrawHideForPlayer(playerid, response1);
TextDrawHideForPlayer(playerid, response2);
responze[playerid] = 0;
return 0;
}
if(text[0] == '3')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Response] %s 'Enemy Spotted'.", pname);
SendClientMessage(playerid,COLOR_YELLOW, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/03.%20Radio%20Responses-Reports/2.%20Enemy%20Spotted.mp3");
}
TextDrawHideForPlayer(playerid, response0);
TextDrawHideForPlayer(playerid, response1);
TextDrawHideForPlayer(playerid, response2);
responze[playerid] = 0;
return 0;
}
if(text[0] == '4')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Response] %s 'Need Backup'.", pname);
SendClientMessage(playerid,COLOR_YELLOW, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/03.%20Radio%20Responses-Reports/3.%20Need%20Backup.mp3");
}
TextDrawHideForPlayer(playerid, response0);
TextDrawHideForPlayer(playerid, response1);
TextDrawHideForPlayer(playerid, response2);
responze[playerid] = 0;
return 0;
}
if(text[0] == '5')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Response] %s 'Sector Clear'.", pname);
SendClientMessage(playerid,COLOR_YELLOW, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/03.%20Radio%20Responses-Reports/4.%20Sector%20Clear.mp3");
}
TextDrawHideForPlayer(playerid, response0);
TextDrawHideForPlayer(playerid, response1);
TextDrawHideForPlayer(playerid, response2);
responze[playerid] = 0;
return 0;
}
if(text[0] == '6')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Response] %s 'I'm in Position'.", pname);
SendClientMessage(playerid,COLOR_YELLOW, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/03.%20Radio%20Responses-Reports/5.%20I'm%20in%20Position.mp3");
}
TextDrawHideForPlayer(playerid, response0);
TextDrawHideForPlayer(playerid, response1);
TextDrawHideForPlayer(playerid, response2);
responze[playerid] = 0;
return 0;
}
if(text[0] == '7')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Response] %s 'Reporting In'.", pname);
SendClientMessage(playerid,COLOR_YELLOW, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/03.%20Radio%20Responses-Reports/6.%20Reporting%20In.mp3");
}
TextDrawHideForPlayer(playerid, response0);
TextDrawHideForPlayer(playerid, response1);
TextDrawHideForPlayer(playerid, response2);
responze[playerid] = 0;
return 0;
}
if(text[0] == '8')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[128 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Response] %s 'Get Out of There, It's Gonna Blow!'.", pname);
SendClientMessage(playerid,COLOR_YELLOW, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/03.%20Radio%20Responses-Reports/7.%20Get%20Out%20Of%20There,%20It's%20Gonna%20Blow!.mp3");
}
TextDrawHideForPlayer(playerid, response0);
TextDrawHideForPlayer(playerid, response1);
TextDrawHideForPlayer(playerid, response2);
responze[playerid] = 0;
return 0;
}
if(text[0] == '9')
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], stringr[22 ];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringr, sizeof(stringr), "[Response] %s 'Enemy Down'.", pname);
SendClientMessage(playerid,COLOR_YELLOW, stringr);
PlayAudioStreamForPlayer(playerid, "http://svtradio.site50.net/03.%20Radio%20Responses-Reports/9.%20Enemy%20Down.mp3");
}
TextDrawHideForPlayer(playerid, response0);
TextDrawHideForPlayer(playerid, response1);
TextDrawHideForPlayer(playerid, response2);
responze[playerid] = 0;
return 0;
}
if(text[0] == '0')
{
TextDrawHideForPlayer(playerid, response0);
TextDrawHideForPlayer(playerid, response1);
TextDrawHideForPlayer(playerid, response2);
responze[playerid] = 0;
return 0;
}
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/radio", cmdtext, true, 10) == 0)
{
TextDrawShowForPlayer(playerid, radio0);
TextDrawShowForPlayer(playerid, radio1);
TextDrawShowForPlayer(playerid, radio2);
radio[playerid] = 1;
return 1;
}
if (strcmp("/groupradio", cmdtext, true, 10) == 0)
{
TextDrawShowForPlayer(playerid, groupradio0);
TextDrawShowForPlayer(playerid, groupradio1);
TextDrawShowForPlayer(playerid, groupradio2);
groupradio[playerid] = 1;
return 1;
}
if (strcmp("/response", cmdtext, true, 10) == 0)
{
TextDrawShowForPlayer(playerid, response0);
TextDrawShowForPlayer(playerid, response1);
TextDrawShowForPlayer(playerid, response2);
responze[playerid] = 1;
return 1;
}
return 0;
}