06.08.2013, 12:40
hi guys,well when i use command nothing happens.
And the message would have bought the car and was successful with the car keys, but it does not
And the message would have bought the car and was successful with the car keys, but it does not
pawn Код:
if(strcmp(cmd, "/comprarcarro", true) == 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))
{
new carro = GetPlayerVehicleID(playerid);//new vehicleid = GetPlayerVehicleID(playerid);
new TCarModel = GetVehicleModel(carro);//new TCarModel = GetVehicleModel(vehicleid);
if(DynamicCars[carro][Sell] == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_MECANICOS, "{FF0000}Comando:{F6F6F6} /comprarcarro");
return 1;
}
for(new c=0;c<MAX_VEHICLES;c++)
{
new valor2 = TCarModel-400;
new price = VehiclePrices[valor2][0]/2;
new ctill = VehiclePrices[valor2][0]/5;
new cprice = price+ctill;
if (price <= GetPlayerEuros(playerid))
{
PlayerActionMessage(playerid,15.0,"entrega um cheque ao gerente do Stand, que dб em troca a chave do carro");
SendClientMessage(playerid, COLOR_YELLOW, "Compraste o carro com sucesso.");
DynamicCars[carro][comprado] = 1;
DynamicCars[carro][Sell] = 0;
GivePlayerEuros(playerid, -cprice);
TogglePlayerControllable(playerid, 1);
if(PlayerInfo[playerid][CarKey1] == 999)
{
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;
}