24.10.2010, 04:29
By DraKiNs
It is a simple and efficient creator teleports,using arrays and dialogs i create.
Using:
To use in:
OnFilterScriptInit
Add:
AddTeleport("Tele Name",X,Y,Z,INTERIOR);
General Infos:
♥ System of Load Object [Not disappear]
♥ System of Message for Teleporte ('[FeK]DraKiNs enter in teleport Las Venturas [/teles]')
♥ Simples Add Teleports
♥ Teleport Vehicles and Players [Detect]
♥ Works on any Interior
♥ In Dialog List,Super Practical
Credits
Crйdits for [FeK]Company and [FeK]DraKiNs (me)
Code:
pawn Код:
#include <a_samp>
#define MAX_TELES 100
#define DIALOG_TELE 24
new strmem[1024];
new TelesCriados=-1;
enum pTele
{
NomeTele[64],
Float:xo,
Float:yo,
Float:zo,
InteriorID,
TeleporteID
};
new TeleporteSystem[MAX_TELES][pTele];
public OnFilterScriptInit()
{
AddTeleport("Aero San Fiero",-1448.325, -325.1149, 15,0);
AddTeleport("Aero Los Santos",1546.908, -2313.5, 15,0);
AddTeleport("Aero Las Venturas",1677.544, 1426.837, 15,0);
printf("\n\n\n\n System of Teleports Loaded | %d/%d teleports total \n\n\n\n",TelesCriados,MAX_TELES);
return true;
}
stock AddTeleport(nomete[], Float:xob, Float:yob, Float:zob,interior)
{
TelesCriados++;
format(TeleporteSystem[TelesCriados][NomeTele],64,"%s",nomete);
TeleporteSystem[TelesCriados][xo] = xob;
TeleporteSystem[TelesCriados][yo] = yob;
TeleporteSystem[TelesCriados][zo] = zob;
TeleporteSystem[TelesCriados][InteriorID] = interior;
TeleporteSystem[TelesCriados][TeleporteID] = TelesCriados;
return ;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new item = listitem;
if(item == TeleporteSystem[item][TeleporteID])
{
if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "You Cancel Teleport");
new message[128];
format(message, sizeof(message), "You is transported for %s wait", TeleporteSystem[item][NomeTele]);
SendClientMessage(playerid, 0xFFFFFFFF, message);
new name[24], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "** %s go to in teleport %s [/teles].",name,TeleporteSystem[item][NomeTele]);
SendClientMessageToAll(0xFFFF00AA, string);
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid),TeleporteSystem[item][xo],TeleporteSystem[item][yo],TeleporteSystem[item][zo]+1);
}
if(!IsPlayerInAnyVehicle(playerid))
{
SetPlayerPos(playerid,TeleporteSystem[item][xo],TeleporteSystem[item][yo],TeleporteSystem[item][zo]+1);
}
TogglePlayerControllable(playerid,0);
SetTimerEx("DescongelarPlayer",1500,false,"i",playerid);
return 1;
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/teles", true))
{
format(strmem, 1024, "");
for(new mem=0;mem<TelesCriados;mem++)
{
format(strmem,1024, "%s%s\n",strmem,TeleporteSystem[mem][NomeTele]);
}
ShowPlayerDialog(playerid,DIALOG_TELE,DIALOG_STYLE_LIST, "List of Teles:",strmem,"Tele", "Exit");
}
return 0;
}
forward DescongelarPlayer(playerid);
public DescongelarPlayer(playerid)
{
TogglePlayerControllable(playerid,1);
return true;
}
Or Pastebin (i Accept new Mirros)
Movie:
[ame]http://www.youtube.com/watch?v=ELr631Pgdbw[/ame]