Entrance Help
#1

Before I start this, I would like to say Hello, Im a new scripter and hope to script my own server soon

Alrighty so heres my problem, Im attempting to make a enterance to a door, but it only seems to work in only one specific spot (Ex. Jizzy's club only, or the Police Department), So if you guys can, might you show me how to make many entrances? Thanks!


public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/enter", cmdtext, true, 6) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,3.0, -2624.3667,1411.8839,7.0938 ))
{
SetPlayerPos(playerid,-2640.762939,1406.682006,906.460937);
SetPlayerInterior(playerid, 3);
SetPlayerFacingAngle(playerid, 90.9048 );
SetCameraBehindPlayer(playerid);
}
else SendClientMessage(playerid, COLOR_WHITE, "You need to be near an entrance!");
}
return 1;
}
//This is the one that does not work, even If I change the Coordinates.
if(strcmp("/enter", cmdtext, true, 6) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,3.0, -2624.3667,1411.8839,7.0938 ))
{
SetPlayerPos(playerid,-2640.762939,1406.682006,906.460937);
SetPlayerInterior(playerid, 3);
SetPlayerFacingAngle(playerid, 90.9048 );
SetCameraBehindPlayer(playerid);
}
else SendClientMessage(playerid, COLOR_WHITE, "You need to be near an entrance!");
}
return 1;
}
if(strcmp("/exit", cmdtext, true, 5) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,5.0, -2640.762939,1406.682006,906.460937))
{
SetPlayerPos(playerid,-2624.3667,1411.8839,7.0938 );
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 195.0774);
SetCameraBehindPlayer(playerid);
}
else SendClientMessage(playerid, COLOR_WHITE, "You need to be near an exit!");
}
return 1;
}
Reply
#2

Shouldn't you make like /enter2 because /enter already exists?
Am a beginner too :P
Reply
#3

Well Not all servers are like that, If i want like 50 doors, you wouldnt expect for players to try all 50 /enter's would you?
Reply
#4

pawn Code:
if(strcmp("/enter", cmdtext, true, 6) == 0)
{
   if(IsPlayerConnected(playerid))
   {
      if(IsPlayerInRangeOfPoint(playerid,3.0, -2624.3667,1411.8839,7.0938 ))
      {
         SetPlayerPos(playerid,-2640.762939,1406.682006,906.460937);
         SetPlayerInterior(playerid, 3);
         SetPlayerFacingAngle(playerid, 90.9048 );
         SetCameraBehindPlayer(playerid);
      }
      else if(IsPlayerInRangeOfPoint(playerid,3.0, -2624.3667,1411.8839,7.0938 ))
      {
         SetPlayerPos(playerid,-2640.762939,1406.682006,906.460937);
         SetPlayerInterior(playerid, 3);
         SetPlayerFacingAngle(playerid, 90.9048 );
         SetCameraBehindPlayer(playerid);
      }
      else SendClientMessage(playerid, COLOR_WHITE, "You need to be near an entrance!");
   }  
   return 1;
}
Reply
#5

Yeah I know what you mean.

Number the sequence each time.. set it with a different number, I don't exactly know how though..
And thanks, you gave me an idea how to do a pickup etc (no copy no worries)
Reply
#6

No Problem Karol, and Thank you CmZxC!!!! REP+ for you!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)