[Include] [REL 3] Teleport Engine (3.0) (1 line = 1 teleport)
#1

:: Teleport Engine ::
I'm sorry, I do not speak English. This system began to develop at the end of 2009, then stopped. Not long ago I was again, and I have developed.

Features
  • 3D text embedding
  • Object loader for custom objects
  • Enable/Disable "in-vehicle-teleport" / Enable/Disable "on-foot-teleport" / Enable/Disable "in-vehicle-driver-teleport" / Enable/Disable "rcon-only-teleport"
  • Global teleports
etc.

It's simple:
pawn Code:
#include <teleport>
pawn Code:
CreateTeleport("SF","/sf",-1495.9395,-141.1882,15.0702,315.0674);
Presentation:


How to save teleport in-game? (sscanf2 plugin by ****** is required to use this command!)
pawn Code:
CMD:saveteleport(playerid, params[])
{
    #if !defined MAX_TELEPORT_NAMELEN
        #define MAX_TELEPORT_NAMELEN 32
    #endif
    #if !defined MAX_TELEPORT_CMDLEN
        #define MAX_TELEPORT_CMDLEN 32
    #endif
    new name[MAX_TELEPORT_NAMELEN],command[MAX_TELEPORT_CMDLEN];
    if(sscanf(params, "s[32]s[32]", name, command))
        return SendClientMessage(playerid,0xFFFFFFFF, "Use: /saveteleport [name][command]");
    new File:savedteleports = fopen("savedteleports.txt", io_write);
    if(savedteleports)
    {
        new Float:x, Float:y, Float:z, Float:angle;
        if(IsPlayerInAnyVehicle(playerid))
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            GetVehiclePos(vehicleid,x,y,z);
            GetVehicleZAngle(vehicleid,angle);
        } else {
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,angle);
        }
        new formatstring[256];
        format(formatstring, 256, "CreateTeleport(\"%s\", \"%s\", %.3f, %.3f, %.3f, %.3f);\r\n",
            name, command, x, y, z, angle);
        fwrite(savedteleports, formatstring);
        fclose(savedteleports);
        SendClientMessage(playerid,0xFFFFFFFF, "Teleport saved to savedteleports.txt (in your scriptfiles folder).");
    }
    return 1;
}
Format 3Dtext:
Tags:
{NAME} - Name of teleport
{COMMAND} - Command of teleport
{PRICE} - Price of teleport
{NEWLINE} - New line
{RRGGBB}(samp) - Color of text

Function: Teleport_Set3DTextFormat

Example:
pawn Code:
public OnFilterScriptInit()
{
    new teleportid = CreateTeleport("LS","/ls",1933.2625,-2407.8191,14.2618,183.6625);
    Teleport_Set3DTextFormat(teleportid, "{0522FF}Name: {FFFFFF}{NAME}{NEWLINE}{0522FF}Command: {FFFFFF}{COMMAND}{NEWLINE}{0522FF}Price: {FFFFFF}{PRICE}");
    return 1;
}
(I added this as default format)

Result:


Object loader:

pawn Code:
CreateTeleport("LV","/lv",1655.7760,1594.6162,10.6581,90.4822, .objectloader = true);
pawn Code:
public OnPlayerStartingObjectLoad(playerid, time)
{
    new Float:x, Float:y, Float:z;
    if(IsPlayerInAnyVehicle(playerid))
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        GetVehiclePos(vehicleid,x,y,z);
        SetVehiclePos(vehicleid,x,y,z + 2.8);
     } else {
        GetPlayerPos(playerid,x,y,z);
        SetPlayerPos(playerid,x,y,z + 2.8);
    }
    GameTextForPlayer(playerid, "~r~Objects loading~w~...", 2000, 1);
    return 1;
}
Result:


Callbacks:
  • OnPlayerCallingTeleport
  • OnPlayerFailedTeleport
  • OnPlayerTeleport
  • OnPlayerStartingObjectLoad
  • OnPlayerEndingObjectLoad
Functions:
  • CreateTeleport as Teleport_New
  • DestroyTeleport as Teleport_Remove
  • CountTeleports as Teleport_CountAll
  • GetLittleTeleportID as Teleport_LittleID
  • GetHighestTeleportID as Teleport_HighestID
  • IsActiveTeleport as Teleport_IsActive
  • IsValidTeleport as Teleport_IsValid
  • IsTeleportIsValid3D as Teleport_IsValid3Dtext
  • ToggleTeleport3D as Teleport_Toggle3Dtext
  • TeleportIsUse3D as Teleport_IsUsing3Dtext
  • SetTeleport3DColor as Teleport_SetText3Dcolor
  • GetTeleport3DColor as Teleport_GetText3Dcolor
  • SetTeleport3DDrawDistance as Teleport_Set3DtextDrawDistance
  • GetTeleport3DDrawDistance as Teleport_Get3DtextDeawDistance
  • ToggleTeleportDriverMode as Teleport_ToggleDriverMode
  • IsTeleportDriverMode as Teleport_IsUsingDriverMode
  • ToggleTeleportAdminOnly as Teleport_ToggleAdminOnly
  • IsTeleportAdminOnly as Teleport_IsAdminOnly
  • SetTeleportLoaderTime as Teleport_SetLoaderTime
  • GetTeleportLoaderTime as Teleport_GetLoaderTime
  • ToggleTeleportOnFoot as Teleport_ToggleFoot
  • IsTeleportOnFoot as Teleport_IsUsingFoot
  • ToggleTeleportVehicle as Teleport_ToggleVehicle
  • IsTeleportVehicle as Teleport_IsUsingVehicle
  • ToggleTeleportObjectLoader as Teleport_ToggleObjectLoader
  • IsTeleportObjectLoader as Teleport_IsUsingObjectLoader
  • SetTeleportPrice as Teleport_SetPrice
  • GetTeleportPrice as Teleport_GetPrice
  • SetTeleportPos as Teleport_SetPos
  • GetTeleportPos as Teleport_GetPos
  • SetTeleportInterior as Teleport_SetInterior
  • GetTeleportInterior as Teleport_GetInterior
  • SetTeleportVirtualWorld as Teleport_SetVirtualWorld
  • GetTeleportVirtualWorld as Teleport_GetVirtualWorld
  • SetTeleportName as Teleport_SetName
  • GetTeleportName as Teleport_GetName
  • SetTeleportCommand as Teleport_SetCommand
  • GetTeleportCommand as Teleport_GetCommand
  • DestroyAllTeleport as Teleport_RemoveAll
Download:

REL 3 (PACK)
http://solidfiles.com/d/c3d0b/

And

REL 5 (INC, added 3dtext format):
http://solidfiles.com/d/abb0f/

Thanks to:
  • Incognito - GVar
  • ZeeX - ZCMD
  • Betamaster - Colour
  • Westie - strreplace function
  • ******
PS: if someone can speak English, you really prepare a good description!
Reply
#2

Awesome.

If you can make a better description will be MORE Awesome
Reply
#3

Very useful for the beginner and for who do not want to waste time... I downloaded it and is really well done, and very complete. Nice script man!
Reply
#4

Very usefull!!
10/10
Reply
#5

Nice, but

GetLittleTeleportID as Teleport_LittleID

useless, I think? because it will be 1 always, I think?
Reply
#6

It is not always.

Example:
pawn Code:
public OnFilterScriptInit()
{
    new tele1 = CreateTeleport("SF","/sf",-1495.9395,-141.1882,15.0702,315.0674);
    new tele2 = CreateTeleport("SF2","/sf2",-1495.9395,-141.1882,15.0702,315.0674);
    CreateTeleport("SF3","/sf3",-1495.9395,-141.1882,15.0702,315.0674);
    DestroyTeleport(tele1);
    DestroyTeleport(tele2);
    printf("Little ID: %i",GetLittleTeleportID());
    return 1;
}
But it really does not make much sense.
Reply
#7

awasome
will use!
thanks!
Reply
#8

Very usefull!!
11/10
Reply
#9

amasome 10/10
Reply
#10

Thanks. Added /saveteleport command.
Reply
#11

Update:


Format 3Dtext:
Tags:
{NAME} - Name of teleport
{COMMAND} - Command of teleport
{PRICE} - Price of teleport
{NEWLINE} - New line
{RRGGBB}(samp) - Color of text

Function: Teleport_Set3DTextFormat

Example:
pawn Код:
public OnFilterScriptInit()
{
    new teleportid = CreateTeleport("LS","/ls",1933.2625,-2407.8191,14.2618,183.6625);
    Teleport_Set3DTextFormat(teleportid, "{0522FF}Name: {FFFFFF}{NAME}{NEWLINE}{0522FF}Command: {FFFFFF}{COMMAND}{NEWLINE}{0522FF}Price: {FFFFFF}{PRICE}");
    return 1;
}
(I added this as default format)

Result:
Reply
#12

Nice script
Reply
#13

How to create teleport?
Reply
#14

good job man, a lot of functions +1
Reply
#15

Quote:
Originally Posted by NeyMar96
Посмотреть сообщение
How to create teleport?
?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)