new VeiculoBBO[6];
SetTimer("EstaNaGarragem", 1000, true);
VeiculoBBO[0] = AddStaticVehicleEx(559,-1990.7375,170.9375,27.1953,270.0000000,0,3,15); //Jester
VeiculoBBO[1] = AddStaticVehicleEx(559,-1990.7375,170.9375,27.1953,270.0000000,0,3,15); //Jester
VeiculoBBO[2] = AddStaticVehicleEx(559,-1991.0796,159.3297,27.1953,270.0000000,0,3,15); //Jester
VeiculoBBO[3] = AddStaticVehicleEx(559,-1991.4545,146.6407,27.1953,270.0000000,0,3,15); //Jester
VeiculoBBO[4] = AddStaticVehicleEx(559,-1991.9436,130.0406,27.1953,270.0000000,0,3,15); //Jester
VeiculoBBO[5] = AddStaticVehicleEx(559,-1992.5179,110.5918,27.1954,270.0000000,0,3,15); //Jester
forward EstaNaGarragem(playerid);
public EstaNaGarragem(playerid)
{
if (IsPlayerInRangeOfPoint(playerid, 10.0, -1943.9894,254.2238,35.1807))
{
if(GetPlayerVehicleID(playerid) == VeiculoBBO[0] || VeiculoBBO[1] || VeiculoBBO[2] || VeiculoBBO[3] || VeiculoBBO[4] || VeiculoBBO[5])
{
DestroyVehicle(VeiculoBBO[0]);
DestroyVehicle(VeiculoBBO[1]);
DestroyVehicle(VeiculoBBO[2]);
DestroyVehicle(VeiculoBBO[3]);
DestroyVehicle(VeiculoBBO[4]);
DestroyVehicle(VeiculoBBO[5]);
} else return SendClientMessage(playerid,0xFF0000FF,"Modelo invбlido!");
} else return SendClientMessage(playerid,0xFF0000FF,"Vocк nгo estб na garagem!");
return 1;
}
ID e modelo nгo sгo a mesma coisa. GetPlayerVehicleID retorna o ID do veнculo. Para obter o modelo, deve-se utilizar GetVehicleModel. Ademais, vocк deve utilizar SetTimerEx, nгo SetTimer.
|
forward EstaNaGarragem(playerid);
public EstaNaGarragem(playerid)
{
if (IsPlayerInRangeOfPoint(playerid, 10.0, -1943.9894,254.2238,35.1807))
{
if(GetVehicleModel(playerid) == VeiculoBBO[0] || VeiculoBBO[1] || VeiculoBBO[2] || VeiculoBBO[3] || VeiculoBBO[4] || VeiculoBBO[5])
{
DestroyVehicle(VeiculoBBO[0]);
DestroyVehicle(VeiculoBBO[1]);
DestroyVehicle(VeiculoBBO[2]);
DestroyVehicle(VeiculoBBO[3]);
DestroyVehicle(VeiculoBBO[4]);
DestroyVehicle(VeiculoBBO[5]);
SendClientMessage(playerid,0xFF0000FF,"Vendido!");
} else return SendClientMessage(playerid,0xFF0000FF,"Modelo invбlido!");
return 1;
}
return 1;
}
Ainda estб indo qualquer veнculo
PHP Code:
|
if(GetVehicleModel(vehicleid)
new VeiculoBBO[6];
SetTimer("EstaNaGarragem", 60000, true);
VeiculoBBO[0] = CreateVehicle(559,-1990.7375,170.9375,27.1953,270.0000000,0,3,15); //Jester-BBO
VeiculoBBO[1] = CreateVehicle(559,-1990.7375,170.9375,27.1953,270.0000000,0,3,15); //Jester-BBO
VeiculoBBO[2] = CreateVehicle(559,-1991.0796,159.3297,27.1953,270.0000000,0,3,15); //Jester-BBO
VeiculoBBO[3] = CreateVehicle(559,-1991.4545,146.6407,27.1953,270.0000000,0,3,15); //Jester-BBO
VeiculoBBO[4] = CreateVehicle(559,-1991.9436,130.0406,27.1953,270.0000000,0,3,15); //Jester-BBO
VeiculoBBO[5] = CreateVehicle(559,-1992.5179,110.5918,27.1954,270.0000000,0,3,15); //Jester-BBO
forward EstaNaGarragem(playerid);
public EstaNaGarragem(playerid)
{
if (IsPlayerInRangeOfPoint(playerid, 10.0, -1943.9894,254.2238,35.1807))
{
if(GetVehicleModel(VeiculoBBO[0] || VeiculoBBO[1] || VeiculoBBO[2] || VeiculoBBO[3] || VeiculoBBO[4] || VeiculoBBO[5]) == 559)
{
DestroyVehicle(VeiculoBBO[0]);
DestroyVehicle(VeiculoBBO[1]);
DestroyVehicle(VeiculoBBO[2]);
DestroyVehicle(VeiculoBBO[3]);
DestroyVehicle(VeiculoBBO[4]);
DestroyVehicle(VeiculoBBO[5]);
SendClientMessage(playerid,0xFF0000FF,"Vendido!");
} else return SendClientMessage(playerid,0xFF0000FF,"Modelo invбlido!");
return 1;
}
return 1;
}
forward EstaNaGarragem(playerid);
public EstaNaGarragem(playerid)
{
if(!IsPlayerInRangeOfPoint(playerid, 10.0, -1943.9894, 254.2238, 35.1807))
return false;
new count = 0;
for(new i = 0; i < sizeof(VeiculoBBO); i++) {
if(IsPlayerInVehicle(playerid, VeiculoBBO[i])) {
DestroyVehicle(VeiculoBBO[i]);
SendClientMessage(playerid, 0xFF0000FF, "Vendido!");
break;
}
count++;
}
return count == sizeof(VeiculoBBO) ? (SendClientMessage(playerid, 0xFF0000FF, "Modelo invбlido!")) : (true);
}
Nгo entendi exatamente o que vocк quer fazer... Mas enfim.
Caso deseja deletar automaticamente, algum dos veнculos criados que se aproximaram de um certo local: PHP Code:
|
O problema й que todos carros funcionam nгo sу os criados VeiculoBBO e quando eu mudo nem um funciona
PHP Code:
|