Help problem - 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: Help problem (
/showthread.php?tid=530923)
Help problem -
Spartaaaaa - 09.08.2014
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
Re: Help problem -
Jay_Dixon - 09.08.2014
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
Re: Help problem -
Spartaaaaa - 09.08.2014
Which code? i can fix it if u remember me the CODE name
Re: Help problem -
Champ - 09.08.2014
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.
Re: Help problem -
Spartaaaaa - 09.08.2014
Code:
//==============================================================================
//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);
Re: Help problem -
Champ - 09.08.2014
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'.
Re: Help problem -
Spartaaaaa - 09.08.2014
yes.
Re: Help problem -
Champ - 09.08.2014
pawn Code:
//==============================================================================
//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.
Re: Help problem -
Spartaaaaa - 09.08.2014
it's won't show when other player type any command we can't see right?
Re: Help problem -
Champ - 09.08.2014
it will only show them who have greater or equal to level 8 and it has enabled read pm. Otherwise it wont show.