15.04.2018, 22:36
I solved the cmd:f.
Thank you. Is there a way to sort faction online members by their case rank ?
PHP код:
CMD:f(playerid,params[])
{
new factionstring[257];
if(pInfo[i][pFaction] == pInfo[i][pFaction])
{
if(!strlen(params))
{
SendClientMessage(playerid, -1, ""chat" /f [mesaj]");
return 1;
}
format(factionstring, sizeof(factionstring), ""COL_FCHAT"** (( %s %s: %s ))**",GetRankName(playerid),PlayerName(playerid), params);
SendMessageToAllFaction(factionstring, -1);
}
else {
SendClientMessage(playerid,-1,"*"COL_RED" U are not in faction!");
}
return 1;
}
PHP код:
CMD:factionon(playerid, params[])
{
new str[128], DUTY_STR[24], COLOR, counter = 0;
SendClientMessage(playerid, -1, " - Membrii online - ");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][pFaction] == pInfo[i][pFaction])
{
if(!pInfo[i][pPoliceDuty])
{
DUTY_STR = "Off Duty";
COLOR = COLOR_WHITE;
}
else
{
DUTY_STR = "ON DUTY";
COLOR = COLOR_RED;
}
format(str, sizeof(str),"%s: %s - %s", GetRankName(i), PlayerName(i), DUTY_STR);
SendClientMessage(playerid, COLOR, str);
counter++;
}
}
}
return 1;
}