Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define aerols 544 // ID DIALOG
- #define aerolstolv 545 // ID DIALOG
- #define aerolstosf 546 // ID DIALOG
- #define aerolv 547 // ID DIALOG
- #define aerolvtols 548 // ID DIALOG
- #define aerolvtosf 549 // ID DIALOG
- #define aerosf 550 // ID DIALOG
- #define aerosftolv 551 // ID DIALOG
- #define aerosftols 552 // ID DIALOG
- #define COR_VERDE 0x33AA33AA // cor
- #define COR_LARANJA 0xFF9933AA // cor
- #define COLOR_RED 0xAA3333AA // cor
- #define COR_AMARELO 0xFFFF00AA // cor
- #define passagemlv 500 //preço da passagem para las aventura
- #define passagemsf 600 //preço da passagem para sf
- #define passagemls 350 //preço passagem para los santos
- #define tempo123 20 //tempo da viagem em segundos
- new destino[MAX_PLAYERS];//variavel pra cetar o destino
- new tempoviagem[MAX_PLAYERS];//variavel pra definir o tempo
- new tempoviagem2[MAX_PLAYERS];//variavel pra definir o tempo
- new Text:tempoprachegada[MAX_PLAYERS];//textdraw do tempo
- new texto[200];//string
- new texto2[128]; //string
- forward viagem(playerid);//public
- ////////////////////////////////////////////////////////////////////////////////
- public OnGameModeInit()
- {
- //Pickups aeroportos
- CreatePickup(1239, 1,1642.1678,-2334.5310,13.5469, 0);
- Create3DTextLabel("Aeroporto Los Santos\n Digite /menu", COR_VERDE,1642.1678,-2334.5310,13.5469, 40, 0, 0);
- CreatePickup(1239, 1,1664.0167,1423.1956,10.7898, 0);
- Create3DTextLabel("Aeroporto Las Anvetura\n Digite /menu", COR_VERDE,1664.0167,1423.1956,10.7898, 40, 0, 0);
- CreatePickup(1239, 1,-1421.6619,-287.8079,14.1484, 0);
- Create3DTextLabel("Aeroporto San Fierro\n Digite /menu", COR_VERDE,-1421.6619,-287.8079,14.1484, 40, 0, 0);
- return 1;
- }
- ////////////////////////////////////////////////////////////////////////////////
- public OnPlayerConnect(playerid)
- {
- tempoprachegada[playerid] = TextDrawCreate(10.0,200.0," ");
- SetPlayerMapIcon(playerid, 22, 1663.1836,1423.4958, 10.7959, 5, 1);//Aeroporto Las aventura
- SetPlayerMapIcon(playerid, 23, 1642.2249,-2335.2783,13.5469, 5, 1);//Aeroporto Los santos
- SetPlayerMapIcon(playerid, 24, -1421.4926,-287.3825,14.1484, 5, 1);//Aeroporto San Fierro
- return 1;
- }
- ////////////////////////////////////////////////////////////////////////////////
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/menu", cmdtext, true, 10) == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid,3.0,1642.1678,-2334.5310,13.5469))//Aeropoto los santos
- {
- format(texto, sizeof(texto), "Las Aventura $%d \n San fierro $%d", passagemlv,passagemsf);
- ShowPlayerDialog(playerid, aerols, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- return 1;
- }
- if(IsPlayerInRangeOfPoint(playerid,3.0,1664.0167,1423.1956,10.7898))//Aeroporto las aventura
- {
- format(texto, sizeof(texto), "Los Santos $%d \n San fierro $%d", passagemls,passagemsf);
- ShowPlayerDialog(playerid, aerolv, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- return 1;
- }
- if(IsPlayerInRangeOfPoint(playerid,3.0,-1421.6619,-287.8079,14.1484))//Aeropoto san fierro
- {
- format(texto, sizeof(texto), "Los Santos $%d \nLas Aventura $%d",passagemls,passagemlv);
- ShowPlayerDialog(playerid, aerosf, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- return 1;
- }
- return 1;
- }
- return 0;
- }
- ////////////////////////////////////////////////////////////////////////////////
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == aerosf)
- {
- if(response)// They pressed the first button.
- {
- switch(listitem)// Checking which listitem was selected
- {
- case 0:// The first item listed
- {
- format(texto, sizeof(texto), "Preço $%d",passagemls);
- ShowPlayerDialog(playerid, aerosftols, DIALOG_STYLE_MSGBOX, "Destino: Los Santos", texto, "Comfirmar", "Cancelar");
- }
- case 1: // The second item listed
- {
- format(texto, sizeof(texto), "Preço $%d",passagemlv);
- ShowPlayerDialog(playerid, aerosftolv, DIALOG_STYLE_MSGBOX, "Destino: Las Aventura", texto, "Comfirmar", "Cancelar");
- }
- }
- }
- }
- //------------------------------------------------------------------------------
- if(dialogid == aerosftols)
- {
- if(response)
- {
- if(GetPlayerMoney(playerid)>=passagemls)
- {
- SendClientMessage(playerid, COR_LARANJA,"Passagem comprada com sucesso.Boa Viagem!");
- destino[playerid] =1;
- GivePlayerMoney(playerid,passagemls);
- //função public viagem
- SetPlayerPos(playerid,1.808619,32.384357,1199.593750);
- SetPlayerInterior(playerid,1);
- GameTextForPlayer(playerid, "~b~Viagem", 3000, 1);
- SendClientMessage(playerid,COR_AMARELO,"=======================================================");
- format(texto2, sizeof(texto2), "Voce acabou de embarcar. Voce cherara em %d segundos. ",tempo123);
- SendClientMessage(playerid, COR_VERDE,texto2);
- tempoviagem[playerid] = tempo123;
- tempoviagem2[playerid] = SetTimerEx("viagem", 1000, true, "i", playerid);
- } else{
- SendClientMessage(playerid, COLOR_RED,"Voce nao tem dinheiro suficiente.");
- format(texto, sizeof(texto), "Los Santos $%d \nLas Aventura $%d",passagemls,passagemlv);
- ShowPlayerDialog(playerid, aerosf, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- else
- {
- format(texto, sizeof(texto), "Los Santos $%d \nLas Aventura $%d",passagemls,passagemlv);
- ShowPlayerDialog(playerid, aerosf, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- //------------------------------------------------------------------------------
- if(dialogid == aerosftolv)
- {
- if(response)
- {
- if(GetPlayerMoney(playerid)>=passagemlv)
- {
- SendClientMessage(playerid, COR_LARANJA,"Passagem comprada com sucesso.Boa Viagem!");
- destino[playerid] =2;
- GivePlayerMoney(playerid,-passagemlv);
- //função public viagem
- SetPlayerPos(playerid,1.808619,32.384357,1199.593750);
- SetPlayerInterior(playerid,1);
- GameTextForPlayer(playerid, "~b~Viagem", 3000, 1);
- SendClientMessage(playerid,COR_AMARELO,"=======================================================");
- format(texto2, sizeof(texto2), "Voce acabou de embarcar. Voce cherara em %d segundos. ",tempo123);
- SendClientMessage(playerid, COR_VERDE,texto2);
- tempoviagem[playerid] = tempo123;
- tempoviagem2[playerid] = SetTimerEx("viagem", 1000, true, "i", playerid);
- } else{
- SendClientMessage(playerid, COLOR_RED,"Voce nao tem dinheiro suficiente.");
- format(texto, sizeof(texto), "Los Santos $%d \nLas Aventura $%d",passagemls,passagemlv);
- ShowPlayerDialog(playerid, aerosf, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- else
- {
- format(texto, sizeof(texto), "Los Santos $%d \nLas Aventura $%d",passagemls,passagemlv);
- ShowPlayerDialog(playerid, aerosf, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- //==============================================================================
- if(dialogid == aerolv)
- {
- if(response)// They pressed the first button.
- {
- switch(listitem)// Checking which listitem was selected
- {
- case 0:// The first item listed
- {
- format(texto, sizeof(texto), "Preço: $%d",passagemls);
- ShowPlayerDialog(playerid, aerolvtols, DIALOG_STYLE_MSGBOX, "Destino: Los Santos", texto, "Comfirmar", "Cancelar");
- }
- case 1: // The second item listed
- {
- format(texto, sizeof(texto), "Preço: $%d",passagemsf);
- ShowPlayerDialog(playerid, aerolvtosf, DIALOG_STYLE_MSGBOX, "Destino: San Fierro", texto, "Comfirmar", "Cancelar");
- }
- }
- }
- }
- //------------------------------------------------------------------------------
- if(dialogid == aerolvtols)
- {
- if(response)
- {
- if(GetPlayerMoney(playerid)>=passagemls)
- {
- SendClientMessage(playerid, COR_LARANJA,"Passagem comprada com sucesso.Boa Viagem!");
- destino[playerid] =1;
- GivePlayerMoney(playerid,-passagemls);
- //função public viagem
- SetPlayerPos(playerid,1.808619,32.384357,1199.593750);
- SetPlayerInterior(playerid,1);
- GameTextForPlayer(playerid, "~b~Viagem", 3000, 1);
- SendClientMessage(playerid,COR_AMARELO,"=======================================================");
- format(texto2, sizeof(texto2), "Voce acabou de embarcar. Voce cherara em %d segundos. ",tempo123);
- SendClientMessage(playerid, COR_VERDE,texto2);
- tempoviagem[playerid] = tempo123;
- tempoviagem2[playerid] = SetTimerEx("viagem", 1000, true, "i", playerid);
- } else{
- SendClientMessage(playerid, COLOR_RED,"Voce nao tem dinheiro suficiente.");
- format(texto, sizeof(texto), "Los Santos $%d \n San fierro $%d", passagemls,passagemsf);
- ShowPlayerDialog(playerid, aerolv, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- else
- {
- format(texto, sizeof(texto), "Los Santos $%d \n San fierro $%d", passagemls,passagemsf);
- ShowPlayerDialog(playerid, aerolv, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- //------------------------------------------------------------------------------
- if(dialogid == aerolvtosf)
- {
- if(response)
- {
- if(GetPlayerMoney(playerid)>=passagemsf)
- {
- SendClientMessage(playerid, COR_LARANJA,"Passagem comprada com sucesso.Boa Viagem!");
- destino[playerid] =3;
- GivePlayerMoney(playerid,-passagemsf);
- //função public viagem
- SetPlayerPos(playerid,1.808619,32.384357,1199.593750);
- SetPlayerInterior(playerid,1);
- GameTextForPlayer(playerid, "~b~Viagem", 3000, 1);
- SendClientMessage(playerid,COR_AMARELO,"=======================================================");
- format(texto2, sizeof(texto2), "Voce acabou de embarcar. Voce cherara em %d segundos. ",tempo123);
- SendClientMessage(playerid, COR_VERDE,texto2);
- tempoviagem[playerid] = tempo123;
- tempoviagem2[playerid] = SetTimerEx("viagem", 1000, true, "i", playerid);
- } else{
- SendClientMessage(playerid, COLOR_RED,"Voce nao tem dinheiro suficiente.");
- format(texto, sizeof(texto), "Los Santos $%d \n San fierro $%d", passagemls,passagemsf);
- ShowPlayerDialog(playerid, aerolv, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- else
- {
- format(texto, sizeof(texto), "Los Santos $%d \n San fierro $%d", passagemls,passagemsf);
- ShowPlayerDialog(playerid, aerolv, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- //==============================================================================
- if(dialogid == aerols)
- {
- if(response)// They pressed the first button.
- {
- switch(listitem)// Checking which listitem was selected
- {
- case 0:// The first item listed
- {
- format(texto, sizeof(texto), "Preço $%d",passagemlv);
- ShowPlayerDialog(playerid, aerolstolv, DIALOG_STYLE_MSGBOX, "Destino: Las Aventura", texto, "Comfirmar", "Cancelar");
- }
- case 1: // The second item listed
- {
- format(texto, sizeof(texto), "Preço $%d",passagemsf);
- ShowPlayerDialog(playerid, aerolstosf, DIALOG_STYLE_MSGBOX, "Destino: San Fierro", texto, "Comfirmar", "Cancelar");
- }
- }
- }
- }
- //------------------------------------------------------------------------------
- if(dialogid == aerolstolv)
- {
- if(response)
- {
- if(GetPlayerMoney(playerid)>=passagemlv)
- {
- SendClientMessage(playerid, COR_LARANJA,"Passagem comprada com sucesso.Boa Viagem!");
- destino[playerid] =2;
- GivePlayerMoney(playerid,-passagemlv);
- //função public viagem
- SetPlayerPos(playerid,1.808619,32.384357,1199.593750);
- SetPlayerInterior(playerid,1);
- GameTextForPlayer(playerid, "~b~Viagem", 3000, 1);
- SendClientMessage(playerid,COR_AMARELO,"=======================================================");
- format(texto2, sizeof(texto2), "Voce acabou de embarcar. Voce cherara em %d segundos. ",tempo123);
- SendClientMessage(playerid, COR_VERDE,texto2);
- tempoviagem[playerid] = tempo123;
- tempoviagem2[playerid] = SetTimerEx("viagem", 1000, true, "i", playerid);
- } else{
- SendClientMessage(playerid, COLOR_RED,"Voce nao tem dinheiro suficiente.");
- format(texto, sizeof(texto), "Las Aventura $%d \n San fierro $%d", passagemlv,passagemsf);
- ShowPlayerDialog(playerid, aerols, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- else
- {
- format(texto, sizeof(texto), "Las Aventura $%d \n San fierro $%d", passagemlv,passagemsf);
- ShowPlayerDialog(playerid, aerols, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- //------------------------------------------------------------------------------
- if(dialogid == aerolstosf)
- {
- if(response)
- {
- if(GetPlayerMoney(playerid)>=passagemsf)
- {
- SendClientMessage(playerid, COR_LARANJA,"Passagem comprada com sucesso.Boa Viagem!");
- destino[playerid] =3;
- GivePlayerMoney(playerid,-passagemsf);
- //função public viagem
- SetPlayerPos(playerid,1.808619,32.384357,1199.593750);
- SetPlayerInterior(playerid,1);
- GameTextForPlayer(playerid, "~b~Viagem", 3000, 1);
- SendClientMessage(playerid,COR_AMARELO,"=======================================================");
- format(texto2, sizeof(texto2), "Voce acabou de embarcar. Voce cherara em %d segundos. ",tempo123);
- SendClientMessage(playerid, COR_VERDE,texto2);
- tempoviagem[playerid] = tempo123;
- tempoviagem2[playerid] = SetTimerEx("viagem", 1000, true, "i", playerid);
- } else{
- SendClientMessage(playerid, COLOR_RED,"Voce nao tem dinheiro suficiente.");
- format(texto, sizeof(texto), "Las Aventura $%d \n San fierro $%d", passagemlv,passagemsf);
- ShowPlayerDialog(playerid, aerols, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- else
- {
- format(texto, sizeof(texto), "Las Aventura $%d \n San fierro $%d", passagemlv,passagemsf);
- ShowPlayerDialog(playerid, aerols, DIALOG_STYLE_LIST, "Escolha seu destino:",texto,"Comprar", "Cancelar");
- }
- }
- return 1;
- }
- ////////////////////////////////////////////////////////////////////////////////
- public viagem(playerid)
- {
- tempoviagem[playerid] --;
- new tipico[40];
- format(tipico, sizeof(tipico), "Chegada: %d segundos", tempoviagem[playerid]);
- TextDrawSetString(tempoprachegada[playerid], tipico);
- TextDrawShowForPlayer(playerid, tempoprachegada[playerid]);
- if(tempoviagem[playerid] == 0)
- {
- KillTimer(tempoviagem2[playerid]);
- SendClientMessage(playerid, 0xFFFFFFAA, "Sua viagem acabou!");
- TextDrawHideForPlayer(playerid, tempoprachegada[playerid]);
- if(destino[playerid] ==1 )//los santos
- {
- SetPlayerPos(playerid,1640.2815,-2331.0742,13.5469);
- SetPlayerInterior(playerid,0);
- GameTextForPlayer(playerid, "~b~Los Santos", 3000, 1);
- }
- if(destino[playerid] ==2) //las aventura
- {
- SetPlayerPos(playerid,1669.4399,1423.8954,10.7817);
- SetPlayerInterior(playerid,0);
- GameTextForPlayer(playerid, "~b~Las Aventura", 3000, 1);
- }
- if(destino[playerid] ==3)//san fierro
- {
- SetPlayerPos(playerid,-1424.2064,-289.9511,14.1484);
- SetPlayerInterior(playerid,0);
- GameTextForPlayer(playerid, "~b~San Fierro", 3000, 1);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement