Ich habe einen Leader Chat geschrieben, weiß aber ehrlich gesagt nicht was daran falsch ist...
Code
ocmd:ld(playerid,params[])
{
new text[128];
new frakr[64];
if(IsPlayerLeader(playerid,1) || IsPlayerLeader(playerid,2) || IsPlayerLeader(playerid,3) || IsPlayerLeader(playerid,4) || IsPlayerLeader(playerid,5) || IsPlayerLeader(playerid,6) || IsPlayerLeader(playerid,7))
{
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerLeader(playerid,1) || IsPlayerLeader(playerid,2) || IsPlayerLeader(playerid,3) || IsPlayerLeader(playerid,4) || IsPlayerLeader(playerid,5) || IsPlayerLeader(playerid,6) || IsPlayerLeader(playerid,7))
{
switch(GetPVarInt(playerid,"Fraktionsleader"))
{
case 0:{frakr="0";}
case 1:{frakr="1";}
case 2:{frakr="2";}
case 3:{frakr="3";}
case 4:{frakr="4";}
case 5:{frakr="5";}
case 6:{frakr="6";}
case 7:{frakr="7";}
}
}
if(sscanf(params,"s",text)) return SendClientMessage(playerid,GRAU,"Verwende: /ld [Text]");
format(text,sizeof(text),"Leader der Frakion %s: %s: %s",frakr,SpielerName(playerid),text);
if(IsPlayerConnected(i))
{
if(IsPlayerLeader(playerid,1) || IsPlayerLeader(playerid,2) || IsPlayerLeader(playerid,3) || IsPlayerLeader(playerid,4) || IsPlayerLeader(playerid,5) || IsPlayerLeader(playerid,6) || IsPlayerLeader(playerid,7))
{
SendClientMessage(i,PINK,text);
}
}
}
}
return 1;
}
Alles anzeigen