Private 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)
+--- Thread: Private chat (
/showthread.php?tid=343326)
Private chat -
lonako45 - 17.05.2012
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[playerid] 1 = HelperChat[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.
Re: Private chat -
iRage - 17.05.2012
And what's the bag?
Re: Private chat -
lonako45 - 17.05.2012
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
Re: Private chat -
iRage - 17.05.2012
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;
Re: Private chat -
lonako45 - 17.05.2012
I try this later and I tell you if is work