help to fix mistake i make on /backup cmd :s
#1

h, the things going like this...

when member of pd, fbi and national guard type /bk all in this teams see who need backup and where is his location, but when leaders type /bk he get message you are not PD FBI OR NG ( national guard)

here is code i cant find nothing :S

Код:
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)
				{
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "ALL UNITS: %s NEED BACKUP, HIS LOCATION IS MARK 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 CALL.");
					SetTimerEx("BackupClear", 180000, false, "ii", playerid, 1);
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "YOU ALREADY CALL FOR BACKUP!");
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "NOT A COP, FBI OR NG!");
			}
		}
		return 1;
	}
 if(strcmp(cmd,"/backupclear",true)==0 || strcmp(cmd,"/bkc",true)==0)
	{
		BackupClear(playerid, 0);
		return 1;
	}
CAN YOU HELP ME TO FIX THIS ((( TNX ALOT
Reply
#2

Did your leaders have to join a group before becoming a leader?It's possible they are leaders but not members?
Reply
#3

It's your if statement, and the conditions of it...

Here's what it does...


If(member or leader of PD AND member or leader of FBI AND member or leader of NG...)

Where it should be OR OR OR OR OR all the way through.
Reply
#4

so what to edit?
Reply
#5

you mean && change to this => ||
Reply
#6

Thats the one...

change it to || all through that statement, only on that one line.

You'll have better joy.
Reply
#7

put error u have ill help you
Reply
#8

Quote:
Originally Posted by UserName31
Посмотреть сообщение
put error u have ill help you
Quote:
Originally Posted by Topic Creation Date
08/12/2009, 06:31 AM
Please don't bump old topics.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)