Help SendMessage TO X
#1

Ok its JHelpersSystem
If you answer to XX and you send message on the chat (F6 > MESSAGE) just you and him see that
I do that but if I send message on the chat its send me the tow messages : Player (MY NICK) : XXXX
Helper (MY NICK): XXXX
and if the id write its write me : Player (His nick):XXX
Helper (his nick) : XXXx
This is the code:
PHP Code:
public OnPlayerText(playeridtext[])
{
  if(
HelperChat[playerid] == 1)
  {
  
format(str,sizeof(str),"[HelperChat] Helper %s[%d]: %s",GetName(playerid),playerid,text);
  
SendClientMessage(Player,Orange,str);
  if(
HelperChat[id] == 1)
  {
  
format(str,sizeof(str),"[HelperChat] Player %s[%d]: %s",GetName(playerid),playerid,text);
  
SendClientMessage(Helper,Orange,str);
  return 
0;
  }
  } 
PHP Code:
if(strcmp(tmp"ACcept"true) == || strcmp(tmp"AC"true) == 0)
{
if(
SetPlayerHelperLevel(playerid) < && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,White,"аъд ма бцееъ дъойлд");
tmp strtok(cmdtext,idx);
if(!
strlen(tmp)) return SendClientMessage(playerid,yellow," /HElpMe ACcept [ID] :цешъ щйоещ");
id strval(tmp);
if(
PlayerHelp[id] == 0) return SendClientMessage(playerid,White,"щзчп жд ма бйчщ бчщъ тжшд");
format(string,sizeof(string),"айщш мк аъ дбчщд емлп рфъз бйрлн ц'аи айщй %s[%d] ддмфш",GetName(playerid),playerid);
SendClientMessage(id,0x7bd22aff,string);
format(string,sizeof(string),"аъ дбчщд емлп рфъз бйрлн ц'аи айщй %s[%d] айщшъ мщзчп",GetName(id),id);
SendClientMessage(playerid,0x7bd22aff,string);
PlayerHelp[playerid] = 0;
HelperChat[playerid]= 1,HelperChat[id]= 1;
PlayerChat[Player] = 1,HelperChat2[Helper]= 1;
return 
1;
}

and :
PHP Code:
OnPlayerCommandText
Helper 
playerid;
Player id;
________________________________________________________ 
PHP Code:
new PlayerChat[MAX_PLAYERS];
new 
HelperChat2[MAX_PLAYERS];
new 
Helper;
new 
Player
I can help please?
Reply
#2

HELP?
Reply
#3

Return 0 means message will not send, also where's the REGULAR chat line?
Reply
#4

I dont understand you ..
you can help me ?
Reply
#5

No, return 0 in OnPlayerText callback means it wont send the original message (the one we see in DM servers, whre everyone can see it)

Try this:
pawn Code:
public OnPlayerText(playerid, text[])
{
    if(HelperChat[playerid] == 1)
    {
        format(str,sizeof(str),"[HelperChat] Helper %s[%d]: %s",GetName(playerid),playerid,text);
        SendClientMessage(Player,Orange,str);
        if(HelperChat[id] == 1)
        {
            format(str,sizeof(str),"[HelperChat] Player %s[%d]: %s",GetName(playerid),playerid,text);
            SendClientMessage(Helper,Orange,str);
        }
    }
    return 0;
}
Reply
#6

dont work !1
Reply
#7

pawn Code:
public OnPlayerText(playerid, text[])
{
    if(HelperChat[playerid] == 1)
    {
        if(playerid == Helper)
        {
            format(str,sizeof(str),"[HelperChat] Helper %s[%d]: %s",GetName(playerid),playerid,text);
        }
        else
        {
            format(str,sizeof(str),"[HelperChat] Player %s[%d]: %s",GetName(playerid),playerid,text);
        }
        SendClientMessage(Player,Orange,str);
        SendClientMessage(Helper,Orange,str);
        return 0;
    }
Reply
#8

Listen !!
now I fix the player ..
if player send message : PLAYER : XXXXXXX and he see that
but if the helper send message I see : Player : XXXXXXX
But the friend see : Helper : XXXX

Why I see Player XX
this is the code :
PHP Code:
if(PlayerChat[id] == 1)
  {
  
format(str,sizeof(str),"[HelperChat] Player %s[%d]: %s",GetName(playerid),playerid,text);
  
SendClientMessage(Helper,Orange,str);
  
format(str,sizeof(str),"[HelperChat] Player %s[%d]: %s",GetName(playerid),playerid,text);
  
SendClientMessage(Player,Orange,str);
  if(
HelperChat2[playerid] == 1)
  {
  
format(str,sizeof(str),"[HelperChat] Helper %s[%d]: %s",GetName(playerid),playerid,text);
  
SendClientMessage(Player,Orange,str);
  }
  return 
0;
  } 
Reply
#9

Quote:
Originally Posted by lonako45
View Post
Listen !!
now I fix the player ..
if player send message : PLAYER : XXXXXXX and he see that
but if the helper send message I see : Player : XXXXXXX
But the friend see : Helper : XXXX

Why I see Player XX
this is the code :
PHP Code:
if(PlayerChat[id] == 1)
  {
  
format(str,sizeof(str),"[HelperChat] Player %s[%d]: %s",GetName(playerid),playerid,text);
  
SendClientMessage(Helper,Orange,str);
  
format(str,sizeof(str),"[HelperChat] Player %s[%d]: %s",GetName(playerid),playerid,text);
  
SendClientMessage(Player,Orange,str);
  if(
HelperChat2[playerid] == 1)
  {
  
format(str,sizeof(str),"[HelperChat] Helper %s[%d]: %s",GetName(playerid),playerid,text);
  
SendClientMessage(Player,Orange,str);
  }
  return 
0;
  } 
HELP ?
Reply
#10

HELP??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)