SA-MP Forums Archive
What to do to chat? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What to do to chat? (/showthread.php?tid=272941)



What to do to chat? - samtey - 30.07.2011

Hi!

I just found out, that I can't chat in my server! What do I need to do? Are there any tutorials? Which is the best?


Re: What to do to chat? - =WoR=Varth - 30.07.2011

Show your OnPlayerText code.


AW: What to do to chat? - samtey - 30.07.2011

It's empty!


Re: What to do to chat? - =WoR=Varth - 30.07.2011

Make sure it's return 1;
And check any other script (FS,etc.)


Re: What to do to chat? - Kush - 30.07.2011

PHP код:
new chatmode 1
PHP код:
stock SendLocalChat(playerid,color,msg[],Float:radius)
{
  new 
Float:x,Float:y,Float:z;
  
GetPlayerPos(playerid,x,y,z);
  for(new 
ply;ply<MAX_PLAYERS;ply++)
  {
    if(
IsPlayerInRangeOfPoint(ply,radius,x,y,z))SendClientMessage(ply,color,msg);
  }
  return 
1;

PHP код:
public OnPlayerText(playeridtext[])
{
    new 
sendername[MAX_PLAYER_NAME];
    new 
string[128];
    if(
chatmode)
    {
        
GetPlayerRPName(playeridsendernamesizeof(sendername));
        
format(stringsizeof(string), "%s says: %s"sendernametext);
        
SendLocalChat(playerid,COLOR_WHITE,string,20.0);
    }
     return 
0;




AW: What to do to chat? - samtey - 30.07.2011

One Error and one warning:

Код:
D:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\gamemodes\deathmatch.pwn(371) : error 017: undefined symbol "GetPlayerRPName"
D:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\gamemodes\deathmatch.pwn(371) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Line:

pawn Код:
GetPlayerRPName(playerid, sendername, sizeof(sendername));
Should I do this?

pawn Код:
new GetPlayerRPName=1;



Re: What to do to chat? - Gazmull - 30.07.2011

It must be GetPlayerName if you don't have defined yet GetPlayerRPName.


Re: What to do to chat? - Kush - 30.07.2011

PHP код:
public OnPlayerText(playeridtext[]) 

    new 
sendername[MAX_PLAYER_NAME]; 
    new 
string[128]; 
    if(
chatmode
    { 
        
GetPlayerName(playeridsendernamesizeof(sendername)); 
        
format(stringsizeof(string), "%s says: %s"sendernametext); 
        
SendLocalChat(playerid,COLOR_WHITE,string,20.0); 
    } 
     return 
0