SA-MP Forums Archive
Chat error. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Chat error. (/showthread.php?tid=586393)



Chat error. - DerickClark - 21.08.2015

........


Re: Chat error. - Roberto80 - 21.08.2015

Dude!!!
SendClientMessage parameterslayerid,color,message.
So just add playerid before GetPlayerColor
Code:
SendClientMessage(playerid,GetPlayerColor(playerid ), string);


Re: Chat error. - DerickClark - 21.08.2015

Only problem i'm having is the chat is spamming.


Код:
if(Chat[playerid] == true)
	{
        new string[128];
   	    format(string,sizeof(string),"(%i) %s: {FFFFFF}%s",playerid, ReturnName(playerid),text);
 	    SendClientMessageToAll(GetPlayerColor(playerid), string);
 	    if(Chat[playerid] == false)
    	{
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
   	           format(string,sizeof(string),"%s: {FFFFFF}%s",playerid, ReturnName(i),text);
   	           SendClientMessage(playerid,GetPlayerColor(playerid),string);
 	        }
 	    }
 	}
    else
	{
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            new string[128];
   	        format(string,sizeof(string),"%s: {FFFFFF}%s",ReturnName(i),text);
 	        SendClientMessage(playerid,GetPlayerColor(playerid),string);
 	    }
 	}



Re: Chat error. - DerickClark - 21.08.2015

Anyone. this problem is spamming.


Re: Chat error. - nezo2001 - 21.08.2015

PHP код:
if(Chat[playerid] == true)
    {
        new 
string[128];
           
format(string,sizeof(string),"(%i) %s: {FFFFFF}%s",playeridReturnName(playerid),text);
         
SendClientMessageToAll(GetPlayerColor(playerid), string);
         if(
Chat[playerid] == false)
        {
            for(new 
0MAX_PLAYERSi++)
            {
                  
format(string,sizeof(string),"%s: {FFFFFF}%s",playeridReturnName(i),text);
             }
            
SendClientMessage(playerid,GetPlayerColor(playerid),string);
         }
     }
    else
    {
        for(new 
0MAX_PLAYERSi++)
        {
            new 
string[128];
               
format(string,sizeof(string),"%s: {FFFFFF}%s",ReturnName(i),text);
         }
             
SendClientMessage(playerid,GetPlayerColor(playerid),string);
     } 



Re: Chat error. - Roberto80 - 22.08.2015

Use return 0;