CHAT Crash
#3

PHP код:
public OnPlayerText(playeridtext[])
{
    
//======================== 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;
    } 
Reply


Messages In This Thread
CHAT Crash - by T1 - 31.03.2018, 10:04
Re: CHAT Crash - by rfr - 31.03.2018, 10:07
Re: CHAT Crash - by T1 - 31.03.2018, 10:16
Re: CHAT Crash - by DeathCore - 31.03.2018, 21:04

Forum Jump:


Users browsing this thread: 1 Guest(s)