14.06.2015, 16:31
foreach loops through connected players ONLY so the check is not needed. The problem is that you format the message but you don't join it with the previous text. switch is also much faster than if/else if. You also got value 13 twice, I guess it's meant to be 14? If not, modify it. Last you forgot the new lines:
---
I don't know about the second problem but the tag is not needed:
PHP код:
CMD:lideri(playerid, params[])
{
new string[564];
foreach(Player, i)
{
switch (PI[i][Lider])
{
case 1: format(string, sizeof(string), "%s{FBDF89} (( {00C0FF}Policija: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 2: format(string, sizeof(string), "%s{FBDF89} (( {0049FF}Federalni Biro: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 3: format(string, sizeof(string), "%s{FBDF89} (( {FF00EA}Hitna Pomoc: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 4: format(string, sizeof(string), "%s{FBDF89} (( {C3C3C3}CNN: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 5: format(string, sizeof(string), "%s{FBDF89} (( {6EF83C}Grove Street: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 6: format(string, sizeof(string), "%s{FBDF89} (( {B700FF}Ballas: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 7: format(string, sizeof(string), "%s{FBDF89} (( {FFAF00}Hells Angels: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 8: format(string, sizeof(string), "%s{FBDF89} (( {F3FF02}Los Surrenos: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 9: format(string, sizeof(string), "%s{FBDF89} (( {A90202}Yamaguchi: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 10: format(string, sizeof(string), "%s{FBDF89} (( {FFA1A1}La Familia Sinatra: {FBDF89}{FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 11: format(string, sizeof(string), "%s{FBDF89} (( {FF00EA}The Pink Panthers: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 12: format(string, sizeof(string), "%s{FBDF89} (( {F300FF}Russian Mafia: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 13: format(string, sizeof(string), "%s{FBDF89} (( {F300FF}Hitman: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
case 14: format(string, sizeof(string), "%s{FBDF89} (( {B7FF00}Condor: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d.))\n", string, ImeIgraca(i), i, PI[i][Telefon]);
}
}
if (!isnull(string)) SPD(playerid, 1016, DIALOG_STYLE_MSGBOX, "Online Lideri", string, "Uredu", "");
return 1;
}
I don't know about the second problem but the tag is not needed:
pawn Код:
Update3DTextLabelText(NameTag[playerid], -1, strn);