Hier vieleicht hilft dir das weiter:
Mein /gov Befehl:
if(strcmp(cmd, "/gov", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] != 2)
{
SendClientMessage(playerid, COLOR_GREY, " Du bist kein Beamter !");
return 1;
}
if(PlayerInfo[playerid][pRank] < 5)
{
SendClientMessage(playerid, COLOR_GREY, " Du brauchst Rang 5 !");
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, "Benutze: /gov [text]");
return 1;
}
SendClientMessageToAll(COLOR_WHITE, "|___________Government Server Meldung___________|");
format(string, sizeof(string), "Meldung von %s: %s", sendername, result);
SendClientMessageToAll(COLOR_DBLUE, string);
}
return 1;
}
Und mein /department befehl:
if(strcmp(cmd, "/departments", 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, "Benutze: (/d)epartments [department chat]");
return 1;
}
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** LS-Chief %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** LS-Captain %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** LS-Lieutenant %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** LS-Sergeant %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** LS-Officer %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** LS-Cadet %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** LS-Praktikant %s: %s, over. **", sendername, result);
}
SendTeamMessage(2, COLOR_ALLDEPT, string);
SendTeamMessage(1, COLOR_ALLDEPT, string);
printf("%s", string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist in keinem Team !");
return 1;
}
}
return 1;
}
MFG Picaso