Help with food interiors
#1

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?
Reply
#2

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;
Reply
#3

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?
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)