14.04.2016, 19:07
PHP код:
CMD:radio(playerid, params[])
{
if (!pInfo[playerid][Faction]) return 1;
if (isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "SERVER:{FFFFFF} /r(adio) [text]");
new string[144], pname[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, pname, sizeof(pname));
switch (pInfo[playerid][Faction])
{
case 1:
{
new rnk_name[][] = {"Chief","Deputy Chief","Squad Commander","Traffic Squad Commander","S.W.A.T Squad Commander","Public Relations Officer","Traffic Officer","S.W.A.T Unit","Senior Officer","Trainee Officer"};
format(string, sizeof(string), "(Radio) %s %s: %s", (1 <= pInfo[playerid][FactionTier] <= 10) ? rnk_name[pInfo[playerid][FactionTier]-1] : ("N/A"), pname, params);
SendCopMessage(COLOR_PDRAD, string);
}
case 2:
{
format(string, sizeof(string), "(Radio) %s: %s", pname, params);
SendEMSMessage(COLOR_RED, string);
}
}
return 1;
}