/exit help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /exit help (
/showthread.php?tid=287926)
/exit help -
needhack - 05.10.2011
Hello there.
I am working on my own server and with help of a tutorial I made an /enter and /exit script.
/enter works perfectly. But /exit does absolutely nothing.
Here's the script:
pawn Код:
if(strcmp("/enter", cmdtext, true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,2.0, -217.7940,979.1616,19.5038)) // change X Y Z coords
{
SetPlayerPos(playerid, 246.783996,63.900199,1003.640625); // change X Y Z coords
SetPlayerInterior(playerid,6); //change the interior.
}
else
{
SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the entrance to enter!");
}
}
return 1;
}
if(strcmp("/exit", cmdtext, true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,2.0, 246.783996,63.900199,1003.640625)) // change X Y Z coords
{
SetPlayerPos(playerid, -217.7940,979.1616,19.5038); // change X Y Z coords
}
else
{
SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the entrance to exit!");
}
}
return 1;
}
Help would be appreciated since I'm stuck here!
Re: /exit help -
aRoach - 05.10.2011
Because the Exit Command doesn't Return true xDD(
return 1; )
PS: Use [pawn ] [ /pawn] Without Spaces for the Code
Re: /exit help -
needhack - 05.10.2011
What do you mean by that?
Re: /exit help -
Kingunit - 05.10.2011
Are you sure you are at the correct range?
Re: /exit help -
aRoach - 05.10.2011
Try this :
pawn Код:
if(strcmp("/exit", cmdtext, true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,3.0, 246.783996,63.900199,1003.640625)) // change X Y Z coords
{
SetPlayerPos(playerid, -217.7940,979.1616,19.5038); // change X Y Z coords
}
else SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the entrance to exit!");
}
return 1;
}
Re: /exit help -
needhack - 05.10.2011
Quote:
Originally Posted by Kingunit
Are you sure you are at the correct range?
|
Yes, I'm sure.
Re: /exit help -
jamesbond007 - 05.10.2011
dont forget to set SetPlayerInterior(playerid, 0); on exit ^^
Re: /exit help -
needhack - 05.10.2011
Quote:
Originally Posted by aRoach
Try this :
pawn Код:
if(strcmp("/exit", cmdtext, true) == 0) { if(IsPlayerConnected(playerid)) { if(IsPlayerInRangeOfPoint(playerid,3.0, 246.783996,63.900199,1003.640625)) // change X Y Z coords { SetPlayerPos(playerid, -217.7940,979.1616,19.5038); // change X Y Z coords } else SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the entrance to exit!"); } return 1; }
|
Quote:
Originally Posted by jamesbond007
dont forget to set SetPlayerInterior(playerid, 0); on exit ^^
|
Tried - Doesn't work
Re: /exit help -
jamesbond007 - 05.10.2011
well its not an option u have to put it anyway, but maybe u have another /exit command in your gm or fs
Re: /exit help -
needhack - 05.10.2011
Quote:
Originally Posted by jamesbond007
well its not an option u have to put it anyway, but maybe u have another /exit command in your gm or fs
|
Nope, it's my only /exit command.
I just double checked the script and it all looks legit.
I got the interior coordinates from LSPD, enter works but exit which is supposed to bring you back where you type /enter does not.