SA-MP Forums Archive
Multiple enter/exit commands - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Multiple enter/exit commands (/showthread.php?tid=151872)



Multiple enter/exit commands - Luis- - 01.06.2010

Hello again, HOw can i can multiple enter and exit commands?

Код:
	if (strcmp("/enter", cmdtext, true) == 0)
	{
		SetPlayerPos(playerid, 1169.1206,-1330.0065,1386.4193);
		return 1;
		}
		else
		{
		SendClientMessage(playerid, COLOR_BLUE, "You are not at the entrance to any building!");
		}
	if (strcmp("exit", cmdtext, true) == 0)
	{
	  SetPlayerPos(playerid, 1172.6040,-1325.2792,15.4032);
	  return 1;
	}
Can you show me were to enter them?


Re: Multiple enter/exit commands - Luis- - 01.06.2010

Please help!


Re: Multiple enter/exit commands - IanDaCJ - 01.06.2010

if u mean in like which callback its under:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])



Re: Multiple enter/exit commands - Luis- - 01.06.2010

I have is there

pawn Код:
public OnPlayerCommandText (playerid, cmdtext[])
{
    if (strcmp("/enter", cmdtext, true) == 0)
    {
        SetPlayerPos(playerid, 1169.1206,-1330.0065,1386.4193);
        return 1;
        SetPlayerPos(playerid, 288.745971,169.350997,1007.171875);
        return 1;
        }
        else
        {
        SendClientMessage(playerid, COLOR_BLUE, "You are not at the entrance to any building!");
        }
    if (strcmp("exit", cmdtext, true) == 0)
    {
      SetPlayerPos(playerid, 1172.6040,-1325.2792,15.4032);
      return 1;
      SetPlayerPos(playerid, 1554.7692,-1676.1294,16.1953);
    }
I wanted to know how to make one to enter the Hospital and one to the PD etc...


Re: Multiple enter/exit commands - Luis- - 01.06.2010

I just need to know how to have one enterence at the Hospital and another at the PD?


Re: Multiple enter/exit commands - Fj0rtizFredde - 01.06.2010

You can use IsPlayerInRangeOfPoint
like this:
pawn Код:
if (strcmp("/enter", cmdtext, true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z)) //Like the lspd door
{
SetPlayerPos(playerid, 1169.1206,-1330.0065,1386.4193); //set the pos
}
else if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z)) //some other place
{
SetPlayerPos(playerid, 288.745971,169.350997,1007.171875); //teleport him to the location
}
return 1;
}