SA-MP Forums Archive
Help with food interiors - 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 with food interiors (/showthread.php?tid=86327)



Help with food interiors - Mr_Finnigan - 13.07.2009

So i disabled yellow markers and want to make 2 Cluckin Bells/2 Pizza Stack/2 Burger Shot in San Fierro still accessible with red markers at door and red markers inside so you pay 10$ to heal completely.Ive done all that quite easily.

My question is,when people enter say Cluckin Bell for example,it doesnt matter if 2 players went into seprerate locations they would end up in same interior and see each other,thats ok but when they leave via red marker is there a way to make it so they both end up outside the location they entered?


Re: Help with food interiors - Weirdosport - 13.07.2009

You'd have to store in a variable which one they entered. For example:

pawn Код:
new Entered[MAX_PLAYERS];

//When player enters a "1"
Entered[playerid] = 1;

//When player enters a "2"
Entered[playerid] = 2;

//When player goes to leave:
If(Entered(playerid) == 1) // put outside 1
else //put outside 2
Entered[playerid] = 0;



Re: Help with food interiors - Mr_Finnigan - 13.07.2009

Quote:
Originally Posted by Weirdosport
You'd have to store in a variable which one they entered. For example:

pawn Код:
new Entered[MAX_PLAYERS];

//When player enters a "1"
Entered[playerid] = 1;

//When player enters a "2"
Entered[playerid] = 2;

//When player goes to leave:
If(Entered(playerid) == 1) // put outside 1
else //put outside 2
Entered[playerid] = 0;
Thankyou,
Код:
new Entered[MAX_PLAYERS];
I know the new goes at the top but where does the rest go,on onplayerentercheckpoint with my original code?
Like for example this is my code for Cluckin Bell 1 near ammunation
Код:
cp1 = CreateCheckpoint(-2672.1492,258.8858,4.6328, 1.5);
then
Код:
if(cpid == cp1)
  {

  SetPlayerPos(playerid,366.3479,-9.3643,1001.8516);
  SetPlayerInterior(playerid, 9);
  }
So do i reword that to make it so people entering that specific location also exit outside of it?


Re: Help with food interiors - Mr_Finnigan - 13.07.2009

Quote:
Originally Posted by Weirdosport
You'd have to store in a variable which one they entered. For example:

pawn Код:
new Entered[MAX_PLAYERS];

//When player enters a "1"
Entered[playerid] = 1;

//When player enters a "2"
Entered[playerid] = 2;

//When player goes to leave:
If(Entered(playerid) == 1) // put outside 1
else //put outside 2
Entered[playerid] = 0;
Thank You sooo much

This under OnPlayerEnterCheckpoint
Код:
if(cpid == cp1)
  {
  if (Entered[playerid] == 1)
  SetPlayerPos(playerid,-2672.3108,261.7402,4.6328);
  SetPlayerInterior(playerid, 0);
  if (Entered[playerid] == 2)
  SetPlayerPos(playerid,-1815.0565,615.7675,35.1719);
  SetPlayerInterior(playerid, 0);
With this on top of script
Код:
new Entered[MAX_PLAYERS];
Worked,now when i enter cluckin near ammu i exit back outside same one,and when i enter cluckin near swat yard i exit backoutside that one,you really helped me Wierdosport,thanks