Multiple enter/exit commands
#1

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?
Reply
#2

Please help!
Reply
#3

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

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...
Reply
#5

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)