Good afternoon friends. Finally, I figured out my studies, and I had time. I had an idea to create a subway system. Thanks for mapping Alex69#8343. You can add to this system, or if I have ideas, I will continue to work on it.
let's go
MAPPING Metro and Train - https://drive.google.com/file/d/1WgWjGs7sAKWTlAFKxnKYKVhFwvP-3ziI/view?usp=sharing
let's go
MAPPING Metro and Train - https://drive.google.com/file/d/1WgWjGs7sAKWTlAFKxnKYKVhFwvP-3ziI/view?usp=sharing
- Código:
forward UnFreezePlayer(playerid);
public UnFreezePlayer(playerid){
if(IsPlayerConnected(playerid)){
TogglePlayerControllable(playerid, 1);
}
}
#define COLOR_LIGHTRED 0xFF6347FF
//3dtext Create3DTextLabel("Mapa do Metro\n{FFFFFF}Para comprar uma passagem,\nuse: ALT", 0xFAAC58FF, 1692.8831, -23.0184, 1300.9054, 30.0000, 0, 1);
Create3DTextLabel("Mapa do Metro\n{FFFFFF}Para comprar uma passagem,\nuse: ALT", 0xFAAC58FF, 1680.8910, -23.3724, 1300.9054, 30.0000, 0, 1);
//pickup CreatePickup(19132, 1, 1752.4963,-1894.1082,13.5568, -1);
CreateDynamic3DTextLabel("{FD0000}[Metro]\n{ffffff}Pressione alt para entrar no metro", -1, 1752.4963,-1894.1082,13.5568, 6.0);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == 1024)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1752.4958,-1894.0975,13.5568))
{
ShowPlayerDialog(playerid, 4444, DIALOG_STYLE_LIST, "Metro | Tem certeza de que deseja entrar",
"Sim\n\
Nao", "Selecionar", "Cancelar");
}
}
if(newkeys == 1024)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1692.8831, -23.0184, 1300.9054))
{
ShowPlayerDialog(playerid, 9320, DIALOG_STYLE_LIST, "Escolha o seu destino de viagem",
"{FD0000}[LS]{FFFFFF} Estacao Los Santos\n\
{FD0000}[SF]{FFFFFF} Estacao San Fierro","Selecionar", "Cancelar viagem");
}
}
if(newkeys == 1024)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1680.8910, -23.3724, 1300.9054))
{
ShowPlayerDialog(playerid, 9320, DIALOG_STYLE_LIST, "Escolha o seu destino de viagem",
"{FD0000}[LS]{FFFFFF} Estacao Los Santos\n\
{FD0000}[SF]{FFFFFF} Estacao San Fierro","Selecionar", "Cancelar viagem");
}
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 4444:
{
if(response)
{
switch(listitem)
{
case 0:
{
SetPlayerPos(playerid, 1687.706177, -19.841034, 1300.905396);
SetPlayerInterior(playerid, 12);
}
case 1:
{
return true;
}
}
}
}
case 9320:
{
if(response)
{
if(PlayerInfo[playerid][pMoney] < 1000) return SendClientMessage(playerid, COLOR_LIGHTRED, "Para a viagem voce precisa de 1.000$!");
{
switch(listitem)
{
case 0:
{
// GiveMoney(playerid, -1000);
SetPlayerPos(playerid, 3585.4797,542.0457,1519.5316);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("UnFreezePlayer", 2*1000, false, "i", playerid);
SendClientMessage(playerid, COLOR_LIGHTRED, "[Expedidor]{FFFFFF} Voce entrou no metro, espere 10 segundos!");
SetTimerEx("Metro",10000,false,"i",playerid);
}
case 1:
{
// GiveMoney(playerid, -1000);
SetPlayerPos(playerid, 3585.4797,542.0457,1519.5316);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("UnFreezePlayer", 2*1000, false, "i", playerid);
SendClientMessage(playerid, COLOR_LIGHTRED, "[Expedidor]{FFFFFF} Voce entrou no metro, espere 10 segundos!");
SetTimerEx("Metro1",10000,false,"i",playerid);
}
}
}
}
}
}
}
forward Metro(playerid);
public Metro(playerid)
{
SetPlayerPos(playerid, 1754.4196,-1893.9037,13.5569);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_LIGHTRED, "[Expedidor]{FFFFFF} Atencao passageiros, chegamos ao nosso destino.!");
return 1;
}
forward Metro1(playerid);
public Metro1(playerid)
{
SetPlayerPos(playerid, -1968.6771,111.5668,27.6875);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_LIGHTRED, "[Expedidor]{FFFFFF} Atencao passageiros, chegamos ao nosso destino.!");
return 1;
}