03.11.2012, 17:10
I don't have ANY filterscript until now and here is the /music CMD:
pawn Код:
CMD:music(playerid, params[])
{
if(PlayerInfo[playerid][pCDPlayer])
{
new choice[32];
if(sscanf(params, "s[32]", choice))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /music [name]");
SendClientMessageEx(playerid, COLOR_GREY, "Available names: On, Off, Next");
return 1;
}
if(strcmp(choice,"on",true) == 0)
{
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~CD Player On", 5000, 5);
new channel = Music[playerid];
PlayerPlaySound(playerid, Songs[channel][0], 0.0, 0.0, 0.0);
}
else if(strcmp(choice,"off",true) == 0)
{
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~r~CD Player Off", 5000, 5);
PlayerFixRadio(playerid);
}
else if(strcmp(choice,"next",true) == 0)
{
if(Music[playerid] == 0) { Music[playerid] = 1; }
else if(Music[playerid] == 1) { Music[playerid] = 2; }
else if(Music[playerid] == 2) { Music[playerid] = 3; }
else if(Music[playerid] == 3) { Music[playerid] = 4; }
else if(Music[playerid] == 4) { Music[playerid] = 5; }
else if(Music[playerid] == 5) { Music[playerid] = 6; }
else if(Music[playerid] == 6) { Music[playerid] = 0; }
new channel = Music[playerid];
PlayerPlaySound(playerid, Songs[channel][0], 0.0, 0.0, 0.0);
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " Unknown music command!");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " You don't have a CD-Player!");
return 1;
}
return 1;
}