Guten Tag,
Ich möchte den Befehl etwas kleiner machen und habe vor das anstatten das man den Staatsnachricht SAPD Sollte der Rang Name da stehn wie kann ich das machen?
if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0)
{
new sinmsg[2000];
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] != 2 && !IsACop(playerid) && !IsPlayerInFrac(playerid, 7) && !IsPlayerInFrac(playerid, 24) && !IsPlayerInFrac(playerid, 4))
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht befugt.");
return 1;
}
if(PlayerInfo[playerid][pRank] < 9)
{
SendClientMessage(playerid, COLOR_GREY, "Du benötigst mindestens Rang 9.");
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;
}
if(PlayerInfo[playerid][pMember] == 7 && PlayerInfo[playerid][pRank] >= 9)
{
format(sinmsg, sizeof(sinmsg), "<< Staatsnachricht Regierung %s: %s >>", sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pRank] >= 9)
{
format(sinmsg, sizeof(sinmsg), "<< Staatsnachricht SAPD %s: %s >>", sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 9)
{
format(sinmsg, sizeof(sinmsg), "<< Staatsnachricht LSMD %s: %s >>", sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 2 && PlayerInfo[playerid][pRank] >= 9)
{
format(sinmsg, sizeof(sinmsg), "<< Staatsnachricht FBI %s: %s >>", sendername, result);
}
//else format(sinmsg, sizeof(sinmsg), "<< Staatsnachricht %s: %s >>", sendername, result);
SendClientMessageToAll(COLOR_DBLUE, sinmsg);
}
return 1;
}
//E:
%s [Rangname] %s[Spielername] %s[Sein Text]
//E:
if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0)
{
new sinmsg[2000];
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] != 2 && !IsACop(playerid) && !IsPlayerInFrac(playerid, 7) && !IsPlayerInFrac(playerid, 24) && !IsPlayerInFrac(playerid, 4))
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht befugt.");
return 1;
}
if(PlayerInfo[playerid][pRank] < 9)
{
SendClientMessage(playerid, COLOR_GREY, "Du benötigst mindestens Rang 9.");
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;
}
if(PlayerInfo[playerid][pMember] == 7 && PlayerInfo[playerid][pRank] >= 9)
{
format(sinmsg, sizeof(sinmsg), "<< %s %s: %s >>", pRank, sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pRank] >= 9)
{
format(sinmsg, sizeof(sinmsg), "<< %s %s: %s >>", pRank, sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 9)
{
format(sinmsg, sizeof(sinmsg), "<< %s %s: %s >>", pRank, sendername, result);
}
else if(PlayerInfo[playerid][pMember] == 2 && PlayerInfo[playerid][pRank] >= 9)
{
format(sinmsg, sizeof(sinmsg), "<< %s %s: %s >>", pRank, sendername, result);
}
//else format(sinmsg, sizeof(sinmsg), "<< Staatsnachricht %s: %s >>", sendername, result);
SendClientMessageToAll(COLOR_DBLUE, sinmsg);
}
return 1;
}
So hätte ich das jetzt gemacht