22.01.2015, 14:00
Fixed, now how do I make it so only SANews can use the command?
I added the pMember, in the ENUM
pawn Код:
#define FILTERSCRIPT
// DJ Script by ZombieNest
// Thanks to BC-RP for the stream code
#include <a_samp>
#include <zcmd>
#include <sscanf>
#include <foreach>
#define COLOR_LIGHTRED 0xAA3333AA
#define COLOR_GREY 0xAFAFAFAA
enum pinfo
{
pAdmin,
score,
money,
pMember,
};
new PlayerInfo[MAX_PLAYERS][pinfo];
public OnFilterScriptInit()
{
print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ");
print(" <><><><>DJ Filterscript Loaded by ZombieNest<><><><><><><><><> ");
print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n");
return 1;
}
public OnFilterScriptExit()
{
print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ");
print(" <><><><>DJ Filterscript Unloaded by ZombieNest<><><><><><><><><> ");
print("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n");
return 1;
}
// For the stream thing thanks to BcRp by bustern
CMD:dj(playerid, params[])
{
new string[128];
if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, -1, "[Usage]: /dj [url/help/stop/credits]");
if(!strcmp(params, "help", true, 4))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Help:{FAD008}DJ is a system for players to play songs offically.");
SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Help:{FAD008}All players will be able to hear the song. Not only you!");
return 1;
}
if(!strcmp(params, "stop", true, 4))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "{0033FF}DJ Stopped.");
StopAudioStreamForPlayer(playerid);
return 1;
}
if(!strcmp(params, "credits", true, 4))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Thanks to:");
SendClientMessage(playerid, -1, "{0033FF}Bustern for the Stream system");
SendClientMessage(playerid, -1, "{FAD009}Kevin Hendrews a.k.a ZombieNest for editing");
return 1;
}
if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
format(string, sizeof(string), "{FFFFFF}>> {0033FF}[DJ]{FFFFFF}: A Player is now DJing {FAD008} ( /dj help for more)");
SendClientMessageToAll(0xFFFFFFAA,string);
foreach(Player, i)
{
PlayAudioStreamForPlayer(i, params);
}
return 1;
}