SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 09/05/2018, 10:15 PM   #1
1sbedx
Big Clucker
 
1sbedx's Avatar
 
Join Date: Dec 2015
Posts: 148
Reputation: 21
Default entrance.inc - Create interiors easily

Description:
With this include, you can create interiors quickly and easily.

Functions:
PHP Code:
Entrance:CreateEntrance(name[], Float:out_xFloat:out_yFloat:out_zFloat:out_aout_iout_vFloat:in_xFloat:in_yFloat:in_zFloat:in_ain_iin_v
- Creates an entrance.

PHP Code:
GetEntranceName(Entrance:indexname[], length sizeof(name)) 
- Gets the name of the entrance.

PHP Code:
IsPlayerInRangeOfEntrance(playeridEntrance:indexFloat:range 3.0
- Checks if the player is near an entrance.

PHP Code:
IsPlayerInEntrance(playeridEntrance:indexFloat:range 20.0
- Checks if the player is inside an entrance.

PHP Code:
GetPlayerClosestEntranceID(playeridFloat:range 3.0
- Gets the closest entrance from the player.

Example:
PHP Code:
new Entrance:CityHall

public 
OnFilterScriptInit() 

    
CityHall CreateEntrance("Los Santos City Hall"1481.0654, -1771.875518.7958356.383800390.1687173.80721008.382890.0000369); 
    return 
1


public 
OnPlayerEnterEntrance(playeridEntrance:entranceid

    if (
entranceid == CityHall
    { 
        
SendClientMessage(playerid, -1"Welcome to City Hall."); 
    } 
    return 
1


public 
OnPlayerExitEntrance(playeridEntrance:entranceid

    if (
entranceid == CityHall
    { 
        
SendClientMessage(playerid, -1"You left City Hall."); 
    } 
    return 
1

Pastebin

Last edited by 1sbedx; 10/05/2018 at 06:29 PM.
1sbedx is offline   Reply With Quote
Old 10/05/2018, 07:32 AM   #2
NewFreeroamStunt
Banned
 
Join Date: May 2017
Location: Indonesia
Posts: 61
Reputation: 2
Default Re: entrance.inc - Create interiors easily

Nice!
NewFreeroamStunt is offline   Reply With Quote
Old 10/05/2018, 01:15 PM   #3
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,928
Reputation: 256
Default Re: entrance.inc - Create interiors easily

Can you provide a pastebin or any other website that allow you to share directly the source code?
******* ; no thanks.
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 10/05/2018, 06:11 PM   #4
CrystalGamer
Banned
 
Join Date: Apr 2018
Posts: 52
Reputation: 2
Default Re: entrance.inc - Create interiors easily

Quote:
Originally Posted by Dayrion View Post
Can you provide a pastebin or any other website that allow you to share directly the source code?
******* ; no thanks.
btw their is already as i see
CrystalGamer is offline   Reply With Quote
Old 11/05/2018, 12:09 AM   #5
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,426
Reputation: 1241
Default Re: entrance.inc - Create interiors easily

Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if ((newkeys & KEY_SECONDARY_ATTACK))
    {
        for (new Entrance:i; i < gTotalEntrances; i ++)
        {
            if (IsPlayerInRangeOfEntrance(playerid, i))
            {
You are using the streamer but not using the streamer at the same time let it do the work for you and use dynamic areas to detect when a player enters them. You can set the extraid to reference the teleport data array no more looping.

Your system is a start but lacks completion at this time. Fix it.
Pottus is offline   Reply With Quote
Reply

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
Help How to create entrance for only vip Ayyash Scripting Help 11 05/03/2017 08:53 AM
[Include] rTurret - Easily create interactive turrets! Corekt Includes 25 18/07/2015 09:52 PM
Entrance point to interiors on new script MrViolence101 Scripting Help 2 09/12/2014 10:29 PM
[Include] k_target - Create a target easily [0.3Z] kadaradam Includes 5 25/01/2014 08:24 PM
[Include] CreateVehicleForPlayer - Use Names to create vehicles, Easily. iPLEOMAX Includes 29 28/06/2012 11:59 AM


All times are GMT. The time now is 06:27 PM.


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