[Ajuda] Entrar no carro e estar desligado.
#1

Queridos colegas, eu coloquei um Filter-Script de ligar o motor, sу que quando a pessoa entra no carro, ele jб estб ligado.

Como posso fazer para a pessoa entrar no carro jб desligado?

Obrigado desde jб.
Reply
#2

usa isto pra fazer:

nesta callback
https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle

usa

https://sampwiki.blast.hk/wiki/GetVehicleParamsEx

e desliga o motor, depois o cara se quiser que o ligue.
Reply
#3

\/
https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
Reply
#4

Eu jб sei agora que tenho que por na OnPlayerEnterVehicle

Sу nгo sei oq por lб. :S por favor se puderem esclarecer. Sou novato em pawn
Reply
#5

eu fiz parte do code pra vc ver, agr vai na wiki e completa o resto do code...

a logica ja dei pra vc

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    // variaveis que sao precisas, vai na wiki que vc ve quais sao.
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); // obtem os parametros.
    SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective); // desliga o motor.
    return 1;
}
Reply
#6

PT nгo consigo fazer o resto.
Reply
#7

n volto a dar outro code pra vc em mao, prуxima vez estuda se quiser, sua ignorвncia pelo estudo e mt triste

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective); // obtem os parametros.
    SetVehicleParamsEx(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective); // desliga o motor.
    return 1;
}
Reply
#8

Quote:
Originally Posted by PT
Посмотреть сообщение
n volto a dar outro code pra vc em mao, prуxima vez estuda se quiser, sua ignorвncia pelo estudo e mt triste

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective); // obtem os parametros.
    SetVehicleParamsEx(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective); // desliga o motor.
    return 1;
}
Obrigado.
Reply
#9

se for passageiro vai desligar tb rsrsrsrs.
Reply
#10

Ta dando warning.

Код:
C:\Users\windows\Desktop\samp03\gamemodes\BTP.pwn(10070) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:          12564 bytes
Code size:          2583388 bytes
Data size:          8456892 bytes
Stack/heap size:      16384 bytes; estimated max. usage=5422 cells (21688 bytes)
Total requirements:11069228 bytes

1 Warning.
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

		new engine, lights, alarm, doors, bonnet, boot, objective;
	    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective); // obtem os parametros.
    	SetVehicleParamsEx(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective); // desliga o motor.
    	return 1;
        
        new Float:Pos[3];
    	new carid=GetVehicleModel(vehicleid);
		if(carid == 481 || carid == 509 || carid == 510) { }
		else
  {
			if(IsAAztecaCar(vehicleid) && !ispassenger)
			{
		    	if(!IsAAzteca(playerid))
		    	{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й um Azteca!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAOniCar(vehicleid) && !ispassenger)
			{
			    if(!IsAOni(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й um Motorista De Onibus!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAMecCar(vehicleid) && !ispassenger)
			{
			    if(!IsAMec(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й um Mecвnico!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsACVRLCar(vehicleid) && !ispassenger)
			{
		    	if(GetPlayerOrg(playerid) != 19)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й do Comando Vermelho!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsaLosTugasCar(vehicleid) && !ispassenger)
			{
		    	if(GetPlayerOrg(playerid) != 20)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й dos Primeiro Comando da Capital!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsACaminhoneiroCar(vehicleid) && !ispassenger)
			{
		    	if(!IsACaminhoneiro(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й um Caminhoneiro!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAPizzaBoyCar(vehicleid) && !ispassenger)
			{
		    	if(!IsAPizzaBoy(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й um Pizza Boy!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAJornalCar(vehicleid) && !ispassenger)
			{
			    if(!IsAJornal(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й um Repуrter!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsATalCar(vehicleid) && !ispassenger)
			{
			    if(!IsATal(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й do Taliban!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsABallasCar(vehicleid) && !ispassenger)
			{
			    if(!IsABallas(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й dos Ballas!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAVagosCar(vehicleid) && !ispassenger)
			{
			    if(!IsAVagos(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й dos Vagos!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsATaxiCar(vehicleid) && !ispassenger)
			{
			    if(!IsATaxi(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й um Taxista!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAGrooveCar(vehicleid) && !ispassenger)
			{
			    if(!IsAGroove(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й da Groove Street!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAAlCar(vehicleid) && !ispassenger)
			{
			    if(!IsAAl(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й da Al'Qaeda!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAPCCar(vehicleid) && !ispassenger)
			{
			    if(GetPlayerOrg(playerid) != 16)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й da Polнcia Civil!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsASonsCar(vehicleid) && !ispassenger)
			{
			    if(GetPlayerOrg(playerid) != 21)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й dos Sons of Anarchy!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAMayansCar(vehicleid) && !ispassenger)
			{
			    if(GetPlayerOrg(playerid) != 22)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й dos Mayans!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsABOPEsCar(vehicleid) && !ispassenger)
			{
			    if(GetPlayerOrg(playerid) != 2)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й da BOPE!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAinterpolCar(vehicleid) && !ispassenger)
			{
			    if(GetPlayerOrg(playerid) != 23)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й da Interpol!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAPFCar(vehicleid) && !ispassenger)
			{
			    if(GetPlayerOrg(playerid) != 11)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й da Polнcia Federal!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAExCar(vehicleid) && !ispassenger)
			{
			    if(GetPlayerOrg(playerid) != 3)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й do Exйrcito!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsASegCar(vehicleid) && !ispassenger)
			{
			    if(!IsASeg(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й um Seguranзa!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsACopCar(vehicleid) && !ispassenger)
			{
			    if(GetPlayerOrg(playerid) != 1)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й da Polнcia Mнlitar!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAHitCar(vehicleid) && !ispassenger)
			{
			    if(!IsAHit(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й um Hitman!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsABikeCar(vehicleid) && !ispassenger)
			{
			    if(GetPlayerOrg(playerid) != 0)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й um Novato!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
            else if(IsAAdmCar(vehicleid) && !ispassenger)
			{
			    if(!IsAAdm(playerid))
				{
					SendClientMessage(playerid, COR_ADMIN, "Vocк nгo й um Admin");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
					SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAYaCar(vehicleid) && !ispassenger)
			{
			    if(!IsAYa(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й da Mбfia Yakuza!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
  			else if(IsACosaCar(vehicleid) && !ispassenger)
			{
			    if(!IsACosa(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й da Mбfia Cosa Nostra!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
			}
			else if(IsAGOVCar(vehicleid) && !ispassenger)
			{
			    if(!IsAGOV(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й do governo!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
				}
        	}
			else if(IsAnAmbulanceCar(vehicleid) && !ispassenger)
			{
			    if(!IsAAmbu(playerid))
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo й um da SA:MU!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
	         }
	     }
	     else if(!IsAPlane(vehicleid) && !ispassenger)
		 {
			    if(PlayerInfo[playerid][pFlyLic] < 1)
				{
					SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo tem Carteira de Motorista!");
		    	    SendClientMessage(playerid, 0x9E50FFAA, "Para Adquirir Sua Carteira de Motorista Digite /gps Centro de Licencas!");
					GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
			 }
		 }
	     else if(!IsABikeCar(vehicleid) && !ispassenger)
		 {
	    	if(PlayerInfo[playerid][pCarLic] < 1)
			{
		    	SendClientMessage(playerid, 0x9E50FFAA, "Vocк nгo tem Carteira Para Voar!");
		    	SendClientMessage(playerid, 0x9E50FFAA, "Para Adquirir Sua Carteira de Voo Digite /gps Centro de Licencas!");
		    	GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
		    }
	    }
	}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)