Moin aso mein /department chat geht für jeden ausser rang 6 SAPD (mitleader rechten)
hier ist der scrip
if(strcmp(cmd, "/department", true) == 0 || strcmp(cmd, "/d", 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++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: (/d)epartments [text]");
return 1;
}
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Chief %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Captain %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Leutnant %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Sergeant %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Cadet %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result);
}
SendTeamMessage(2, COLOR_ALLDEPT, string);
SendTeamMessage(1, COLOR_ALLDEPT, string);
printf("%s", string);
return 1;
}
/EDIT aso /Gov geht auch ab rank 5 ! und 6 Aber es geht nicht mit leader rechte helft mir bitte
if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GREY, "Du bist kein Polizist!");
return 1;
}
if(PlayerInfo[playerid][pRank] < 6)
{
SendClientMessage(playerid, COLOR_GREY, "Du musst mindestens Rank 5 sein, um das zu benutzen!");
return 1;
}
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++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: (/gov)ernment [text]");
return 1;
}
SendClientMessageToAll(COLOR_WHITE, "|___________ Government News Meldung ___________|");
format(string, sizeof(string), "Officer %s: %s", sendername, result);
SendClientMessageToAll(COLOR_DBLUE, string);
}
return 1;
}