31.03.2018, 10:16
PHP код:
public OnPlayerText(playerid, text[])
{
//======================== Donator Chat =========================
if(DonChat[playerid] == 1)
{
new tstr[128];
new maxlen = floatround(((CHAT_WIDTH * 0.24)-strlen(SpielerName(playerid)))-1,floatround_ceil);
switch(DonChatFarbe[playerid])
{
case 0:
{
format(tstr,128,"%s~w~: %s",SpielerName(playerid),text);
}
case 1:
{
format(tstr,128,"~r~~h~~h~%s~w~: %s",SpielerName(playerid),text);
}
case 2:
{
format(tstr,128,"~y~%s~w~: %s",SpielerName(playerid),text);
}
case 3:
{
format(tstr,128,"~b~~h~%s~w~: %s",SpielerName(playerid),text);
}
case 4:
{
format(tstr,128,"~g~~h~~h~%s~w~: %s",SpielerName(playerid),text);
}
}
if(strlen(text) > maxlen)
{
SendClientMessagef(playerid,ROT,"Maximale Textlдnge ьberschritten(>>%d/%d<<)",strlen(text),maxlen);
}
else
{
new line = FreeChatLine();
format(ChatStr[line],128,tstr);
for(new i=0;i<10;i++)
{
TextDrawSetString(ChatLine[i],ChatStr[i]);
}
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(DonChat[playerid] == 1)
{
HideChatBox(i);
ShowChatBox(i);
}
}
}
return 0;
}
return 1;
}