SA-MP Forums Archive
help to fix mistake i make on /backup cmd :s - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help to fix mistake i make on /backup cmd :s (/showthread.php?tid=112479)



help to fix mistake i make on /backup cmd :s - buonggiorno - 08.12.2009

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


Re: help to fix mistake i make on /backup cmd :s - DJDhan - 08.12.2009

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


Re: help to fix mistake i make on /backup cmd :s - Sew_Sumi - 08.12.2009

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.


Re: help to fix mistake i make on /backup cmd :s - buonggiorno - 08.12.2009

so what to edit?


Re: help to fix mistake i make on /backup cmd :s - buonggiorno - 08.12.2009

you mean && change to this => ||


Re: help to fix mistake i make on /backup cmd :s - Sew_Sumi - 13.12.2009

Thats the one...

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

You'll have better joy.


Re: help to fix mistake i make on /backup cmd :s - UserName31 - 02.08.2011

put error u have ill help you


Re: help to fix mistake i make on /backup cmd :s - iPLEOMAX - 02.08.2011

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.