OnPlayerText doesn't work.
#1

PHP код:
    if(GetPlayerState(playerid) == PLAYER_STATE_SPAWNED)
    {
        if(
PlayerTemp[playerid][muted]==0)
        {
            new 
sender[MAX_STRING];
            if(
PlayerTemp[playerid][phone]!=0)
            {
                if(
PlayerTemp[playerid][hname]==1myStrcpy(sender,iStr);
                else 
myStrcpy(sender,RPName(playerid));
                if(
text[0]== '(')
                {
                    new 
mid[MAX_STRING];
                    
strmid(mid,text,1,256,sizeof(mid));
                    
text[0] = toupper(text[0]);
                    
format(stringa,sizeof(stringa),"(Phone) %s says: (( %s ))",RPName(playerid),mid);
                }
                else
                {
                    
text[0] = toupper(text[0]);
                    
format(stringa,sizeof(stringa),"(Phone) %s says: %s",sender,text);
                    
SendClientMessage(PlayerTemp[playerid][onphone],COLOR_YELLOW,stringa);
                }
            }
            else
            {
                if(
PlayerTemp[playerid][hname]==1myStrcpy(sender,iStr);
                else 
myStrcpy(sender,RPName(playerid));
                if(
text[0]== '(')
                {
                    new 
mid[MAX_STRING];
                    
strmid(mid,text,1,256,sizeof(mid));
                    
format(iStrsizeof(iStr), "(( %s ))"mid);
                    
SetPlayerChatBubble(playerid,iStr,COLOR_WHITE50.0 5000);
                    
format(stringa,sizeof(stringa),"%s says: (( %s ))",RPName(playerid),mid);
                }
                 else
                {
                    
text[0] = toupper(text[0]);
                    
SetPlayerChatBubble(playerid,text,COLOR_WHITE50.0 5000);
                    if(!
strcmp(PlayerInfo[playerid][accent],"unset"))
                    {
                        
format(iStrsizeof(iStr),": ");
                    }
                    else
                    {
                        
format(iStr,sizeof(iStr),": [%s Accent] ",PlayerInfo[playerid][accent]);
                    }
                    
format(stringa,sizeof(stringa),"%s says%s%s",sender,iStr,text);
                }
            }
            
PlayerLoop(i)
            {
                if(!
IsPlayerConnected(i)) continue;
                if(!
IsPlayerInRangeOfPoint(i60.0px,py,pz)) continue;
                if(
GetPlayerVirtualWorld(i) != GetPlayerVirtualWorld(playerid) || GetPlayerInterior(i) != GetPlayerInterior(playerid)) continue;
                new 
Float:dis;
                
disGetDistanceBetweenPlayers(playerid,i);
                if(
dis>45SendClientMessage(i,COLOR_PLAYER_DARKGREY,stringa);
                if(
dis<=35 && dis >15SendClientMessage(i,COLOR_PLAYER_GREY,stringa);
                if(
dis<=15SendClientMessage(i,COLOR_PLAYER_WHITE,stringa);
            }
            
strdel(stringa,0,strlen(PlayerName(playerid))+7);
            new 
tmpStr144 ];
            if(
text[0]== '(')
            {
                new 
mid[MAX_STRING];
                
strmid(mid,text,1,256,sizeof(mid));
                
format(tmpStr164"7%s[%d]: (( %s ))"RPName(playerid), playeridmid);
                
text[0] = toupper(text[0]);
                
iEcho(tmpStrIRC_LIVE);
            }
            else
            {
                
format(tmpStr164"7%s[%d]: %s"RPName(playerid), playeridtext);
                
text[0] = toupper(text[0]);
                
iEcho(tmpStr ,IRC_LIVE);
            }
            if(
stringContainsIP(text))
            {
                new 
wat80 ];
                
//GetPlayerName(playerid, wat, 20);
                
format(watsizeof(wat),"IP Advertisments");//format(string, sizeof(string), "[!] \"%s\" named player has been banned from the server! [Reason: IP advertisements]", string);
                
return BanReas("SERVER",playerid,wat1), false;
            }
        }
        else
        {
            
SendClientMessage(playerid,COLOR_RED," You are muted!");
            return 
0;
        }
    }
    else if(
GetPlayerState(playerid) == PLAYER_STATE_WASTED)
    {
        
SendClientError(playerid"You cannot talk in local chat while dead!");
        return 
0;
    } 
When I'm typing in local chat, the text doesn't appear
Reply


Messages In This Thread
OnPlayerText doesn't work. - by ServerFiles - 14.09.2018, 11:30
Re: OnPlayerText doesn't work. - by AmirSavand - 14.09.2018, 12:06
Re: OnPlayerText doesn't work. - by ServerFiles - 14.09.2018, 13:51
Re: OnPlayerText doesn't work. - by AmirSavand - 14.09.2018, 14:11

Forum Jump:


Users browsing this thread: 1 Guest(s)