PHP код:
if(strcmp(cmd, "/vcarro", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new vehicleid = GetOwnedVehicleID(playerid);
if (vehicleid == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COR_SV, "Voce nao possui um veiculo");
new typeid = GetVehicleType(vehicleid);
new VehPreco;
if (typeid == VTYPE_CAR)
{
VehPreco = CAR_SELL_COST;
GivePlayerMoney(playerid, CAR_SELL_COST);
}
if (typeid == VTYPE_SPORT)
{
VehPreco = SPORT_SELL_COST;
GivePlayerMoney(playerid, SPORT_SELL_COST);
}
if (typeid == VTYPE_MAV)
{
VehPreco = MAV_SELL_COST;
GivePlayerMoney(playerid, MAV_SELL_COST);
}
if (typeid == VTYPE_HEAVY)
{
VehPreco = TRUCK_SELL_COST;
GivePlayerMoney(playerid, TRUCK_SELL_COST);
}
if (typeid == VTYPE_BIKE)
{
VehPreco = BIKE_SELL_COST;
GivePlayerMoney(playerid, BIKE_SELL_COST);
}
if (typeid == VTYPE_AIR)
{
VehPreco = PLANE_SELL_COST;
GivePlayerMoney(playerid, PLANE_SELL_COST);
}
if (typeid == VTYPE_SEA)
{
VehPreco = BOAT_SELL_COST;
GivePlayerMoney(playerid, BOAT_SELL_COST);
}
if (typeid == VTYPE_MOTORBIKE)
{
VehPreco = MOTORBIKE_SELL_COST;
GivePlayerMoney(playerid, MOTORBIKE_SELL_COST);
}
if (typeid == VTYPE_MISC)
{
VehPreco = MISC_SELL_COST;
GivePlayerMoney(playerid, MISC_SELL_COST);
}
new Istringui[256];
format(Istringui, sizeof(Istringui), "Voce vendeu seu veiculo por R$%i.", VehPreco);
SendClientMessage(playerid, 0xFFFF00FF, Istringui);
VehicleInfo[vehicleid][vLock] = 0;
DeleteVehicle(playerid);
return 1;
}
return 1;
}
//comprar veiculo
if(strcmp(cmd, "/cveh", 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, "Voltar\nProsseguir\nDigitar ID Veiculo\nComprar Veiculo\nCancelar Compra", "Comprar", "");
}
else
{
SendClientMessage(playerid, COR_N, "Voce nao esta na concessionaria");
}
return 1;
}