Private chat
#1

OK
I do system ..
If player call you , you do /answer id
and open you new chat
write on the chat but this send the message for you and for the player ..
Im try this :
(But have bags ...)
OnPlayerText:

PHP Code:
PHP код:
   if(HelperChat[playerid] == 1
    { 
        
format(str,sizeof(str),"[HelperChat] Player %s[%d] || %s",GetName(playerid),playerid,text); 
        
SendClientMessage(playerid,Orange,str); 
        if(
IsPlayerHelper(playerid)) 
        { 
        
format(str,sizeof(str),"[HelperChat] Helper %s[%d] || %s",GetName(playerid),playerid,text); 
        
SendClientMessage(playerid,Orange,str); 
        return 
0
    } 
    } 
And if player answer to player:
PHP код:
HelperChat[playeridHelperChat[id] = 1
If you dont understand :
Let's make it clear:
A player needs help with buying a car, so that player uses: /help I don't know where to buy a car.
If you are a helper a message will popup(something like this): [HELP] %s is requesting help! Reason: I don't know where to buy a car. Then the helper with type /answer <PLAYER ID>.
After the help request is accepted, the helper and requester will now be able to communicate in a kind off private chat.
Reply
#2

And what's the bag?
Reply
#3

HAM its work just the player
if I Helper I dont see the chat
If I player I see the chat buy this send my the message two times ! one|| PLAYER SAY : XXXXX
and one || HELPER SAY : XXXX
Reply
#4

How do you define the ID of player and ID of helper?

You should add something on the command to start chat between 2 players like:
pawn Код:
HelperChat[playerid] = 2ndplayer;
HelperChat[2ndplayer] = playerid;
You should basically send a message to playerid and HelperChat[playerid] instead of sending 2 messages to playerid.


When the chat closes you should put this:
pawn Код:
HelperChat[HelperChat[playerid]] = -1;
HelperChat[playerid] = -1;

And add this under OnPlayerDisconnect
pawn Код:
if(IsPlayerConnected(HelperChat[playerid]))
{
       SendClientMessage(HelperChat[playerid], Orange, "The player you were chatting with has disconnected.");
       HelperChat[HelperChat[playerid]] = -1;
}
HelperChat[playerid] = -1;
Reply
#5

I try this later and I tell you if is work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)