SA-MP Forums Archive
I've an idea about how to make my chat more "Special Chat" in my server! - 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: I've an idea about how to make my chat more "Special Chat" in my server! (/showthread.php?tid=618424)



I've an idea about how to make my chat more "Special Chat" in my server! - DeathCore - 05.10.2016

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!


Re: I've an idea about how to make my chat more "Special Chat" in my server! - SickAttack - 05.10.2016

Use SendClientMessageToAll.


Re: I've an idea about how to make my chat more "Special Chat" in my server! - DeathCore - 05.10.2016

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


Re: I've an idea about how to make my chat more "Special Chat" in my server! - [WSF]ThA_Devil - 05.10.2016

PHP код:
for(new 0MAX_PLAYERSi++) {
    if(
IsPlayerConnected(i)) {
        if(
== playerid) {
            
SendClientMessage(i,0xffffffaaistr); // Message Shows ONLY to you!
        
} else {
            
SendClientMessage(i,0xffffffaastr); // 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


Re: I've an idea about how to make my chat more "Special Chat" in my server! - DeathCore - 05.10.2016

Quote:
Originally Posted by [WSF]ThA_Devil
Посмотреть сообщение
PHP код:
for(new 0MAX_PLAYERSi++) {
    if(
IsPlayerConnected(i)) {
        if(
== playerid) {
            
SendClientMessage(i,0xffffffaaistr); // Message Shows ONLY to you!
        
} else {
            
SendClientMessage(i,0xffffffaastr); // 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.


Re: I've an idea about how to make my chat more "Special Chat" in my server! - [WSF]ThA_Devil - 05.10.2016

Put a return 0 after it.
Also, test it, as I might or might not have made mistake with the code.