SA-MP Forums Archive
Help please - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help please (/showthread.php?tid=124662)



Help please - The_Tough - 31.01.2010

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	{
	if(PlayerData[playerid][Muted] == 1)
	{
    if(PlayerData[playerid][Level] >= 4)
    {
    return 1;
    }
	NMC(playerid,"[ NOTICE ] You are still muted !");
	return 0;
	}
Why its not working ?



Re: Help please - jasonnw666 - 31.01.2010

oh my god why u try to do lol


Re: Help please - ray187 - 31.01.2010

What happens here is that if someone is muted and their level is >= 4 the function stops returning 1 - if someone is muted and the level is below 0 he most likely gets a message (depending on what NMC() does) and the function returns 0.

There are some curly braces missing in the end.

Question is, what`s the result you`re expecting?


Re: Help please - jasonnw666 - 31.01.2010

u want avoid to do a command?


Re: Help please - The_Tough - 31.01.2010

NMC = Notince Message Color is already stocked to avoid SendClientMessage = more time...

I want if a player is muted and his level is bigger then level 4 to be able to speak...

I didnt post all of my script thats why brackets are missing

Compiling is ok.


Re: Help please - jasonnw666 - 31.01.2010

if u want avoid to speak u need to add script in "public OnPlayerText(playerid, text[])"


Re: Help please - ray187 - 31.01.2010

Right first off:

OnPlayerCommandText is for commands.
OnPlayerText is for normal game chat.

So I`d copy those lines in OnPlayerText and remove them from OnPlayerCommandText.

Can you show the lines of OnPlayerText that cause printing out what a player enters in his chatbox?

Basically you have to copy those lines like this:

Код:
public OnPlayerText(playerid, text[])
{
	if(PlayerData[playerid][Muted] == 1)
	{
		if(PlayerData[playerid][Level] >= 4)
		{
			// HERE SHOULD THE GENERAL OUTPUT LINES BE 
			return 1;
		}
		NMC(playerid,"[ NOTICE ] You are still muted !");
		return 0;
	}