Код:
stock CzatSend(playerid, gracz, text[])
{
for(new i=0; i<=GetMaxPlayers(); i++)
{
if(strlen(text) <= 51)
{
if(IsPlayerAdmin(playerid))
{
wiadomosciczat[i]++;
if(wiadomosciczat[i] == 1)
{
format(czatstring1[i], sizeof(czatstring1[i]), "%d ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text); //<- 3830
PlayerTextDrawSetString(playerid, Chat1[i], czatstring1[i]);
}
else if(wiadomosciczat[i] == 2)
{
format(czatstring2[i], sizeof(czatstring2[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid,gracz, text);
PlayerTextDrawSetString(playerid, Chat2[i], czatstring2[i]);
}
else if(wiadomosciczat[i] == 3)
{
format(czatstring3[i], sizeof(czatstring3[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat3[i], czatstring3[i]);
}
else if(wiadomosciczat[i] == 4)
{
format(czatstring4[i], sizeof(czatstring4[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat4[i], czatstring4[i]);
}
else if(wiadomosciczat[i] == 5)
{
format(czatstring5[i], sizeof(czatstring5[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat5[i], czatstring5[i]);
}
else if(wiadomosciczat[i] == 6)
{
format(czatstring6[i], sizeof(czatstring6[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat6[i], czatstring6[i]);
}
else if(wiadomosciczat[i] == 7)
{
format(czatstring7[i], sizeof(czatstring7[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat7[i], czatstring7[i]);
}
else if(wiadomosciczat[i] == 8)
{
format(czatstring8[i], sizeof(czatstring8[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat8[i], czatstring8[i]);
}
else if(wiadomosciczat[i] == 9)
{
format(czatstring9[i], sizeof(czatstring9[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat9[i], czatstring9[i]);
}
else if(wiadomosciczat[i] > 9)
{
format(czatstring1[i], sizeof(czatstring1[i]), "%s", czatstring2[i]);
PlayerTextDrawSetString(playerid, Chat1[i], czatstring1[i]);
format(czatstring2[i], sizeof(czatstring2[i]), "%s", czatstring3[i]);
PlayerTextDrawSetString(playerid, Chat2[i], czatstring2[i]);
format(czatstring3[i], sizeof(czatstring3[i]), "%s", czatstring4[i]);
PlayerTextDrawSetString(playerid, Chat3[i], czatstring3[i]);
format(czatstring4[i], sizeof(czatstring4[i]), "%s", czatstring5[i]);
PlayerTextDrawSetString(playerid, Chat4[i], czatstring4[i]);
format(czatstring5[i], sizeof(czatstring5[i]), "%s", czatstring6[i]);
PlayerTextDrawSetString(playerid, Chat5[i], czatstring5[i]);
format(czatstring6[i], sizeof(czatstring6[i]), "%s", czatstring7[i]);
PlayerTextDrawSetString(playerid, Chat6[i], czatstring6[i]);
format(czatstring7[i], sizeof(czatstring7[i]), "%s", czatstring8[i]);
PlayerTextDrawSetString(playerid, Chat7[i], czatstring7[i]);
format(czatstring8[i], sizeof(czatstring8[i]), "%s", czatstring9[i]);
PlayerTextDrawSetString(playerid, Chat8[i], czatstring8[i]);
format(czatstring9[i], sizeof(czatstring9[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat9[i], czatstring9[i]);
}
return 0;
}
if(ViceHeadAdmin[playerid])
{
wiadomosciczat[i]++;
if(wiadomosciczat[i] == 1)
{
format(czatstring1[i], sizeof(czatstring1[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat1[i], czatstring1[i]);
}
else if(wiadomosciczat[i] == 2)
{
format(czatstring2[i], sizeof(czatstring2[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat2[i], czatstring2[i]);
}
else if(wiadomosciczat[i] == 3)
{
format(czatstring3[i], sizeof(czatstring3[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat3[i], czatstring3[i]);
}
else if(wiadomosciczat[i] == 4)
{
format(czatstring4[i], sizeof(czatstring4[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat4[i], czatstring4[i]);
}
else if(wiadomosciczat[i] == 5)
{
format(czatstring5[i], sizeof(czatstring5[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat5[i], czatstring5[i]);
}
else if(wiadomosciczat[i] == 6)
{
format(czatstring6[i], sizeof(czatstring6[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat6[i], czatstring6[i]);
}
else if(wiadomosciczat[i] == 7)
{
format(czatstring7[i], sizeof(czatstring7[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat7[i], czatstring7[i]);
}
else if(wiadomosciczat[i] == 8)
{
format(czatstring8[i], sizeof(czatstring8[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat8[i], czatstring8[i]);
}
else if(wiadomosciczat[i] == 9)
{
format(czatstring9[i], sizeof(czatstring9[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat9[i], czatstring9[i]);
}
else if(wiadomosciczat[i] > 9)
{
format(czatstring1[i], sizeof(czatstring1[i]), "%s", czatstring2[i]);
PlayerTextDrawSetString(playerid, Chat1[i], czatstring1[i]);
format(czatstring2[i], sizeof(czatstring2[i]), "%s", czatstring3[i]);
PlayerTextDrawSetString(playerid, Chat2[i], czatstring2[i]);
format(czatstring3[i], sizeof(czatstring3[i]), "%s", czatstring4[i]);
PlayerTextDrawSetString(playerid, Chat3[i], czatstring3[i]);
format(czatstring4[i], sizeof(czatstring4[i]), "%s", czatstring5[i]);
PlayerTextDrawSetString(playerid, Chat4[i], czatstring4[i]);
format(czatstring5[i], sizeof(czatstring5[i]), "%s", czatstring6[i]);
PlayerTextDrawSetString(playerid, Chat5[i], czatstring5[i]);
format(czatstring6[i], sizeof(czatstring6[i]), "%s", czatstring7[i]);
PlayerTextDrawSetString(playerid, Chat6[i], czatstring6[i]);
format(czatstring7[i], sizeof(czatstring7[i]), "%s", czatstring8[i]);
PlayerTextDrawSetString(playerid, Chat7[i], czatstring7[i]);
format(czatstring8[i], sizeof(czatstring8[i]), "%s", czatstring9[i]);
PlayerTextDrawSetString(playerid, Chat8[i], czatstring8[i]);
format(czatstring9[i], sizeof(czatstring9[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat9[i], czatstring9[i]);
}
return 0;
}
}
else if(strlen(text) >= 52)
{
new stringczatwiecej[MAX_PLAYERS][128];
strmid(stringczatwiecej[i], text, 52, sizeof(stringczatwiecej[i]));
if(IsPlayerAdmin(playerid))
{
wiadomosciczat[i]++;
if(wiadomosciczat[i] == 1)
{
format(czatstring1[i], sizeof(czatstring1[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid,gracz, text);
PlayerTextDrawSetString(playerid, Chat1[i], czatstring1[i]);
wiadomosciczat[i]++;
format(czatstring2[i], sizeof(czatstring2[i]), "~r~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat2[i], czatstring2[i]);
}
else if(wiadomosciczat[i] == 2)
{
format(czatstring2[i], sizeof(czatstring2[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid,gracz, text);
PlayerTextDrawSetString(playerid, Chat2[i], czatstring2[i]);
wiadomosciczat[i]++;
format(czatstring3[i], sizeof(czatstring3[i]), "~r~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat3[i], czatstring3[i]);
}
else if(wiadomosciczat[i] == 3)
{
format(czatstring3[i], sizeof(czatstring3[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat3[i], czatstring3[i]);
wiadomosciczat[i]++;
format(czatstring4[i], sizeof(czatstring4[i]), "~r~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat4[i], czatstring4[i]);
}
else if(wiadomosciczat[i] == 4)
{
format(czatstring4[i], sizeof(czatstring4[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat4[i], czatstring4[i]);
wiadomosciczat[i]++;
format(czatstring5[i], sizeof(czatstring5[i]), "~r~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat5[i], czatstring5[i]);
}
else if(wiadomosciczat[i] == 5)
{
format(czatstring5[i], sizeof(czatstring5[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat5[i], czatstring5[i]);
wiadomosciczat[i]++;
format(czatstring6[i], sizeof(czatstring6[i]), "~r~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat6[i], czatstring6[i]);
}
else if(wiadomosciczat[i] == 6)
{
format(czatstring6[i], sizeof(czatstring6[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat6[i], czatstring6[i]);
wiadomosciczat[i]++;
format(czatstring7[i], sizeof(czatstring7[i]), "~r~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat7[i], czatstring7[i]);
}
else if(wiadomosciczat[i] == 7)
{
format(czatstring7[i], sizeof(czatstring7[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat7[i], czatstring7[i]);
wiadomosciczat[i]++;
format(czatstring8[i], sizeof(czatstring8[i]), "~r~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat8[i], czatstring8[i]);
}
else if(wiadomosciczat[i] == 8)
{
format(czatstring8[i], sizeof(czatstring8[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat8[i], czatstring8[i]);
wiadomosciczat[i]++;
format(czatstring9[i], sizeof(czatstring9[i]), "~r~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat9[i], czatstring9[i]);
}
else if(wiadomosciczat[i] >= 9)
{
format(czatstring1[i], sizeof(czatstring1[i]), "%s", czatstring3[i]);
PlayerTextDrawSetString(playerid, Chat1[i], czatstring1[i]);
format(czatstring2[i], sizeof(czatstring2[i]), "%s", czatstring4[i]);
PlayerTextDrawSetString(playerid, Chat2[i], czatstring2[i]);
format(czatstring3[i], sizeof(czatstring3[i]), "%s", czatstring5[i]);
PlayerTextDrawSetString(playerid, Chat3[i], czatstring3[i]);
format(czatstring4[i], sizeof(czatstring4[i]), "%s", czatstring6[i]);
PlayerTextDrawSetString(playerid, Chat4[i], czatstring4[i]);
format(czatstring5[i], sizeof(czatstring5[i]), "%s", czatstring7[i]);
PlayerTextDrawSetString(playerid, Chat5[i], czatstring5[i]);
format(czatstring6[i], sizeof(czatstring6[i]), "%s", czatstring8[i]);
PlayerTextDrawSetString(playerid, Chat6[i], czatstring6[i]);
format(czatstring7[i], sizeof(czatstring7[i]), "%s", czatstring9[i]);
PlayerTextDrawSetString(playerid, Chat7[i], czatstring7[i]);
format(czatstring8[i], sizeof(czatstring8[i]), "%i ~r~~h~%s ~w~|Head Admin| ~r~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat8[i], czatstring8[i]);
format(czatstring9[i], sizeof(czatstring9[i]), "~r~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat9[i], czatstring9[i]);
wiadomosciczat[i]++;
}
return 0;
}
if(ViceHeadAdmin[playerid])
{
wiadomosciczat[i]++;
if(wiadomosciczat[i] == 1)
{
format(czatstring1[i], sizeof(czatstring1[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat1[i], czatstring1[i]);
format(czatstring2[i], sizeof(czatstring2[i]), "~r~~h~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat2[i], czatstring2[i]);
wiadomosciczat[i]++;
}
else if(wiadomosciczat[i] == 2)
{
format(czatstring2[i], sizeof(czatstring2[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat2[i], czatstring2[i]);
format(czatstring3[i], sizeof(czatstring3[i]), "~r~~h~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat3[i], czatstring3[i]);
wiadomosciczat[i]++;
}
else if(wiadomosciczat[i] == 3)
{
format(czatstring3[i], sizeof(czatstring3[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat3[i], czatstring3[i]);
format(czatstring4[i], sizeof(czatstring4[i]), "~r~~h~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat4[i], czatstring4[i]);
wiadomosciczat[i]++;
}
else if(wiadomosciczat[i] == 4)
{
format(czatstring4[i], sizeof(czatstring4[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat4[i], czatstring4[i]);
format(czatstring5[i], sizeof(czatstring5[i]), "~r~~h~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat5[i], czatstring5[i]);
wiadomosciczat[i]++;
}
else if(wiadomosciczat[i] == 5)
{
format(czatstring5[i], sizeof(czatstring5[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat5[i], czatstring5[i]);
format(czatstring6[i], sizeof(czatstring6[i]), "~r~~h~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat6[i], czatstring6[i]);
wiadomosciczat[i]++;
}
else if(wiadomosciczat[i] == 6)
{
format(czatstring6[i], sizeof(czatstring6[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat6[i], czatstring6[i]);
format(czatstring7[i], sizeof(czatstring7[i]), "~r~~h~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat7[i], czatstring7[i]);
wiadomosciczat[i]++;
}
else if(wiadomosciczat[i] == 7)
{
format(czatstring7[i], sizeof(czatstring7[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat7[i], czatstring7[i]);
format(czatstring8[i], sizeof(czatstring8[i]), "~r~~h~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat8[i], czatstring8[i]);
wiadomosciczat[i]++;
}
else if(wiadomosciczat[i] == 8)
{
format(czatstring8[i], sizeof(czatstring8[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat8[i], czatstring8[i]);
format(czatstring9[i], sizeof(czatstring9[i]), "~r~~h~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat9[i], czatstring9[i]);
wiadomosciczat[i]++;
}
else if(wiadomosciczat[i] >= 9)
{
format(czatstring1[i], sizeof(czatstring1[i]), "%s", czatstring3[i]);
PlayerTextDrawSetString(playerid, Chat1[i], czatstring1[i]);
format(czatstring2[i], sizeof(czatstring2[i]), "%s", czatstring4[i]);
PlayerTextDrawSetString(playerid, Chat2[i], czatstring2[i]);
format(czatstring3[i], sizeof(czatstring3[i]), "%s", czatstring5[i]);
PlayerTextDrawSetString(playerid, Chat3[i], czatstring3[i]);
format(czatstring4[i], sizeof(czatstring4[i]), "%s", czatstring6[i]);
PlayerTextDrawSetString(playerid, Chat4[i], czatstring4[i]);
format(czatstring5[i], sizeof(czatstring5[i]), "%s", czatstring7[i]);
PlayerTextDrawSetString(playerid, Chat5[i], czatstring5[i]);
format(czatstring6[i], sizeof(czatstring6[i]), "%s", czatstring8[i]);
PlayerTextDrawSetString(playerid, Chat6[i], czatstring6[i]);
format(czatstring7[i], sizeof(czatstring7[i]), "%s", czatstring9[i]);
PlayerTextDrawSetString(playerid, Chat7[i], czatstring7[i]);
format(czatstring8[i], sizeof(czatstring8[i]), "%i ~r~~h~%s ~w~|Vice Head Admin| ~r~~h~~h~%s", playerid, gracz, text);
PlayerTextDrawSetString(playerid, Chat8[i], czatstring8[i]);
format(czatstring9[i], sizeof(czatstring9[i]), "~r~~h~~h~%s", stringczatwiecej[i]);
PlayerTextDrawSetString(playerid, Chat9[i], czatstring9[i]);
}
return 0;
}
}
}
return 1;
}
Test this and tell me the results.
* Are you formatting a multi-dimensional array? Then replace the variable's initialization text with: 'new czatstring1[128];'