new duty area
#1

Код:
if(strcmp(cmd, "/duty", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
			{
				if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerInfo[playerid][pLocal] != 255)
				{
					if(OnDuty[playerid]==0)
			    {
			      if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
			      {
				  		format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
						}
						else if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
			      {
				  		format(string, sizeof(string), "* Agent %s took a Badge and a Gun from his locker.", sendername);
						}
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						SafeGivePlayerWeapon(playerid, 24, 70);
						SafeGivePlayerWeapon(playerid, 3, 0);
						SetPlayerArmour(playerid, 100);
						OnDuty[playerid] = 1;
					}
					else if(OnDuty[playerid]==1)
					{
					  if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
					  {
							format(string, sizeof(string), "* Officer %s places his Badge and Gun in his locker.", sendername);
						}
						else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
						{
						  format(string, sizeof(string), "* Agent %s places his Badge and Gun in his locker.", sendername);
						}
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						SafeResetPlayerWeapons(playerid);
						SetPlayerArmour(playerid, 0);
						SafeGivePlayerWeapon(playerid, 41, 500);
						OnDuty[playerid] = 0;
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD2, "  You are not in a locker room !");
					return 1;
				}
			}
			else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
			{
			  if(JobDuty[playerid] == 1)
			  {
			    SendClientMessage(playerid, COLOR_WHITE, "* You are now Off Duty from your Medic Job and will not receive calls anymore.");
			    JobDuty[playerid] = 0;
			    Medics -= 1;
			  }
			  else
			  {
			    SendClientMessage(playerid, COLOR_WHITE, "* You are now On Duty with your Medic Job and will receive calls from people in need.");
			    JobDuty[playerid] = 1;
			    Medics += 1;
			    GetPlayerName(playerid,sendername,sizeof(sendername));
  					format(string, sizeof(string), "[Advert] Paramedic %s is On Duty, /call 911.", sendername);
	  			OOCNews(COLOR_ALLDEPT,string);
			  }
			}
			else if(PlayerInfo[playerid][pJob] == 17)
  			{
    			if(JobDuty[playerid] == 1)
    			{
      			SendClientMessage(playerid, COLOR_WHITE, "* You are now Off Duty from your Pizza Delivery Job and will not receive calls anymore.");
      			JobDuty[playerid] = 0;
      			PizzaBoys -= 1;
    			}
    			else
    			{
      			SendClientMessage(playerid, COLOR_WHITE, "* You are now On Duty with your Pizza Delivery Job and will receive calls from people in need.");
      			JobDuty[playerid] = 1;
    			PizzaBoys += 1;
    			GetPlayerName(playerid,sendername,sizeof(sendername));
  					format(string, sizeof(string), "[Advert] Well stacked pizza worker %s is now On Duty, /call 111 to order a pizza.", sendername);
	  			OOCNews(0xFF7E00AA,string);
				}
			}
			else if(PlayerInfo[playerid][pJob] == 7)
			{
			  if(JobDuty[playerid] == 1)
			  {
			    SendClientMessage(playerid, COLOR_WHITE, "* You are now Off Duty from your Car Mechanic Job and will not receive calls anymore.");
			    JobDuty[playerid] = 0;
			    Mechanics -= 1;
			  }
			  else
			  {
			    SendClientMessage(playerid, COLOR_WHITE, "* You are now On Duty with your Car Mechanic Job and will receive calls from people in need.");
			    JobDuty[playerid] = 1;
			    Mechanics += 1;
			    GetPlayerName(playerid,sendername,sizeof(sendername));
  					format(string, sizeof(string), "[Advert] Car mechanic %s is now On Duty, /call 555 to call a mechanic.", sendername);
	  			OOCNews(0x2993EDAA,string);
			  }
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GRAD1, "  You are not a Cop !");
			}
		}
		return 1;
Hi all would any one beable to tell me where i would beable to add a second point where you can do /duty as i have a lspd building and a fbi building.
Many thanks
Reply
#2

Код:
if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(3,playerid,NEW X, NEW Y, NEW Z) || PlayerInfo[playerid][pLocal] != 255)
put the coords by yourself into "NEW X .... "
Reply
#3

i need it in the same command as the 3rd factions (lspd,fbi,nataional gaurd) are all linked up or do you mean add enough one of the same below it
Reply
#4

Go ingame and stand there where you want the /duty to be, then type /save /duty and then open up your rockstar folder and go into the file called savedpositions, then take the latest one and then put it in there, if you dont know how PM me or post it here then people would help you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)