24.08.2012, 22:44
pawn Код:
#include <a_samp>
#include <ZCMD>
#if defined FILTERSCRIPT
#endif
enum fInfo{
SFCS,
SFCMS
}
new PlayerInfo[MAX_PLAYERS][fInfo];
stock SendFactionMessage(color, const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][SFCS] == 1)
{
SendClientMessage(i, color, string);
}
}
}
return 1;
}
CMD:f(playerid,params[])
{
if(PlayerInfo[playerid][SFCS] == 1 || PlayerInfo[playerid][SFCMS] == 1)
{
if(!strlen(params)) return SendClientMessage(playerid,COLOR_ERROR,"Usage: /f [Message]");
new string[128];
format(string,sizeof(string), "[Faction Chat] %s(%d): %s",pname(playerid), playerid, params);
SendFactionMessage(-1, string);
return 1;
}
else
{
SendClientMessage(playerid,-1,"ERROR: You are not in a faction!");
}
return 1;
}