30.08.2010, 17:25
I want this command can be used and nice admins and coordinator please pCoordonator pAdmin and can write in it and see what I write leaders
pawn Код:
///----------------------------------[LeaderChat]-----------------------------------------------
if(strcmp(cmd, "/leaderchat", true) == 0 || strcmp(cmd, "/g", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
new leaders = PlayerInfo[playerid][pLeader];
new admins = PlayerInfo[playerid][pAdmin];
new coord = PlayerInfo[playerid][pCoordonator];
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/l)aders©hat [Chat of leaders]");
return 1;
}
else if(leaders==1)
{
format(string, sizeof(string), "[LEADER]Police Departament %s: %s.", sendername, result);
}
else if(leaders==2)
{
format(string, sizeof(string), "[LEADER]FBI %s: %s.", sendername, result);
}
else if(leaders==3)
{
format(string, sizeof(string), "[LEADER]National Guard %s: %s.", sendername, result);
}
else if(leaders==4)
{
format(string, sizeof(string), "[LEADER]Medic %s: %s.", sendername, result);
}
else if(leaders==5)
{
format(string, sizeof(string), "[LEADER]The Mafia %s: %s.", sendername, result);
}
else if(leaders==6)
{
format(string, sizeof(string), "[LEADER]The Triads %s: %s.", sendername, result);
}
else if(leaders==7)
{
format(string, sizeof(string), "[LEADER]Primar %s: %s.", sendername, result);
}
else if(leaders==8)
{
format(string, sizeof(string), "[LEADER]Hitman %s: %s.", sendername, result);
}
else if(leaders==9)
{
format(string, sizeof(string), "[LEADER]News Reporter %s: %s.", sendername, result);
}
else if(leaders==10)
{
format(string, sizeof(string), "[LEADER]Taxi Company %s: %s.", sendername, result);
}
else if(leaders==11)
{
format(string, sizeof(string), "[LEADER]School Instructor %s: %s.", sendername, result);
}
else if(leaders==12)
{
format(string, sizeof(string), "[LEADER]Grove Street %s: %s.", sendername, result);
}
else if(leaders==13)
{
format(string, sizeof(string), "[LEADER]Ballas %s: %s.", sendername, result);
}
else if(leaders==14)
{
format(string, sizeof(string), "[LEADER]Vagos %s: %s.", sendername, result);
}
else if(leaders==15)
{
format(string, sizeof(string), "[LEADER]SFR %s: %s.", sendername, result);
}
else if(leaders==16)
{
format(string, sizeof(string), "[LEADER]DNB %s: %s.", sendername, result);
}
else if(admins==1)
{
format(string, sizeof(string), "Admin %s: %s.", sendername, result);
}
else if(coord==1)
{
format(string, sizeof(string), "Coordonator %s: %s.", sendername, result);
}
if (PlayerInfo[playerid][pLeader] >= 1)
{
SendLeaderMessage(COLOR_1GREEN, string);
}
printf("Leader %s: %s", sendername, result);
}
return 1;
}