SA-MP Forums Archive
[Include] entrance.inc - Create interiors easily - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] entrance.inc - Create interiors easily (/showthread.php?tid=653674)



entrance.inc - Create interiors easily - 1sbedx - 09.05.2018

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

Functions:
PHP код:
Entrance:CreateEntrance(name[], Float:out_x, Float:out_y, Float:out_z, Float:out_a, out_i, out_v, Float:in_x, Float:in_y, Float:in_z, Float:in_a, in_i, in_v) 
- Creates an entrance.

PHP код:
GetEntranceName(Entrance:index, name[], length = sizeof(name)) 
- Gets the name of the entrance.

PHP код:
IsPlayerInRangeOfEntrance(playerid, Entrance:index, Float:range = 3.0) 
- Checks if the player is near an entrance.

PHP код:
IsPlayerInEntrance(playerid, Entrance:index, Float:range = 20.0) 
- Checks if the player is inside an entrance.

PHP код:
GetPlayerClosestEntranceID(playerid, Float:range = 3.0) 
- Gets the closest entrance from the player.

Example:
PHP код:
new Entrance:CityHall; 
public 
OnFilterScriptInit() 
{ 
    
CityHall = CreateEntrance("Los Santos City Hall", 1481.0654, -1771.8755, 18.7958, 356.3838, 0, 0, 390.1687, 173.8072, 1008.3828, 90.0000, 3, 69); 
    return 
1; 
} 
public 
OnPlayerEnterEntrance(playerid, Entrance:entranceid) 
{ 
    if (
entranceid == CityHall) 
    { 
        
SendClientMessage(playerid, -1, "Welcome to City Hall."); 
    } 
    return 
1; 
} 
public 
OnPlayerExitEntrance(playerid, Entrance:entranceid) 
{ 
    if (
entranceid == CityHall) 
    { 
        
SendClientMessage(playerid, -1, "You left City Hall."); 
    } 
    return 
1; 
} 
Pastebin


Re: entrance.inc - Create interiors easily - NewFreeroamStunt - 10.05.2018

Nice!


Re: entrance.inc - Create interiors easily - Dayrion - 10.05.2018

Can you provide a pastebin or any other website that allow you to share directly the source code?
******* ; no thanks.


Re: entrance.inc - Create interiors easily - CrystalGamer - 10.05.2018

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
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


Re: entrance.inc - Create interiors easily - Pottus - 10.05.2018

Код:
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.