23.07.2013, 20:24
(
Последний раз редактировалось caoraivoso3; 26.07.2013 в 13:46.
)
done
if (GetPlayerEuros(playerid) >= price)
if (strcmp("/comprarcarro", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][CarKey1] == 999 || PlayerInfo[playerid][CarKey2] == 999 || PlayerInfo[playerid][CarKey3] == 999 || PlayerInfo[playerid][CarKey4] == 999 || PlayerInfo[playerid][CarKey5] == 999 || PlayerInfo[playerid][CarKey6] == 999)
{
if(IsPlayerInAnyVehicle(playerid)) //ve se o jogador estб dentro do carro
{
new carro = GetPlayerVehicleID(playerid);
new TCarModel = GetVehicleModel(carro);
if(DynamicCars[carro][Sell] == 1) // ve se o carro estб б venda ou nгo
{
for(new c=0;c<MAX_VEHICLES;c++)
{
new valor2 = TCarModel-400;
new price = VehiclePrices[valor2][0]/2; //reduz o preзo de venda
new ctill = VehiclePrices[valor2][0]/5; //msm coisa
new cprice = price+ctill; //so,ma os preзos
if (price <= GetPlayerEuros(playerid)) //realmente,nгo sei
{
PlayerActionMessage(playerid,15.0,"paga a quantia ao ladrao de carro e pega nas chaves");
SendClientMessage(playerid, COLOR_YELLOW, "Compraste o carro com sucesso,cuidado com os cops.");
DynamicCars[carro][comprado] = 1; //torna o carro jб com dono
DynamicCars[carro][Sell] = 0; //torna o carro fora de venda
GivePlayerEuros(playerid, -cprice); //penso que retira o dinheiro
TogglePlayerControllable(playerid, 0); //o player pode voltar a mexer-se
if(PlayerInfo[playerid][CarKey1] == 999) // se a chave numero 1 estiver a 999,ele adiciona a chave do carro
{
PlayerInfo[playerid][CarKey1] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
else if(PlayerInfo[playerid][CarKey2] == 999)
{
PlayerInfo[playerid][CarKey2] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
else if(PlayerInfo[playerid][CarKey3] == 999)
{
PlayerInfo[playerid][CarKey3] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
else if(PlayerInfo[playerid][CarKey4] == 999)
{
PlayerInfo[playerid][CarKey4] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
else if(PlayerInfo[playerid][CarKey5] == 999)
{
PlayerInfo[playerid][CarKey5] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
else if(PlayerInfo[playerid][CarKey6] == 999)
{
PlayerInfo[playerid][CarKey6] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
SaveDynamicCars();
OnPlayerDataSave(playerid);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "ERRO: Nгo tens dinheiro!");
}
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "ERRO: Jб tens carros sufecientes!");
}
return 1;
}
if (strcmp("/comprarcarro", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][CarKey1] == 999 || PlayerInfo[playerid][CarKey2] == 999 || PlayerInfo[playerid][CarKey3] == 999 || PlayerInfo[playerid][CarKey4] == 999 || PlayerInfo[playerid][CarKey5] == 999 || PlayerInfo[playerid][CarKey6] == 999)
{
if(IsPlayerInAnyVehicle(playerid)) //ve se o jogador estб dentro do carro
{
new carro = GetPlayerVehicleID(playerid);
new TCarModel = GetVehicleModel(carro);
if(DynamicCars[carro][Sell] == 1) // ve se o carro estб б venda ou nгo
{
for(new c=0;c<MAX_VEHICLES;c++)
{
new valor2 = TCarModel-400;
new price = VehiclePrices[valor2][0]/2; //reduz o preзo de venda
new ctill = VehiclePrices[valor2][0]/5; //msm coisa
new cprice = price+ctill; //so,ma os preзos
if (price <= GetPlayerEuros(playerid)) //realmente,nгo sei
{
PlayerActionMessage(playerid,15.0,"paga a quantia ao ladrao de carro e pega nas chaves");
SendClientMessage(playerid, COLOR_YELLOW, "Compraste o carro com sucesso,cuidado com os cops.");
DynamicCars[carro][comprado] = 1; //torna o carro jб com dono
DynamicCars[carro][Sell] = 0; //torna o carro fora de venda
GivePlayerEuros(playerid, -cprice); //penso que retira o dinheiro
TogglePlayerControllable(playerid, 0); //o player pode voltar a mexer-se
if(PlayerInfo[playerid][CarKey1] == 999) // se a chave numero 1 estiver a 999,ele adiciona a chave do carro
{
PlayerInfo[playerid][CarKey1] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
else if(PlayerInfo[playerid][CarKey2] == 999)
{
PlayerInfo[playerid][CarKey2] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
else if(PlayerInfo[playerid][CarKey3] == 999)
{
PlayerInfo[playerid][CarKey3] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
else if(PlayerInfo[playerid][CarKey4] == 999)
{
PlayerInfo[playerid][CarKey4] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
else if(PlayerInfo[playerid][CarKey5] == 999)
{
PlayerInfo[playerid][CarKey5] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
else if(PlayerInfo[playerid][CarKey6] == 999)
{
PlayerInfo[playerid][CarKey6] = c+1;
DynamicCars[c][Multas] = 0;
DynamicCars[c][Licenca] = 0;
}
SaveDynamicCars();
OnPlayerDataSave(playerid);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "ERRO: Nгo tens dinheiro!");
}
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "ERRO: Jб tens carros sufecientes!");
}
return 1;
}