/enter & /exit -
dLu - 25.10.2010
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
Re: /enter & /exit -
BMUK - 25.10.2010
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.
}
Re: /enter & /exit -
dLu - 25.10.2010
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 !!
Re: /enter & /exit -
BMUK - 25.10.2010
Works fine for me...
Re: /enter & /exit -
Scripter123 - 25.10.2010
LOL why you dont see TUTORIALS section and search for teleports?
I think you find anithing
TRY THAT
Re: /enter & /exit -
BMUK - 25.10.2010
Scripter123, it is apparently against peoples morals to use search or to look around the forums or the wiki for answers.
/slap
Re: /enter & /exit -
dLu - 26.10.2010
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.
Re: /enter & /exit -
SkizzoTrick - 26.10.2010
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;
}
Re: /enter & /exit -
Jochemd - 26.10.2010
Maybe some more identation would be nice to.
Re: /enter & /exit -
Cameltoe - 26.10.2010
Quote:
Originally Posted by USAAF~COMMANDER
|
Kay, and whats so cool about an SMF forum?