SA-MP Forums Archive
big ears system not working - 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: big ears system not working (/showthread.php?tid=501270)



big ears system not working - ChristianIvann09 - 17.03.2014

I have this code

Код:
// Big Ears
CMD:bigears(playerid, params[])
{
    if( PlayerInfo[playerid][pAdmin] >= 3) {
        if (!BigEar[playerid]) {
            BigEar[playerid] = 1;
            SendClientMessageEx(playerid, COLOR_GRAD2, "Your ears have grown to gargantuan proportions!");
        }
        else if (BigEar[playerid]) {
            (BigEar[playerid] = 0);
            SendClientMessageEx(playerid, COLOR_GRAD2, "Your ears have shrunk.");
        }
    }
    return 1;
}
Код:
new BigEar[MAX_PLAYERS];
But this code is not working. when i enabled it and when a far players talk its not broadcasting.

I dunno why..

Do i need to set the big ear on OnPlayerTalk? or what or OnPlayerCommand?


Re: big ears system not working - Calabresi - 17.03.2014

You need to put something like this on OnPlayerText;

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
     if(i == playerid) continue;
     if(BigEar[i] == 1)
     {
          SendClientMessage(i, -1, text);
     }
}



Re: big ears system not working - ChristianIvann09 - 17.03.2014

I think this one.. i dont know which of them.

Код:
stock SendClientMessageEx(playerid, color, string[])
{
	if(InsideMainMenu[playerid] == 1 || InsideTut[playerid] == 1 || ActiveChatbox[playerid] == 0)
		return 0;

	else SendClientMessage(playerid, color, string);
	return 1;
}
Код:
stock ICNews(color, string[]) {
	foreach(Player, i) {
	    if(gNews[i] == 0)
	        SendClientMessageEx(i, color, string);
	}
	
	return 1;
}



Re: big ears system not working - Calabresi - 17.03.2014

Quote:
Originally Posted by ChristianIvann09
Посмотреть сообщение
I think this one.. i dont know which of them.

Код:
stock SendClientMessageEx(playerid, color, string[])
{
	if(InsideMainMenu[playerid] == 1 || InsideTut[playerid] == 1 || ActiveChatbox[playerid] == 0)
		return 0;

	else SendClientMessage(playerid, color, string);
	return 1;
}
Код:
stock ICNews(color, string[]) {
	foreach(Player, i) {
	    if(gNews[i] == 0)
	        SendClientMessageEx(i, color, string);
	}
	
	return 1;
}
I wrote wrong, it was my mistake. Check the post above.


Re: big ears system not working - ChristianIvann09 - 17.03.2014

Quote:
Originally Posted by Calabresi
Посмотреть сообщение
I wrote wrong, it was my mistake. Check the post above.
thank you very much, i will test it out


Re: big ears system not working - ChristianIvann09 - 17.03.2014

Not working dude


Re: big ears system not working - ChristianIvann09 - 17.03.2014

anyone?


Re: big ears system not working - Calabresi - 17.03.2014

Are you sure that you tried this with someone else? If so, tell us where did you out my code.


Re: big ears system not working - ChristianIvann09 - 17.03.2014

Quote:
Originally Posted by Calabresi
Посмотреть сообщение
Are you sure that you tried this with someone else? If so, tell us where did you out my code.
its working but its showing like this

Код:
[21:35:56] Ivann says: (( why you want to be admin? )) 

[21:35:58] Hello.

[21:35:58] Slim Shady says: Hello.
And when they type on /b i didnt broadcast to me.. and when they leave on server i didnt see too they leave

Код:
public OnPlayerText(playerid, text[])
{
	if(CheckGMX(playerid)) return 0;
	if(gPlayerLogged[playerid] != 1)
	{
		SendClientMessage(playerid, COLOR_RED, "You're not logged in.");
		return 0;
	}
	if(PlayerInfo[playerid][pTut] == 0)
	{
		return 0;
	}

	new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	new string[128];
	playerLastTyped[playerid] = 0;

	if(TextSpamUnmute[playerid] != 0)
	{
		if(PlayerInfo[playerid][pAdmin] < 6)
		{
			SendClientMessage(playerid, COLOR_WHITE, "You're muted from submitting text right now.");
			return 0;
		}
	}

	if(PlayerInfo[playerid][pAdmin] < 6)
	{
		TextSpamTimes[playerid]++;

		if(TextSpamTimes[playerid] == 5)
		{
			TextSpamTimes[playerid] = 0;
			TextSpamUnmute[playerid] = 10;
			SendClientMessage(playerid, COLOR_YELLOW, "You have been muted automatically for spamming. Please wait 10 seconds and try again.");
			SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_FLOODPROTECTION);
			return 0;
		}
	}

	if(strfind(text, "|", true) != -1)
	{
	    SendClientMessage(playerid, COLOR_RED, "You can't use the '|' character in text.");
		return 0;
	}

	if(PlayerInfo[playerid][pAdmin] < 4)
	{
		if(strfind(text, ":", true) != -1)
		{
			new
				i_numcount,
				i_period,
				i_pos;

			while(text[i_pos]) {
				if('0' <= text[i_pos] <= '9') i_numcount++;
				else if(text[i_pos] == '.') i_period++;
				i_pos++;
			}
			if(i_numcount >= 8 && i_period >= 3) {
				format(string,sizeof(string),"Warning: %s may be server advertising: '%s'.", GetPlayerNameEx(playerid),text);
				ABroadCast(COLOR_RED, string, 2);
				Log("logs/anti-server-ad-log.log", string);
				return 0;
			}
		}
	}
                // your code
		for(new i = 0; i < MAX_PLAYERS; i++)
	{
	     if(i == playerid) continue;
	     if(BigEar[i] == 1)
	     {
	          SendClientMessage(i, -1, text);
	     }
	}
Код:
	new string[128];
	switch (reason)
	{
 	   	case 0:
	   	{
		   	format(string, sizeof(string), "%s has left the server (timeout).", GetPlayerNameEx(playerid));
		   	ProxDetector(30.0, playerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
		   	if(PlayerCuffed[playerid] != 0)
		   	{
	    		strcpy(PlayerInfo[playerid][pPrisonedBy], "Server", 64);
				strcpy(PlayerInfo[playerid][pPrisonReason], "Logging while cuffed (timeout)", 64);

                PlayerInfo[playerid][pJailed] = 3;
				PlayerInfo[playerid][pJailTime] += 30*60;
			}
	   	}
	   	case 1:
 	  	{
		   	format(string, sizeof(string), "%s has left the server (leaving).", GetPlayerNameEx(playerid));
		   	ProxDetector(30.0, playerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
		   	if(PlayerCuffed[playerid] != 0)
		   	{
    			strcpy(PlayerInfo[playerid][pPrisonedBy], "Server", 64);
				strcpy(PlayerInfo[playerid][pPrisonReason], "Logging while cuffed (leaving)", 64);

                PlayerInfo[playerid][pJailed] = 3;
				PlayerInfo[playerid][pJailTime] += 20*60;
			}
		}
		case 2:
	    {
			format(string, sizeof(string), "%s has left the server (kicked/banned).", GetPlayerNameEx(playerid));
			ProxDetector(30.0, playerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
	   	}
	}
Anyways, i need to go to school bye

if you have skype please add me: christianivann09


Re: big ears system not working - Calabresi - 17.03.2014

That's because you need to format it for your purpose! I just gave an example code to hint how you can do it, also you need to implement it into every single command/code you want it to work on. It's not going to happen itself.