21.04.2012, 12:40
Bem, eu tou editando o BVO e me deparei com um bug na concessionaria.
outras pessoas tem o mesmo (https://sampforum.blast.hk/showthread.php?tid=336075).
Quando faзo /comprarcarro aparece dialogs mas quando clico nelas elas nao dao, e quando carrego para digitar o id do veiculo nao me aparece nada.
outras pessoas tem o mesmo (https://sampforum.blast.hk/showthread.php?tid=336075).
Quando faзo /comprarcarro aparece dialogs mas quando clico nelas elas nao dao, e quando carrego para digitar o id do veiculo nao me aparece nada.
pawn Код:
}
if(strcmp(cmd, "/comprarcarro", true) == 0)
{
if(IsPlayerInConcePlace(playerid))
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(Conce[i]==1)
{
SendClientMessage(playerid, COLOR_OOC, "Jб tem Alguem sendo Atendido, volte daqui a pouco!");
TogglePlayerControllable(playerid, 1);
return 1;
}
}
if (GetOwnedVehicleID(playerid) != INVALID_VEHICLE_ID) return SendClientMessage(playerid, RED, "Vocк Ja Possui Um Veiculo!");
if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, RED, "Saia de seu interior"); // To prevent screw ups
GetPlayerPos(playerid, OrgX[playerid], OrgY[playerid], OrgZ[playerid]);
new color1 = CarColor[playerid][0];
new color2 = CarColor[playerid][1];
TogglePlayerControllable(playerid, 0);
SetPlayerCameraPos(playerid, -1980.9927,293.0207,38.9285);
SetPlayerCameraLookAt(playerid, -1971.9277,284.5396,34.8777);
SetPlayerVirtualWorld(playerid, playerid);
if(IsPlayerInTaxiLS(playerid))
{
SetPlayerCameraPos(playerid, 1432.7231,-1665.6484,13.3828);
SetPlayerCameraLookAt(playerid, 1436.6174,-1666.0939,13.5469);
SetPlayerPos(playerid,1448.3098,-1665.8339,13.2680);
ShopCar[playerid] = CreateVehicle(CarModels[0], 1438.3098,-1665.8339,13.2680, 0.0, color1, color2, 6000000);
}
if(IsPlayerInTaxiLV(playerid))
{
SetPlayerCameraPos(playerid, 2039.2286,1917.5132,12.1674);
SetPlayerCameraLookAt(playerid, 2034.1730,1917.0808,12.1785);
SetPlayerPos(playerid,2042.5013,1916.6371,11.9750);
ShopCar[playerid] = CreateVehicle(CarModels[0], 2032.5013,1916.6371,11.9750, 0.0, color1, color2, 6000000);
}
if(IsPlayerInTaxiSF(playerid))
{
SetPlayerCameraPos(playerid, -1990.3564,257.4485,35.1719);
SetPlayerCameraLookAt(playerid, -1985.4454,257.3991,35.1719);
SetPlayerPos(playerid,-1993.9315,257.6205,34.8931);
ShopCar[playerid] = CreateVehicle(CarModels[0], -1983.9315,257.6205,34.8931, 0.0, color1, color2, 6000000);
}
SetVehicleVirtualWorld(ShopCar[playerid], playerid);
PutPlayerInVehicle(playerid, ShopCar[playerid], 0);
TogglePlayerControllable(playerid, 0);
CarShopping[playerid] = true;
Conce[playerid] = 1;
new gt[128];
format(gt, sizeof gt, "Veiculo: %s Valor: %d", VehicleName[carbrowse[playerid]],CarModels[carbrowse[playerid]]);
ShowPlayerDialog(playerid, 138, DIALOG_STYLE_LIST, gt, "Modelo Anterior\nModelo Seguinte\nDigitar ID Veiculo\nComprar Veiculo\nCancelar Compra", "Escolher", "");
}
else
{
SendClientMessage(playerid, BRANCO, "Vocк presisa estar na concessionбria");
}
return 1;
}
if(dialogid == 138)
{
if(response)
{
new color1 = CarColor[playerid][0];
new color2 = CarColor[playerid][1];
if(listitem == 0)// Modelo Anterior
{
carbrowse[playerid]--;
if (carbrowse[playerid] < 51) carbrowse[playerid] = 0;
DestroyVehicle(ShopCar[playerid]);
if(IsPlayerInTaxiLS(playerid))
{
SetPlayerPos(playerid,1448.3098,-1665.8339,13.2680);
ShopCar[playerid] = CreateVehicle(CarModels[carbrowse[playerid]], 1438.3098,-1665.8339,13.2680, 0.0, color1, color2, 6000000);
}
if(IsPlayerInTaxiLV(playerid))
{
SetPlayerPos(playerid,2042.5013,1916.6371,11.9750);
ShopCar[playerid] = CreateVehicle(CarModels[carbrowse[playerid]], 2032.5013,1916.6371,11.9750, 0.0, color1, color2, 6000000);
}
if(IsPlayerInTaxiSF(playerid))
{
SetPlayerPos(playerid,-1993.9315,257.6205,34.8931);
ShopCar[playerid] = CreateVehicle(CarModels[carbrowse[playerid]], -1983.9315,257.6205,34.8931, 0.0, color1, color2, 6000000);
}
SetVehicleVirtualWorld(ShopCar[playerid], playerid);
PutPlayerInVehicle(playerid, ShopCar[playerid], 0);
TogglePlayerControllable(playerid, false);
new gt[128];
format(gt, sizeof gt, "Veiculo: %s Valor: %d", VehicleName[carbrowse[playerid]],CarModels[carbrowse[playerid]]);
ShowPlayerDialog(playerid, 138, DIALOG_STYLE_LIST, gt, "Modelo Anterior\nModelo Seguinte\nDigitar ID Veiculo\nComprar Veiculo\nCancelar Compra", "Escolher", "");
return 1;
}
if(listitem == 1)// Modelo Seguinte
{
carbrowse[playerid]++;
if (carbrowse[playerid] > 51) carbrowse[playerid] = 0;
DestroyVehicle(ShopCar[playerid]);
if(IsPlayerInTaxiLS(playerid))
{
SetPlayerPos(playerid,1448.3098,-1665.8339,13.2680);
ShopCar[playerid] = CreateVehicle(CarModels[carbrowse[playerid]], 1438.3098,-1665.8339,13.2680, 0.0, color1, color2, 6000000);
}
if(IsPlayerInTaxiLV(playerid))
{
SetPlayerPos(playerid,2042.5013,1916.6371,11.9750);
ShopCar[playerid] = CreateVehicle(CarModels[carbrowse[playerid]], 2032.5013,1916.6371,11.9750, 0.0, color1, color2, 6000000);
}
if(IsPlayerInTaxiSF(playerid))
{
SetPlayerPos(playerid,-1993.9315,257.6205,34.8931);
ShopCar[playerid] = CreateVehicle(CarModels[carbrowse[playerid]], -1983.9315,257.6205,34.8931, 0.0, color1, color2, 6000000);
}
SetVehicleVirtualWorld(ShopCar[playerid], playerid);
PutPlayerInVehicle(playerid, ShopCar[playerid], 0);
TogglePlayerControllable(playerid, false);
new gt[128];
format(gt, sizeof gt, "Veiculo: %s Valor: %d", VehicleName[carbrowse[playerid]],CarModels[carbrowse[playerid]]);
ShowPlayerDialog(playerid, 138, DIALOG_STYLE_LIST, gt, "Modelo Anterior\nModelo Seguinte\nDigitar ID Veiculo\nComprar Veiculo\nCancelar Compra", "Escolher", "");
return 1;
}
if(listitem == 2)// Digitar ID do Modelo
{
ShowPlayerDialog(playerid, 139, DIALOG_STYLE_INPUT, "Concessionaria!", "Digite o ID do Veiculo Desejado!", "Verificar", "Voltar");
return 1;
}
if(listitem == 3)// Comprar Modelo
{
new vehicleid = GetPlayerVehicleID(playerid);
if (GetPlayerMoneyEx(playerid) >= GetVehicleCost(vehicleid))
{
strmid(VehicleInfo[vehicleid][vOwner], GetName(playerid), 0, strlen(GetName(playerid)), MAX_PLAYER_NAME);
GivePlayerMoneyEx(playerid, -GetVehicleCost(vehicleid));
TogglePlayerControllable(playerid, true);
CarShopping[playerid] = false;
carbrowse[playerid] = 0;
new texto[128];
format(texto, sizeof texto, "~g~RS ~r~-%d" ,-GetVehicleCost(vehicleid));
GameTextForPlayer(playerid, texto, 1000, 3);
PutPlayerInVehicle(playerid, ShopCar[playerid], 0);
if(IsPlayerInTaxiLS(playerid))
{
SetVehiclePos(vehicleid,1438.3098,-1665.8339,13.2680);
SetVehicleZAngle(vehicleid, 354.3388);
}
if(IsPlayerInTaxiLV(playerid))
{
SetVehiclePos(vehicleid,2032.5013,1916.6371,11.9750);
SetVehicleZAngle(vehicleid, 180.5882);
}
if(IsPlayerInTaxiSF(playerid))
{
SetVehiclePos(vehicleid,-1983.9315,257.6205,34.8931);
SetVehicleZAngle(vehicleid, 180.4159);
}
SetPlayerVirtualWorld(playerid, 0);
SetVehicleVirtualWorld(vehicleid, 0);
Conce[playerid] = 0;
SetCameraBehindPlayer(playerid);
vehicleid = ShopCar[playerid];
VehicleInfo[vehicleid][vModel] = GetVehicleModel(vehicleid);
if(IsPlayerInTaxiLS(playerid))
{
VehicleInfo[vehicleid][vX] = 1438.3098;
VehicleInfo[vehicleid][vY] = -1665.8339;
VehicleInfo[vehicleid][vZ] = 13.2680;
VehicleInfo[vehicleid][vA] = 354.3388;
}
if(IsPlayerInTaxiLV(playerid))
{
VehicleInfo[vehicleid][vX] = 2032.5013;
VehicleInfo[vehicleid][vY] = 1916.6371;
VehicleInfo[vehicleid][vZ] = 11.9750;
VehicleInfo[vehicleid][vA] = 180.5882;
}
if(IsPlayerInTaxiSF(playerid))
{
SetVehiclePos(vehicleid,-1983.9315,257.6205,34.8931);
SetVehicleZAngle(vehicleid, 180.4159);
VehicleInfo[vehicleid][vX] = -1983.9315;
VehicleInfo[vehicleid][vY] = 257.6205;
VehicleInfo[vehicleid][vZ] = 34.8931;
VehicleInfo[vehicleid][vA] = 180.4159;
}
VehicleInfo[vehicleid][vColor1] = CarColor[playerid][0];
VehicleInfo[vehicleid][vColor2] = CarColor[playerid][1];
VehicleInfo[vehicleid][vPaintjob] = -1;
strmid(VehicleInfo[vehicleid][vName], VehicleName[GetVehicleModel(vehicleid)-400], 0, strlen(VehicleName[GetVehicleModel(vehicleid)-400]), 128);
strmid(VehicleInfo[vehicleid][vOwner], GetName(playerid), 0, strlen(GetName(playerid)), MAX_PLAYER_NAME);
VehicleInfo[vehicleid][vPark] = 0;
VehicleInfo[vehicleid][vPX] = 0.0;
VehicleInfo[vehicleid][vPY] = 0.0;
VehicleInfo[vehicleid][vPZ] = 0.0;
VehicleInfo[vehicleid][vPA] = 0.0;
SendClientMessage(playerid, BRANCO, "[AVISO] COMPRA REALIZADA COM SUCESSO, USE /AJUDACARRO , PARA VER SEUS NOVOS COMANDOS!");
Conce[playerid] = 0;
for(new m = 0; m < MAX_MODS; m++) VehicleInfo[vehicleid][vMod][m] = 0;
}
else
{
new mes[64];
format(mes, sizeof mes, "LOJA: Este Veiculo Modelo: %s Esta Custando Ђ %d! Vocк tem Ђ%d , й insuficiente!", VehicleName[carbrowse[playerid]], GetVehicleCost(vehicleid), GetPlayerMoneyEx(playerid));
SendClientMessage(playerid, COLOR_RED, mes);
}
return 1;
}
if(listitem == 4)// Cancelar Compra
{
SendClientMessage(playerid, COLOR_RED, "[AVISO]Compra Cancelada !");
Conce[playerid] = 0;
DestroyVehicle(ShopCar[playerid]);
TogglePlayerControllable(playerid, true);
CarShopping[playerid] = false;
carbrowse[playerid] = 0;
GameTextForPlayer(playerid, " ", 1000, 3);
if(IsPlayerInTaxiLS(playerid))
{
SetPlayerPos(playerid,1438.3098,-1665.8339,13.2680);
SetPlayerFacingAngle(playerid, 354.3388);
}
if(IsPlayerInTaxiLV(playerid))
{
SetPlayerPos(playerid,2032.5013,1916.6371,11.9750);
SetPlayerFacingAngle(playerid, 180.5882);
}
if(IsPlayerInTaxiSF(playerid))
{
SetPlayerPos(playerid,-1983.9315,257.6205,34.8931);
SetPlayerFacingAngle(playerid, 180.4159);
}
SetPlayerVirtualWorld(playerid, 0);
SetCameraBehindPlayer(playerid);
return 1;
}
}
return 1;
}
if(dialogid == 139)
{
if(!response)
{
new gt[128];
format(gt, sizeof gt, "Veiculo: %s Valor: %d", VehicleName[carbrowse[playerid]],CarModels[carbrowse[playerid]]);
ShowPlayerDialog(playerid, 138, DIALOG_STYLE_LIST, gt, "Modelo Anterior\nModelo Seguinte\nDigitar ID Veiculo\nComprar Veiculo\nCancelar Compra", "Escolher", "");
return 1;
}
new id = strval(inputtext);
if (id < 400 || id > 611)
{
SendClientMessage(playerid, RED, "ID Invalido, Selecione Caso queira tentar novamente!");
ShowPlayerDialog(playerid, 139, DIALOG_STYLE_INPUT, "Concessionaria!", "Digite o ID do Veiculo Desejado!", "Verificar", "Voltar");
return 1;
}
new color1 = CarColor[playerid][0];
new color2 = CarColor[playerid][1];
carbrowse[playerid] = id-400;
DestroyVehicle(ShopCar[playerid]);
if(IsPlayerInTaxiLS(playerid))
{
SetPlayerPos(playerid,1448.3098,-1665.8339,13.2680);
ShopCar[playerid] = CreateVehicle(CarModels[carbrowse[playerid]], 1438.3098,-1665.8339,13.2680, 0.0, color1, color2, 6000000);
}
if(IsPlayerInTaxiLV(playerid))
{
SetPlayerPos(playerid,2042.5013,1916.6371,11.9750);
ShopCar[playerid] = CreateVehicle(CarModels[carbrowse[playerid]], 2032.5013,1916.6371,11.9750, 0.0, color1, color2, 6000000);
}
if(IsPlayerInTaxiSF(playerid))
{
SetPlayerPos(playerid,-1993.9315,257.6205,34.8931);
ShopCar[playerid] = CreateVehicle(CarModels[carbrowse[playerid]], -1983.9315,257.6205,34.8931, 0.0, color1, color2, 6000000);
}
SetVehicleVirtualWorld(ShopCar[playerid], playerid);
PutPlayerInVehicle(playerid, ShopCar[playerid], 0);
new gt[128];
format(gt, sizeof gt, "Veiculo: %s Valor: %d", VehicleName[carbrowse[playerid]],CarModels[carbrowse[playerid]]);
ShowPlayerDialog(playerid, 138, DIALOG_STYLE_LIST, gt, "Modelo Anterior\nModelo Seguinte\nDigitar ID Veiculo\nComprar Veiculo\nCancelar Compra", "Escolher", "");
return 1;
}