Is this right?
#1

Код:
  if (strcmp("/enter", cmdtext, true) == 0)
	{
	SetPlayerPos(playerid, 4060.2734,-196.4038,59.2456); // Hospital, ID 0!
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid, 375.962463,-65.816848,1001.507812); // Burger Shot, ID 10!
	SetPlayerInterior(	playerid, 10);
	return 1;
	}
When i do /enter at the Hospital it just TP's me to the Burger shot?
Reply
#2

You're telling it to move to 2 places. First the hospital, then the Burger shot. Use IsPlayerInRangeOfPoint.

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

e.g.

pawn Код:
if(!strcmp("/stadium",cmdtext))
{
  if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438))
  {
    SendClientMessage(playerid,0xFFFFFFFF,"You are near the Stadium entrance!");
  }
  else
  {
    SendClientMessage(playerid,0xFFFFFFFF,"You are not near the Stadium entrance!");
  }
  return 1;
}
Reply
#3

Because the SetPlayerInterior(playerid, 0(wrong id)) is wrong
find the one that your looking for here
https://sampwiki.blast.hk/wiki/InteriorIDs
or here
http://weedarr.wikidot.com/interior

Oh w8, so you must /enter whenever you are near a checkpoint of the building?
Reply
#4

Quote:
Originally Posted by Ragidon
You're telling it to move to 2 places. First the hospital, then the Burger shot. Use IsPlayerInRangeOfPoint.

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

e.g.

pawn Код:
if(!strcmp("/stadium",cmdtext))
{
  if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438))
  {
    SendClientMessage(playerid,0xFFFFFFFF,"You are near the Stadium entrance!");
  }
  else
  {
    SendClientMessage(playerid,0xFFFFFFFF,"You are not near the Stadium entrance!");
  }
  return 1;
}
Okay, I dont actually get what you mean?
Reply
#5

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Because the SetPlayerInterior(playerid, 0(wrong id)) is wrong
find the one that your looking for here
https://sampwiki.blast.hk/wiki/InteriorIDs
or here
http://weedarr.wikidot.com/interior

Oh w8, so you must /enter whenever you are near a checkpoint of the building?
Yes.
Reply
#6

Bump?
Reply
#7

Sorry but I don't know these sort of things
But it will be a lot easier if you make it OnPlayerEnterCheckPoint
without the command
Reply
#8

Its putting you in burger shot because your doing this:

Your setting the players pos to coordinates for the hospital, You then change the interior for hospital. ID 0
Then after all that you set the players pos to coordinates for burger short, You then change the interior for burger shot. ID 10

So your putting the player in hospital and then as soon as thats done it puts you in burgershot, Use IsPlayerInRangeOfPoint to check if player is near a burger shot enterance or hospital
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)