Only for cops.
#1

I'm trying to make this so it only shows up for factions 1 and 2, but it shows up for everyone when a cop requests backup.
Код:
	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)
	    {
				if (PlayerInfo[playerid][pRequestingBackup] != 1)
				{
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "ALL UNITS: %s is requesting backup, they have been marked on your cruisers GPS (red).", 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)
	    {
								SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
								SendClientMessage(i, TEAM_BLUE_COLOR, string);
							}
						}
					}
					SendClientMessage(playerid, TEAM_BLUE_COLOR, "Type /bkc to clear your backup request.");
					SetTimerEx("BackupClear", 200000, false, "ii", playerid, 1);
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "You already have an active backup request!");
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "You are not a cop!");
			}
		}
		return 1;
	}


Thanks in advance to anyone that can help.
Reply
#2

Post in the godfather topic.. not everyone here has seen/looks at the GF script.
Reply
#3

Quote:
Originally Posted by efeX
Post in the godfather topic.. not everyone here has seen/looks at the GF script.
It isn't GF.
Reply
#4

Either way

if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)


So pMember = faction id?

that should work then.
Reply
#5

Yes, but for some reason the text and the playermarker shows up for everyone online, not just those 2 factions.
Reply
#6

oh duh.

Код:
if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1 || PlayerInfo[i][pMember] == 2 || PlayerInfo[i][pLeader] == 2)
Reply
#7

The marker still shows up for everyone.
Reply
#8

Try && instead of ||
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)