Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define sleep2(%0); for(new _@%0; _@%0 != (%0*50000000);) (_@%0++); //By. Rjjj
- new ViaFacil[MAX_PLAYERS];
- new bool:Pedagio[MAX_PLAYERS] = {false, ...};
- new Cancela[MAX_PLAYERS][2];
- public OnFilterScriptInit() {
- print(" ");
- print(" » Via Fácil By. Paulo « ");
- print(" ");
- Create3DTextLabel("Compre aqui o seu plano Via Fácil - /viafacil", 0xFFFFFFFF, 60.1402,-1533.1696,5.2082, 10 ,0);
- SetTimer("CheckViaFacil", 100, true);
- return 1;
- }
- public OnFilterScriptExit() {
- return 1;
- }
- public OnPlayerConnect(playerid) {
- CreatePlayerObject(playerid, 8168, 55.97, -1532.31, 6.07, 0.00, 0.00, 8.00);
- CreatePlayerObject(playerid, 966, 56.05, -1528.62, 3.93, 0.00, 0.00, 262.00);
- CreatePlayerObject(playerid, 966, 56.05, -1535.86, 3.93, 0.00, 0.00, 82.00);
- Cancela[playerid][0] = CreatePlayerObject(playerid, 968, 56.05, -1528.62, 4.67, 0.00, 270.00, 262.00);
- Cancela[playerid][1] = CreatePlayerObject(playerid, 968, 56.05, -1535.82, 4.71, 0.00, 90.00, 262.00);
- Pedagio[playerid] = false;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason) {
- for(new i; i != 5; i++) DestroyPlayerObject(playerid, i);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[]) {
- if(!strcmp(cmdtext, "/viafacil", true)) {
- if(IsPlayerInRangeOfPoint(playerid, 2, 60.1402, -1533.1696, 5.2082)) {
- new string[] = "Plano 1 - 10 Pass R$ 1.000,00\nPlano 2 - 20 Pass R$ 1.900,00\nPlano 3 - 30 Pass R$ 2.800,00\nPlano 4 - 50 Pass R$ 5.000,00\nPlano 5 - 100 Pass R$ 9.000,00";
- ShowPlayerDialog(playerid, 5416, DIALOG_STYLE_LIST, "Plano - Via Fácil", string, "Comprar", "Fechar");
- } else SendClientMessage(playerid, 0xFF0000FF, "ERRO - Você não está no pedágio.");
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
- if(dialogid == 5416) {
- if(response) {
- switch(listitem) {
- case 0: {
- SendClientMessage(playerid, 0xFFFFFFFF, "Você comprou 10 Pass Via Fácil!");
- ViaFacil[playerid] += 10;
- GivePlayerMoney(playerid, -1000);
- } case 1: {
- SendClientMessage(playerid, 0xFFFFFFFF, "Você comprou 20 Pass Via Fácil!");
- ViaFacil[playerid] += 20;
- GivePlayerMoney(playerid, -1900);
- } case 2: {
- SendClientMessage(playerid, 0xFFFFFFFF, "Você comprou 30 Pass Via Fácil!");
- ViaFacil[playerid] += 30;
- GivePlayerMoney(playerid, -2800);
- } case 3: {
- SendClientMessage(playerid, 0xFFFFFFFF, "Você comprou 50 Pass Via Fácil!");
- ViaFacil[playerid] += 50;
- GivePlayerMoney(playerid, -5000);
- } case 4: {
- SendClientMessage(playerid, 0xFFFFFFFF, "Você comprou 100 Pass Via Fácil!");
- ViaFacil[playerid] += 100;
- GivePlayerMoney(playerid, -9000);
- }
- }
- }
- }
- return 1;
- }
- forward CheckViaFacil();
- public CheckViaFacil() {
- for(new i; i != GetMaxPlayers(); i++) {
- if(IsPlayerConnected(i)) {
- if(IsPlayerInAnyVehicle(i)) {
- if(IsPlayerInRangeOfPoint(i, 5.0, 56.05, -1528.62, 4.67)) {
- if(ViaFacil[i] && !Pedagio[i]) {
- Pedagio[i] = true; //Evitar Flood
- if(GetPlayerState(i) == PLAYER_STATE_DRIVER) {
- SendClientMessage(i, 0xFFFFFFFF, "Via Fácil: Você possui o plano Via Fácil e não precisa parar! Boa Viagem.");
- ViaFacil[i] --;
- }
- MovePlayerObject(i, Cancela[i][0], 56.05, -1528.62, 4.67+0.0001, 0.0001, 0.0000, 0.0000, 262.0000);
- }
- if(!ViaFacil[i] && !Pedagio[i]) {
- Pedagio[i] = true; //Evitar Flood
- if(GetPlayerState(i) == PLAYER_STATE_DRIVER) {
- SendClientMessage(i, 0xFFFFFFFF, "Via Fácil: Você não possui o plano Via Fácil e precisa parar!");
- TogglePlayerControllable(i, false);
- sleep2(3);
- TogglePlayerControllable(i, true);
- GivePlayerMoney(i, -500);
- }
- MovePlayerObject(i, Cancela[i][0], 56.05, -1528.62, 4.67+0.0001, 0.0001, 0.0000, 0.0000, 262.0000);
- }
- } else if(IsPlayerInRangeOfPoint(i, 5.0, 56.05, -1535.82, 4.71)) {
- if(ViaFacil[i] && !Pedagio[i]) {
- Pedagio[i] = true; //Evitar Flood
- if(GetPlayerState(i) == PLAYER_STATE_DRIVER) {
- SendClientMessage(i, 0xFFFFFFFF, "Via Fácil: Você possui o plano Via Fácil e não precisa parar! Boa Viagem.");
- ViaFacil[i] --;
- }
- MovePlayerObject(i, Cancela[i][1], 56.05, -1535.82, 4.71+0.0001, 0.0001, 0.0000, 0.0000, 262.0000);
- } else if(!ViaFacil[i] && !Pedagio[i]) {
- Pedagio[i] = true; //Evitar Flood
- if(GetPlayerState(i) == PLAYER_STATE_DRIVER) {
- SendClientMessage(i, 0xFFFFFFFF, "Via Fácil: Você não possui o plano Via Fácil e precisa parar!");
- TogglePlayerControllable(i, false);
- sleep2(3);
- TogglePlayerControllable(i, true);
- GivePlayerMoney(i, -500);
- }
- MovePlayerObject(i, Cancela[i][1], 56.05, -1535.82, 4.71+0.0001, 0.0001, 0.0000, 0.0000, 262.0000);
- }
- }
- else {
- if(Pedagio[i]) {
- Pedagio[i] = false;
- MovePlayerObject(i, Cancela[i][0], 56.05, -1528.62, 4.67, 0.0001, 0.0000, 270.0000, 262.0000);
- MovePlayerObject(i, Cancela[i][1], 56.05, -1535.82, 4.71, 0.0001, 0.0000, 90.0000, 262.0000);
- }
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement