[Pedido]Adicionar Pedagios
#1

Adc + Pedбgios pra mim ? ...
Код:
#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;
}
Esse Sao as novas coisas que tem qe adc :

Код:
MovePlayerObject(968, -3.599609375, -1365.8994140625, 10.769999504089, 0, 341.99993896484, 305.99673461914); //Cancela Aberta
MovePlayerObject(968, -23.5, -1344.8994140625, 10.969999313354, 0, 337.99993896484, 307.99618530273); //Cancela Aberta
MovePlayerObject(968, -1517, -818.599609375, 58.400001525879, 0, 22, 83.995727539063); //Cancela Aberta
MovePlayerObject(968, -1513.099609375, -818.8994140625, 58.950000762939, 0, 345.99993896484, 79.996917724609); //Cancela Aberta



                        MovePlayerObject(i, Cancela[i][2], -1513.0999755859, -819, 58.200000762939, 0.0001, 0, 0, 80);//Cancela fechada
                        MovePlayerObject(i, Cancela[i][3], -1517, -818.5, 57.599998474121, 0.0001, 0, 0, 263.99981689453);//Cancela fechada
                        MovePlayerObject(i, Cancela[i][4], -23.60000038147, -1344.8000488281, 10, 0.0001, 0, 0, 308);//Cancela fechada
                        MovePlayerObject(i, Cancela[i][5], -3.7000000476837, -1365.8000488281, 9.8000001907349, 0.0001, 0, 0, 306);//Cancela fechada




    CreatePlayerObject(playerid, 977, -792.29998779297, 497, 1368, 0, 0, 10);
    CreatePlayerObject(playerid, 4641, -9.8000001907349, -1360.8000488281, 11.5, 0, 0, 218);
    CreatePlayerObject(playerid, 966, -3.7000000476837, -1365.8000488281, 9.8000001907349, 0, 0, 306);
    CreatePlayerObject(playerid, 970, -2.4000000953674, -1367.6999511719, 10.300000190735, 0, 0, 306);
    CreatePlayerObject(playerid, 4641, -21.299999237061, -1345.4000244141, 11.60000038147, 0, 0, 40);
    CreatePlayerObject(playerid, 966, -23.60000038147, -1344.8000488281, 10, 0, 0, 308);
    CreatePlayerObject(playerid, 1424, -28.5, -1338.4000244141, 10.5, 0, 0, 308);
    CreatePlayerObject(playerid, 4641, -1514.3000488281, -811.79998779297, 59.799999237061, 0, 8, 172);
    CreatePlayerObject(playerid, 4641, -1516.5, -825.70001220703, 59.700000762939, 0, 352, 350);
    CreatePlayerObject(playerid, 966, -1513.0999755859, -819, 58.200000762939, 0, 0, 80);
    CreatePlayerObject(playerid, 966, -1517, -818.5, 57.599998474121, 0, 0, 263.99981689453);
    CreatePlayerObject(playerid, 970, -1515, -818.79998779297, 58.299999237061, 0, 352, 350);
    CreatePlayerObject(playerid, 979, -1522.4000244141, -806.5, 57.400001525879, 0, 10, 172);
    CreatePlayerObject(playerid, 979, -1516.5999755859, -807.40002441406, 58.299999237061, 0, 8, 172);
    CreatePlayerObject(playerid, 997, -1512.1999511719, -808.09997558594, 58.299999237061, 0, 0, 262);
    CreatePlayerObject(playerid, 997, -1514.6999511719, -826.79998779297, 58.400001525879, 0, 0, 260);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)