/enter & /exit
#1

Hello again.

I've made two commands, /enter and /exit.
/enter - works fine, what it does, it sets your interior and teleports you to a 24/7 shop.
/exit - does not work very well, it doesn't want me to teleport back. Althought, I don't get any errors.

So, here's the code.

pawn Код:
if(!strcmp("/enter", cmdtext, true))
  {
  if(IsPlayerInRangeOfPoint(playerid, 7.0, -2034.5068,148.5365,28.8359))
   {
    SetPlayerPos(playerid, -27.312300, -29.277599, 1003.549988);
    SetPlayerInterior(playerid, 4);
   }
  }
  if(!strcmp("/exit", cmdtext, true))
  {
  if(IsPlayerInRangeOfPoint(playerid, 7.0, -27.312300, -29.277599, 1003.549988))
   {
    SetPlayerPos(playerid, -2034.5068,148.5365,28.8359);
    SetPlayerInterior(playerid, 0);
   }
  }
Thanks in advance.

dLu
Reply
#2

pawn Код:
if(!strcmp("/enter", cmdtext, true))
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0, -2034.5068,148.5365,28.8359))
    {
        SetPlayerPos(playerid, -27.312300, -29.277599, 1003.549988);
        SetPlayerInterior(playerid, 4);
    }

    return 1; // Add this return 1; exactly in your /exit command too.
}
Reply
#3

If you mean something like this:
pawn Код:
if(!strcmp("/enter", cmdtext, true))
  {
  if(IsPlayerInRangeOfPoint(playerid, 7.0, -2034.5068,148.5365,28.8359))
   {
    SetPlayerPos(playerid, -27.312300, -29.277599, 1003.549988);
    SetPlayerInterior(playerid, 4);
   }
   return 1;
  }
  if(!strcmp("/exit", cmdtext, true))
  {
  if(IsPlayerInRangeOfPoint(playerid, 20.0, -27.312300, -29.277599, 1003.549988))
   {
    SetPlayerPos(playerid, -2034.5068,148.5365,28.8359);
    SetPlayerInterior(playerid, 0);
   }
   return 1;
  }
  return 1;
}
Then no, it's not working.
But thanks anyway !!
Reply
#4

Works fine for me...
Reply
#5

LOL why you dont see TUTORIALS section and search for teleports?

I think you find anithing


TRY THAT
Reply
#6

Scripter123, it is apparently against peoples morals to use search or to look around the forums or the wiki for answers.

/slap
Reply
#7

Well, I did use the search function, but there were 11 pages and I went through only 2 pages
Anyways, it's not working for me
Can anyone check if it's working for them, I did it exactly like in the tutorial, but not working. Here's my code.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/enter", cmdtext, true, 6) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 7, -2034.5068,148.5365,28.8359))
     {
    SetPlayerPos(playerid, -27.312300, -29.277599, 1003.549988);
    SetPlayerInterior(playerid, 4);
    return 1;
     }
    }
   
    if(strcmp("/exit", cmdtext, true, 6) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 7, -27.312300, -29.277599, 1003.549988))
     {
     SetPlayerPos(playerid, -2034.5068,148.5365,28.8359);
     return 1;
     }
    }
    return 1;
}
If anyone can check if it's working for them.
The /enter command is at the CJ's garage in San Fierro, the one near the train station and Wang car shop.
Or just make a tp command if you want.
SetPlayerPos(playerid, -2034.5068,148.5365,28.8359);

/enter command works great, but the /exit doesn't.
Reply
#8

Try to set the Virtual Worlds like :

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/enter", cmdtext, true, 6) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 7, -2034.5068,148.5365,28.8359))
     {
    SetPlayerPos(playerid, -27.312300, -29.277599, 1003.549988);
    SetPlayerInterior(playerid, 4);
    SetPlayerVirtualWorld(playerid,1);
    return 1;
     }
    }
   
    if(strcmp("/exit", cmdtext, true, 6) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 7, -27.312300, -29.277599, 1003.549988))
     {
     SetPlayerPos(playerid, -2034.5068,148.5365,28.8359);
     SetPlayerInterior(playerid, 0);
     SetPlayerVirtualWorld(playerid,0);
     }
    }
    return 1;
}
Or Try:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/enter", cmdtext, true, 6) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 7, -2034.5068,148.5365,28.8359))
     {
    SetPlayerPos(playerid, -27.312300, -29.277599, 1003.549988);
    SetPlayerInterior(playerid, 4);
    SetPlayerVirtualWorld(playerid,1);
    
     }
     return 1;
    }
   
    if(strcmp("/exit", cmdtext, true, 6) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 7, -27.312300, -29.277599, 1003.549988))
     {
     SetPlayerPos(playerid, -2034.5068,148.5365,28.8359);
     SetPlayerInterior(playerid, 0);
     SetPlayerVirtualWorld(playerid,0);
     }
    return 1;
    }
    return 1;
}
Reply
#9

Maybe some more identation would be nice to.
Reply
#10

Quote:
Originally Posted by USAAF~COMMANDER
Посмотреть сообщение
Yeah it maybe, but im finding somethig cool !

http://sanforum.comuv.com
Kay, and whats so cool about an SMF forum?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)