18.08.2011, 21:35
(
Last edited by GameStar.; 23/08/2011 at 03:34 PM.
)
:: 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
It's simple:
pawn Code:
#include <teleport>
pawn Code:
CreateTeleport("SF","/sf",-1495.9395,-141.1882,15.0702,315.0674);
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;
}
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;
}
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;
}
Callbacks:
- OnPlayerCallingTeleport
- OnPlayerFailedTeleport
- OnPlayerTeleport
- OnPlayerStartingObjectLoad
- OnPlayerEndingObjectLoad
- 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
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
- ******