[Help] Message Repeating
#1

Hey guys i have a huge problem here.

Every time some one gets suspected the message repeats for everyone.
First one time for the guy that gets suspected and then like 6 times for everyone else.

Код:
public SetPlayerCriminal(playerid,declare,reason[])
{//example: SetPlayerCriminal(playerid,255, "Stealing A Police Vehicle");
	if(IsPlayerConnected(playerid))
	{
	    PlayerInfo[playerid][pCrimes] += 1;
		new turned[MAX_PLAYER_NAME];
		new turner[MAX_PLAYER_NAME];
		new turnmes[128];
		strmid(PlayerCrime[playerid][pAccusedof], reason, 0, strlen(reason), 255);
		GetPlayerName(playerid, turned, sizeof(turned));
		if (declare == 255)
		{
			format(turner, sizeof(turner), "Unknown");
			strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
		}
		else
		{
		    if(IsPlayerConnected(declare))
		    {
				GetPlayerName(declare, turner, sizeof(turner));
				strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
				strmid(PlayerCrime[declare][pBplayer], turned, 0, strlen(turned), 255);
				strmid(PlayerCrime[declare][pAccusing], reason, 0, strlen(reason), 255);
			}
		}
		format(turnmes, sizeof(turnmes), "You've commited a Crime ( %s ). Reporter: %s.",reason,turner);
		SendClientMessage(playerid, COLOR_LIGHTRED, turnmes);

		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
			    if(PlayerInfo[i][pMember] == 1||PlayerInfo[i][pLeader] == 1)
			    {
					format(cbjstore, sizeof(turnmes), "HQ: All Units APB: Reporter: %s",turner);
					SendPDRadioMessage(1600,TEAM_BLUE_COLOR, turnmes);
					format(cbjstore, sizeof(turnmes), "HQ: Crime: %s, Suspect: %s",reason,turned);
					SendPDRadioMessage(1600,TEAM_BLUE_COLOR, turnmes);
					format(cbjstore, sizeof(turnmes), "HQ: Contact Number: %d",PlayerInfo[playerid][pPnumber]);
					SendPDRadioMessage(1600,TEAM_BLUE_COLOR, turnmes);
					new Float:trace_x, Float:trace_y, Float:trace_z;
					GetPlayerPos(playerid, trace_x, trace_y, trace_z);
					emdtrace = 1; emdtrace_x = trace_x; emdtrace_y = trace_y; emdtrace_z = trace_z;
					pdtrace = 1; pdtrace_x = trace_x; pdtrace_y = trace_y; pdtrace_z = trace_z;
				}
			}
		}
	}//not connected
}
This is the part that repeats but with an other color to it's a red color here but it gets blue for everyone.

Код:
format(turnmes, sizeof(turnmes), "You've commited a Crime ( %s ). Reporter: %s.",reason,turner);
SendClientMessage(playerid, COLOR_LIGHTRED, turnmes);
Reply
#2

In formats replace
cbjstore, sizeof(turnmes)
to
turnmes, sizeof(turnmes)

here
pawn Код:
format(cbjstore, sizeof(turnmes), "HQ: All Units APB: Reporter: %s",turner);
                    SendPDRadioMessage(1600,TEAM_BLUE_COLOR, turnmes);
                    format(cbjstore, sizeof(turnmes), "HQ: Crime: %s, Suspect: %s",reason,turned);
                    SendPDRadioMessage(1600,TEAM_BLUE_COLOR, turnmes);
                    format(cbjstore, sizeof(turnmes), "HQ: Contact Number: %d",PlayerInfo[playerid][pPnumber]);
                    SendPDRadioMessage(1600,TEAM_BLUE_COLOR, turnmes);
Reply
#3

Thank you it helped but now i get the APB report 2 times :P
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)