Hier, so müsste es gehen:
ocmd:leader(playerid,params[])
{
SendClientMessage(playerid, 0xCDB221FF, "**Fraktions - Leader Online**");
for(new i = 0; i < MAX_PLAYERS; i++)
{
new string[200];
if(IsPlayerConnected(i))
{
if(pInfo[i][pFraktion] == 1)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *LSPD-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
if(pInfo[i][pFraktion] == 2)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *BND-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
if(pInfo[i][pFraktion] == 3)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *Assasins-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
if(pInfo[i][pFraktion] == 4)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *SAA-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
if(pInfo[i][pFraktion] == 5)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *Regierung-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
if(pInfo[i][pFraktion] == 6)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *LSMD-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
if(pInfo[i][pFraktion] == 7)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *Ordnungsamt-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
if(pInfo[i][pFraktion] == 8)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *LEER-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
if(pInfo[i][pFraktion] == 9)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *SAM AG-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
if(pInfo[i][pFraktion] == 10)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *Groove-Str.-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
if(pInfo[i][pFraktion] == 11)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *Ballas-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
if(pInfo[i][pFraktion] == 12)
{
if(pInfo[i][pRank] == 6)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 40, " *Al Quaida-Leader: %s", sendername);
SCM(playerid, COLOR_GOLD, string);
}
}
}
}
return 1;
}
Das:
new sendername[32];
Zu:
new sendername[MAX_PLAYER_NAME];
Weil eine Zeichenkette ist hierbei unnötig dafür ist dein String ganz oben da.
MAX_PLAYER_NAME zeigt dir nun den Namen an.