29.10.2011, 08:57
PHP код:
CMD:fooc(playerid,params[])
{
new string[128],message;
if(sscanf(params,"s",message)) return SCM(playerid,COLOR_GRAY,"Syntax: /fooc [Message]");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[playerid][pGroup] == 1 || PlayerInfo[playerid][pRank] == 1)
{
format(string,sizeof(string),"[Recruit] %s: %s",GetName(playerid),message);
SCM(i,COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pGroup] == 1 || PlayerInfo[playerid][pRank] == 2)
{
format(string,sizeof(string),"[Officer] %s: %s",GetName(playerid),message);
SCM(i,COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pGroup] == 1 || PlayerInfo[playerid][pRank] == 3)
{
format(string,sizeof(string),"[Senior Officer] %s: %s",GetName(playerid),message);
SCM(i,COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pGroup] == 1 || PlayerInfo[playerid][pRank] == 4)
{
format(string,sizeof(string),"[Lieutenant] %s: %s",GetName(playerid),message);
SCM(i,COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pGroup] == 1 || PlayerInfo[playerid][pRank] == 5)
{
format(string,sizeof(string),"[Captain] %s: %s",GetName(playerid),message);
SCM(i,COLOR_OOC,string);
}
else if(PlayerInfo[playerid][pGroup] == 1 || PlayerInfo[playerid][pRank] == 6)
{
format(string,sizeof(string),"[Colonel] %s: %s",GetName(playerid),message);
SCM(i,COLOR_OOC,string);
}
}
return 1;
}