Posts: 85
Threads: 17
Joined: Jul 2015
I was thinking about making my chat even better, when you sending a message it will sendclientmessage to anyone with your NAME: Text... but you will see in your screen this: You: Text..
it returns 0 and ONLY ONE MESSAGE SENT and not two sendclientmessages I mean I can't do this right?
SendClientMessage(i,0xffffffaa, str); // Message Shows To Anyone but not you
SendClientMessage(playerid,0xffffffaa, istr); // Message Shows ONLY to you!
return 0;
Thank you for your help!
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
Use SendClientMessageToAll.
Posts: 85
Threads: 17
Joined: Jul 2015
Quote:
Originally Posted by SickAttack
Use SendClientMessageToAll.
|
But it will send to anyone including myself, I want that one message will send only to me, and the other message will send to the others but not me
NAME: hi all <<< everyone will see it but not me
You: hi all << I will see it but no one else will see it
Posts: 85
Threads: 17
Joined: Jul 2015
Quote:
Originally Posted by [WSF]ThA_Devil
PHP код:
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(i == playerid) {
SendClientMessage(i,0xffffffaa, istr); // Message Shows ONLY to you!
} else {
SendClientMessage(i,0xffffffaa, str); // Message Shows To Anyone but not you
}
}
}
Excuse my indentation, wrote it in the reply box.
EDIT: My OCD kicked in.. had to fix the indentation... xD
|
If I will put return 0 under these functions it will work? these 2 functions will work at the same time when I'll send one message in public OnPlayerText? I had no time to test it out sorry.
Posts: 662
Threads: 102
Joined: Sep 2010
Reputation:
0
Put a return 0 after it.
Also, test it, as I might or might not have made mistake with the code.