How to enter to interior with 'Enter' ?
#1

I verry need this in RolePlay. Very thanks who help me
Reply
#2

Add DisableInteriorEnterExits(); to OnGameModeInit, Create a pickup where you want a player to enter an interior.

Example:
pawn Код:
new pickup;

public OnGameModeInit()
{
    DisableInteriorEnterExits();
    pickup = CreatePickup(1239, 23, 3000, 3000, 3000, 0);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == pickup)
  {
    SetPlayerInterior(playerid, 1);
    SetPlayerPos(playerid, 3000, 3000, 3000);
  }
  return 1;
}
Also can work with checkpoints but in my opinion for someone new to pawn, pickups could be easier. And not to mention look a lot better.

Reply
#3

This is when you enter in pickup you enter in the iterior... I need when click 'Enter' entering you to interior
Reply
#4

Quote:
Originally Posted by povilaslt2
This is when you enter in pickup you enter in the iterior... I need when click 'Enter' entering you to interior
Oh so a dialog box?
Reply
#5

Yea
Reply
#6

No. Key Detecting.

Код:
#define KEY_ENTER 16
#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if (PRESSED(KEY_ENTER))
	{
        if(IsPlayerInRangeOfPoint(..))
        {
		   SetPlayerPos(..);
           SetPlayerInterior(...);
        }
	}
	return 1;
}
Reply
#7

This in gamemode or filtersrcipt?
Reply
#8

gamemode
Reply
#9

I have this error:
C:\Users\Donatas\Desktop\KGRP\gamemodes\KGRP.pwn(4 3916) : error 010: invalid function or declaration
C:\Users\Donatas\Desktop\KGRP\gamemodes\KGRP.pwn(4 391 : error 010: invalid function or declaration
C:\Users\Donatas\Desktop\KGRP\gamemodes\KGRP.pwn(4 3924) : error 010: invalid function or declaration
Reply
#10

Can you give me the file?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)