Ich habe dein Befehl mal ein wenig gekürzt und angepasst, müsste so funktionieren (Ungetestet)
if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0)
{
if(!IsPlayerConnected(playerid))return 1;
if(IsPlayerInFrac(playerid, 0)return SendClientMessage(playerid, COLOR_GREY, " Du bist kein Leader einer Fraktion !");
if(PlayerInfo[playerid][pRank] < 5)return SendClientMessage(playerid, COLOR_GREY, " Du brauchst Rang 5 !");
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))return SendClientMessage(playerid, COLOR_GRAD2, "Benutze: (/gov)ernment [Text]");
new string[256];
format(string, sizeof(string), "|___________ %s ___________|", GetFracName(playerid));
SendClientMessageToAll(COLOR_WHITE, string);
format(string, sizeof(string), "%s: %s", sendername, result);
SendClientMessageToAll(COLOR_WHITE, string)
return 1;
}
stock GetFracName(playerid)
{
new fname[32];
switch(PlayerInfo[playerid][pFraction])
{
case 0:{fname="Zivilist";}
case 1:{fname="Los Santos Police Department";}
case 2:{fname="Federal Bureau of Investigation";}
case 3:{fname="United States of Army";}
case 4:{fname="Notdienst";}
case 5:{fname="La Cosa Nostra";}
case 6:{fname="Yakuza";}
case 7:{fname="Regierung";}
case 8:{fname="Hitman Agency";}
case 9:{fname="Center News Network";}
case 10:{fname="Taxi Company";}
case 11:{fname="Fahrschule";}
case 12:{fname="Triaden";}
case 13:{fname="Grove Street Family";}
case 14:{fname="Front Yard Ballas";}
case 15:{fname="Biker Club";}
case 16:{fname="Vagos";}
case 17:{fname="Atzecas";}
case 18:{fname="Rifas";}
case 19:{fname="Red Soldiers";}
case 20:{fname="Terrorist";}
case 21:{fname="Wheelman Agency";}
case 22:{fname="Brigada";}
case 23:{fname="Ordnungsamt";}
}
return fname;
}