Neuer Code:
Code
ocmd:gov(playerid, params[])
{
if(!IsPlayerConnected(playerid))return 1;
new entry[96], string[128];
if(!(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11))return SendClientMessage(playerid, COLOR_GREY, "Du bist kein Beamter!");
if(PlayerInfo[playerid][pRank] < 5)return SendClientMessage(playerid, COLOR_GREY, "Für diesen Befehl musst du den Co-Leader Rang besitzen.");
if(sscanf(params, "s[96]", entry))return SendClientMessage(playerid, COLOR_GREY, "{247BA6}* Benutze {009933}/gov [Nachricht]");
format(string, sizeof(string), "%s: %s", PlayerInfo[playerid][pRank], GetName(playerid), entry);
SendClientMessageToAll(COLOR_DARKBLUE, string);
return 1;
}
Alles anzeigen
Alter Code:
Code
if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] != 2 && !IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Du bist kein Staatsbeamter!");
return 1;
}
if(PlayerInfo[playerid][pRank] < 5)
{
SendClientMessage(playerid, COLOR_GREY, " Du benötigst mindestens 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(ernment) [Nachricht]");
return 1;
}
SendClientMessageToAll(COLOR_WHITE, "|================= {FF0000}Staatsnachricht {FFFFFF}=================|");
if(PlayerInfo[playerid][pLeader] == 7)
{
format(string, sizeof(string), "San Andreas Präsident %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 7 && PlayerInfo[playerid][pRank] == 11)
{
format(string, sizeof(string), "Kanzler %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 7 && PlayerInfo[playerid][pRank] == 10)
{
format(string, sizeof(string), "Staatsminister %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 7 && PlayerInfo[playerid][pRank] == 9)
{
format(string, sizeof(string), "Finanzminister %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 7 && PlayerInfo[playerid][pRank] == 8)
{
format(string, sizeof(string), "Innenminister %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 7 && PlayerInfo[playerid][pRank] == 7)
{
format(string, sizeof(string), "Vorsitzender %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 7 && PlayerInfo[playerid][pRank] == 6)
{
format(string, sizeof(string), "Leitender Geheimdienst %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "Polizeipräsident %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "FBI Präsident %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pLeader] == 3)
{
format(string, sizeof(string), "General %s: %s", sendername, result);
}
else format(string, sizeof(string), "Staatsbeamter %s: %s", sendername, result);
SendClientMessageToAll(COLOR_DBLUE, string);
}
return 1;
}
Alles anzeigen
Hallo,
Ich habe ein Problem wen ich /gov (Nachricht) Eingebe gibt er mit Immer die Nachricht zurück * Benutze /gov [Nachricht] Warum?
Habe mal den Neuen und den Alten Code hinzugefügt vilt hab ich was vergessen