PDA

View Full Version : Help problem


Spartaaaaa
09/08/2014, 09:06 PM
Whenever someone write any command or send pm to anyone we can read that on CHAT
Ex: i write /car
and Sparta(3): /Car, i don't like that we must can't read others PM and Commands

Jay_Dixon
09/08/2014, 09:16 PM
And we're supposed to guess your script? How about you post that part here and maybe then we can all see what the problem is? xD

Spartaaaaa
09/08/2014, 09:21 PM
Which code? i can fix it if u remember me the CODE name

Champ
09/08/2014, 09:24 PM
i think, just make a variable and make it false in /pm command and go to your function where it sendclientmessage
"%s(%d): %s", name, playerid, command);. put it in a case when you put an statement that the given variable is true, if yes then send it.

Spartaaaaa
09/08/2014, 09:31 PM
//================================================== ============================
//Private Message (PM)
//================================================== ============================
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
//--------------------------------------------------------------------------
//Reading PM's
//--------------------------------------------------------------------------
new string[220];
//--------------------------------------------------------------------------
format(string, 220, "{FF0000}PrivateMessage: {00FF00}%s to %s: %s .*", PlayerName2(playerid), PlayerName2(recieverid), text);
for(new a = 0; a < MAX_PLAYERS; a++)
{
if(IsPlayerConnected(a))
{
if(AccInfo[a][Level] >= 8)
{
if(AccInfo[a][ReadPM] == 1)
{
SendClientMessage(a, grey, string);
}
}
}
}
SaveIn("PMsLog",string);

Champ
09/08/2014, 09:35 PM
can you make me clear.

when you type /pm message. it shows it to all players like "Sparta(3): message" ?
if yes, then just remove the loop and add playerid instead of 'a'.

Spartaaaaa
09/08/2014, 10:06 PM
yes.

Champ
09/08/2014, 10:13 PM
//================================================== ============================
//Private Message (PM)
//================================================== ============================
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
//--------------------------------------------------------------------------
//Reading PM's
//--------------------------------------------------------------------------
new string[220];
//--------------------------------------------------------------------------
format(string, 220, "{FF0000}PrivateMessage: {00FF00}%s to %s: %s .*", PlayerName2(playerid), PlayerName2(recieverid), text);

if(IsPlayerConnected(playerid))
{
if(AccInfo[playerid][Level] >= 8)
{
if(AccInfo[playerid][ReadPM] == 1)
{
SendClientMessage(playerid, grey, string);
}
}
}
SaveIn("PMsLog",string);

i guess this gonna work.

Spartaaaaa
09/08/2014, 10:18 PM
it's won't show when other player type any command we can't see right?

Champ
09/08/2014, 10:25 PM
it will only show them who have greater or equal to level 8 and it has enabled read pm. Otherwise it wont show.