31.01.2019, 16:25
Boa tarde, eu criei um sistema para quando o player entrar em um carro e ele nгo for de determinada profissгo, ele й removido, criei de 2 profissхes e deu certo, quando criei a terceira nгo deu. Alguйm me ajuda aew.
Codigos:
Codigos:
PHP код:
new CarroJornal[14];
forward IsJornalCar(playerid);
PHP код:
CarroJornal[0] = CreateVehicle(510, 1673.2, -1720.7, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (1)
CarroJornal[1] = CreateVehicle(510, 1670.9, -1720.8, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (2)
CarroJornal[2] = CreateVehicle(510, 1668.6, -1720.9, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (3)
CarroJornal[3] = CreateVehicle(510, 1666.3, -1721.0, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (4)
CarroJornal[4] = CreateVehicle(510, 1663.9, -1721.1, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (5)
CarroJornal[5] = CreateVehicle(510, 1661.9, -1721.2, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (6)
CarroJornal[6] = CreateVehicle(510, 1659.5, -1721.3, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (7)
CarroJornal[7] = CreateVehicle(510, 1657.1, -1721.4, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (8)
CarroJornal[8] = CreateVehicle(510, 1654.9, -1721.4, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (9)
CarroJornal[9] = CreateVehicle(510, 1652.8, -1721.4, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (10)
CarroJornal[10] = CreateVehicle(510, 1650.7, -1721.5, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (11)
CarroJornal[11] = CreateVehicle(510, 1648.4, -1721.5, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (12)
CarroJornal[12] = CreateVehicle(510, 1646.1, -1721.6, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (13)
CarroJornal[13] = CreateVehicle(510, 1644.1, -1721.5, 20.2, 0.0, 95, 10, 400); // vehicle (Mountain Bike) (14)
PHP код:
public IsJornalCar(playerid)
{
for(new c = 0; c <= 14; c++)
{
if(IsPlayerInVehicle(playerid, CarroJornal[c]) && Player[playerid][pProf] != 2)
{
SendClientMessage(playerid, CorErro, "|ERRO| Esse veiculo й exclusivo dos Entregadores de Jornal!");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
return 1;
}
PHP код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER) IsJornalCar(playerid);
return 1;
}