Hallo!
Bei mir funktioniert das /gov System irgendwie nicht.
Kann mir jemand helfen?
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 Polizist !");
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];
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), " Versuche es später erneut %d sekunden nach der letzten Werbung!", (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
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 [text]");
return 1;
}
SendClientMessageToAll(COLOR_WHITE, "|___________ Regierungsnachrichten ___________|");
if(PlayerInfo[playerid][pLeader] == 7)
{
format(string, sizeof(string), "Präsident %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "Polizei Chief %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pLeader] == 21)
{
format(string, sizeof(string), "FBI Director %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pLeader] == 3)
{
format(string, sizeof(string), "General %s: %s", sendername, result);
}
}
return 1;
}
Es kommt nur:
|___________ Regierungsnachrichten ___________|
und das wars.