Help me with this backup message please!
#1

hi to all, i have backup cmd for police, fbi and national guard, its work perfect, but i have 2 little problems and i dont know how to fix that.
1. Message that some of police/fbi/ng member request bk shown to all players
2. On radar, red marker shown to all players on server

How to make that message for bk request see only pd/fbi/ng and on radar marker see only pd/fbi/ng

here is cmd
Код:
if(strcmp(cmd,"/backup",true)==0 || strcmp(cmd,"/bk",true)==0)
	{
		if(IsPlayerConnected(playerid))
		{
			if(PlayerInfo[playerid][pMember] == 1 ||PlayerInfo[playerid][pLeader] == 1 || (PlayerInfo[playerid][pMember] == 2 ||PlayerInfo[playerid][pLeader] == 2 || (PlayerInfo[playerid][pMember] == 3 ||PlayerInfo[playerid][pLeader] == 3)))
			{
				if (PlayerInfo[playerid][pRequestingBackup] != 1 || (PlayerInfo[playerid][pRequestingBackup] != 2 || (PlayerInfo[playerid][pRequestingBackup] != 3)))
				{
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "ALL UNITS: %s NEED IMIDIATLY BCKUP, HIS LOCATION IS MARKED ON RADAR).", sendername);
					PlayerInfo[playerid][pRequestingBackup] = 1;
					for(new i = 0; i < MAX_PLAYERS; i++)
					{
						if(IsPlayerConnected(i))
						{
						if(PlayerInfo[playerid][pMember] == 1 ||PlayerInfo[playerid][pLeader] == 1 || (PlayerInfo[playerid][pMember] == 2 ||PlayerInfo[playerid][pLeader] == 2 || (PlayerInfo[playerid][pMember] == 3 ||PlayerInfo[playerid][pLeader] == 3)))
							{
							if(PlayerInfo[playerid][pMember] == 1 ||PlayerInfo[playerid][pLeader] == 1 || (PlayerInfo[playerid][pMember] == 2 ||PlayerInfo[playerid][pLeader] == 2 || (PlayerInfo[playerid][pMember] == 3 ||PlayerInfo[playerid][pLeader] == 3)))
  								SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
								SendClientMessage(i, TEAM_BLUE_COLOR, string);
							}
						}
					}
					SendClientMessage(playerid, TEAM_BLUE_COLOR, "use /bkc to cancel request");
					SetTimerEx("BackupClear", 180000, false, "ii", playerid, 1);
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "you already request bk");
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "NOT A COP!");
			}
		}
		return 1;
	}
 if(strcmp(cmd,"/backupclear",true)==0 || strcmp(cmd,"/bkc",true)==0)
	{
		BackupClear(playerid, 0);
		return 1;
	}
how to message and marker shown only to pd/fbi/ng members/leaders
Reply
#2

you must make the SendMessageToTeam

add this
Код:
forward SendMessageToTeam( teamid, color, msg[ ] );
public SendMessageToTeam( teamid, color, msg[ ] )
{
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
      if( gTeam[ i ] == teamid )
      {
        SendClientMessage( i, color, msg );
      }
    }
}
a very simple example
Код:
if(strcmp(cmd,"/backup",true)==0 || strcmp(cmd,"/bk",true)==0)
{
SendMessageToTeam( TEAM_COP, COLOR_WHITE, "i need backup");
}
Reply
#3

so what to change that this will work? and how to only pd/fbi/ng see marker on radar?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)