new carromerc[4];
new carroag[4];
forward VerificarVeiculo(playerid);
publico OnGameModeInt()
{
//----------------------CARROS-MERCENARIOS--------------------------------//
carromerc[0] = AddStaticVehicle(560,2490.5359,-1682.1979,13.3366,85.2275,3,3);
carromerc[1] = AddStaticVehicle(560,2499.7915,-1659.5117,13.3632,87.3975,3,3);
carromerc[2] = AddStaticVehicle(522,2515.0867,-1671.7433,13.6626,72.6940,82.2873,3,1);
carromerc[3] = AddStaticVehicle(413,2473.4294,-1698.2968,13.5178,358.7467,0,0);
//------------------------CARROS-AGENTES----------------------------------//
carroag[0] = AddStaticVehicle(490,734.0862,-1263.0913,13.5587,270.7794,0,0);
carroag[1] = AddStaticVehicle(470,734.8358,-1269.2036,13.5534,266.7061,0,0);
carroag[2] = AddStaticVehicle(522,729.0718,-1255.9518,13.5552,266.7060,0,0);
carroag[3] = AddStaticVehicle(487,766.9335,-1261.9794,13.5738,85.9344,0,0);
return 1;
}
public VerificarVeiculo(playerid)
{
//----------------Blockeio-carros-mercenarios-----------------------------//
for(new m = 0; m <= 4; m++)
{
if(IsPlayerInVehicle(playerid, carromerc[m] || Org[playerid] == Agente))
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo faz parte da gangue dos Mercenбrios!");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
//----------------Blockeio-carros-Agentes---------------------------------//
for(new a = 0; a <= 4; a++)
{
if(IsPlayerInVehicle(playerid, carroag[a] || Org[playerid] == Mercenario))
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo faz parte dos Agentes Anti-Mercenбrios!");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
return 1;
}
{
if(newstate == PLAYER_STATE_DRIVER) VerificarVeiculo(playerid);
return 1;
}
if(IsPlayerInVehicle(playerid, carromerc[m] || Org[playerid] == Agente)) return SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo faz parte da gangue dos Mercenбrios!") && RemovePlayerFromVehicle(playerid);
Tente fazer assim, exemplo:
PHP код:
|
if(IsPlayerInVehicle(playerid, carromerc[m]) && Org[playerid] == Agente)
if(newstate == PLAYER_STATE_DRIVER) return VerificarVeiculo(playerid);
public VerificarVeiculo(playerid)
{
new VeiculoID = GetPlayerVehicleID(playerid); // pega o id do veiculo
for(new a = 0; a < sizeof(carromerc); a++)
{
if(VeiculoID == carromerc[a] && Org[playerid] != Mercenario) // ! Se org nгo for igual Mercenario
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo faz parte da gangue dos Mercenбrios!");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
for(new b = 0; b < sizeof(carroag); b++)
{
if(VeiculoID == carroag[b] && Org[playerid] != Agente) //! Se org nгo for igual Agente
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo faz parte dos Agentes Anti-Mercenбrios!");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
return 1;
}