SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 30/03/2010, 10:37 AM   #1
povilaslt2
Little Clucker
 
Join Date: Apr 2009
Posts: 39
Reputation: 0
Default How to enter to interior with 'Enter' ?

I verry need this in RolePlay. Very thanks who help me
povilaslt2 is offline  
Old 30/03/2010, 11:02 AM   #2
V1ceC1ty
Banned
 
Join Date: Oct 2008
Location: West Australia
Posts: 1,909
Reputation: 273
Default Re: How to enter to interior with 'Enter' ?

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

Example:
pawn Code:
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.

V1ceC1ty is offline  
Old 30/03/2010, 11:09 AM   #3
povilaslt2
Little Clucker
 
Join Date: Apr 2009
Posts: 39
Reputation: 0
Default Re: How to enter to interior with 'Enter' ?

This is when you enter in pickup you enter in the iterior... I need when click 'Enter' entering you to interior
povilaslt2 is offline  
Old 30/03/2010, 11:12 AM   #4
V1ceC1ty
Banned
 
Join Date: Oct 2008
Location: West Australia
Posts: 1,909
Reputation: 273
Default Re: How to enter to interior with 'Enter' ?

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?
V1ceC1ty is offline  
Old 30/03/2010, 11:22 AM   #5
povilaslt2
Little Clucker
 
Join Date: Apr 2009
Posts: 39
Reputation: 0
Default Re: How to enter to interior with 'Enter' ?

Yea
povilaslt2 is offline  
Old 30/03/2010, 11:24 AM   #6
Naruto4
Huge Clucker
 
Join Date: May 2009
Posts: 234
Reputation: 0
Default Re: How to enter to interior with 'Enter' ?

No. Key Detecting.

Code:
#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;
}
Naruto4 is offline  
Old 30/03/2010, 11:37 AM   #7
povilaslt2
Little Clucker
 
Join Date: Apr 2009
Posts: 39
Reputation: 0
Default Re: How to enter to interior with 'Enter' ?

This in gamemode or filtersrcipt?
povilaslt2 is offline  
Old 30/03/2010, 11:38 AM   #8
Naruto4
Huge Clucker
 
Join Date: May 2009
Posts: 234
Reputation: 0
Default Re: How to enter to interior with 'Enter' ?

gamemode
Naruto4 is offline  
Old 30/03/2010, 11:46 AM   #9
povilaslt2
Little Clucker
 
Join Date: Apr 2009
Posts: 39
Reputation: 0
Default Re: How to enter to interior with 'Enter' ?

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
povilaslt2 is offline  
Old 30/03/2010, 12:12 PM   #10
povilaslt2
Little Clucker
 
Join Date: Apr 2009
Posts: 39
Reputation: 0
Default Re: How to enter to interior with 'Enter' ?

Can you give me the file?
povilaslt2 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interior Enter/Exit Brian_Furios Help Archive 3 27/03/2010 07:33 PM
Automatically enter interior [GTA] Help Archive 13 15/11/2009 09:31 AM
Re-Enable Interior Enter / Exits at GMX Redirect Left Help Archive 2 11/11/2009 05:56 PM
how to create an /exit and /enter command to enter an costum interior? sandisk125 Help Archive 5 18/08/2009 02:07 PM


All times are GMT. The time now is 11:23 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.