SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/08/2014, 09:06 PM   #1
Spartaaaaa
Huge Clucker
 
Spartaaaaa's Avatar
 
Join Date: May 2014
Location: Puma™
Posts: 262
Reputation: 16
Default Help problem

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
Spartaaaaa is offline   Reply With Quote
Old 09/08/2014, 09:16 PM   #2
Jay_Dixon
Huge Clucker
 
Jay_Dixon's Avatar
 
Join Date: Aug 2012
Posts: 248
Reputation: 17
Default Re: Help problem

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
__________________


Jay_Dixon is offline   Reply With Quote
Old 09/08/2014, 09:21 PM   #3
Spartaaaaa
Huge Clucker
 
Spartaaaaa's Avatar
 
Join Date: May 2014
Location: Puma™
Posts: 262
Reputation: 16
Default Re: Help problem

Which code? i can fix it if u remember me the CODE name
Spartaaaaa is offline   Reply With Quote
Old 09/08/2014, 09:24 PM   #4
Champ
Gangsta
 
Champ's Avatar
 
Join Date: Sep 2011
Location: Pαкιѕтαи
Posts: 765
Reputation: 43
Default Re: Help problem

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.
__________________
Regards,
Champ.
Champ is offline   Reply With Quote
Old 09/08/2014, 09:31 PM   #5
Spartaaaaa
Huge Clucker
 
Spartaaaaa's Avatar
 
Join Date: May 2014
Location: Puma™
Posts: 262
Reputation: 16
Default Re: Help problem

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);
Spartaaaaa is offline   Reply With Quote
Old 09/08/2014, 09:35 PM   #6
Champ
Gangsta
 
Champ's Avatar
 
Join Date: Sep 2011
Location: Pαкιѕтαи
Posts: 765
Reputation: 43
Default Re: Help problem

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'.
__________________
Regards,
Champ.
Champ is offline   Reply With Quote
Old 09/08/2014, 10:06 PM   #7
Spartaaaaa
Huge Clucker
 
Spartaaaaa's Avatar
 
Join Date: May 2014
Location: Puma™
Posts: 262
Reputation: 16
Default Re: Help problem

yes.
Spartaaaaa is offline   Reply With Quote
Old 09/08/2014, 10:13 PM   #8
Champ
Gangsta
 
Champ's Avatar
 
Join Date: Sep 2011
Location: Pαкιѕтαи
Posts: 765
Reputation: 43
Default Re: Help problem

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.
__________________
Regards,
Champ.
Champ is offline   Reply With Quote
Old 09/08/2014, 10:18 PM   #9
Spartaaaaa
Huge Clucker
 
Spartaaaaa's Avatar
 
Join Date: May 2014
Location: Puma™
Posts: 262
Reputation: 16
Default Re: Help problem

it's won't show when other player type any command we can't see right?
Spartaaaaa is offline   Reply With Quote
Old 09/08/2014, 10:25 PM   #10
Champ
Gangsta
 
Champ's Avatar
 
Join Date: Sep 2011
Location: Pαкιѕтαи
Posts: 765
Reputation: 43
Default Re: Help problem

it will only show them who have greater or equal to level 8 and it has enabled read pm. Otherwise it wont show.
__________________
Regards,
Champ.
Champ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
100times i ask this and no one know what is problem, help, watch please ;s[LuXadm] problem ProdrifterX Scripting Help 5 25/05/2012 10:27 PM
Killing Spree problem[Most simple and I have problem :( ] SpiderWalk Scripting Help 13 29/04/2012 08:13 AM
Info Pickup problem [SOLVED] New problem now..... Juanxz Help Archive 2 22/01/2010 07:19 AM
[SOLVED] 3 problem's! (1 problem still unsolved, but stopped solving.) Mechscape Help Archive 9 24/12/2009 08:47 PM


All times are GMT. The time now is 05:04 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.