04.04.2016, 23:13
Cuando compras un negocio, o le asignas un interior no actualiza siempre dirб que esta en venta el negocio...
Ejemplo asн es cuando lo compras, EnVenta 0 es que el negocio esta en venta, y EnVenta 1 es que esta comprado...
Код:
stock ActualizarLabelNegocio(n)/* Actualizar label del negocio */
{
new string[300], Direccion[MAX_ZONE_NAME];
Get2DZone(Direccion, MAX_ZONE_NAME, InformacionNegocio[n][nExtX],InformacionNegocio[n][nExtY],InformacionNegocio[n][nExtZ]);
if(InformacionNegocio[n][nEnVenta] == 1)
{
if(InformacionNegocio[n][nPrecioEntrada])
{
format(string,sizeof(string),"%s\n\nDueсo: %s\nDirecciуn: %s %d\nEntrada: $%d\n\nPresiona [F]",
TipoNegocio(n), InformacionNegocio[n][nPropietario], Direccion, n, InformacionNegocio[n][nPrecioEntrada]);
}
else
{
format(string,sizeof(string),"%s\n\nDueсo: %s\nDirecciуn: %s %d\n\nPresiona [F]",
TipoNegocio(n), InformacionNegocio[n][nPropietario], Direccion, n);
}
}
else
{
format(string,sizeof(string),"%s\n\nЎNegocio en Venta!\nDirecciуn: %s %d\nPrecio: $%d\n\nЎMбs informaciуn /ayuda negocios!\n\nPresiona [F]",
TipoNegocio(n), Direccion, n, InformacionNegocio[n][nPrecio]);
}
Negocio[n] = CreateDynamic3DTextLabel(string, COLOR_GRIS, InformacionNegocio[n][nExtX], InformacionNegocio[n][nExtY], InformacionNegocio[n][nExtZ], 7.0);
return 1;
}
Код:
CMD:comprar(playerid, params[])
{
new nombre[12];
if(sscanf(params, "s[12]", nombre)) return SendClientMessage(playerid, COLOR_NARANJA, "* /comprar [Opciуn]");
if(strcmp(nombre,"negocio",true) == 0)
{
new id = EstaEnExteriorNegocio(playerid);
new Nombre[MAX_PLAYER_NAME];
GetPlayerName(playerid,Nombre,sizeof(Nombre));
if(id == -1 || id == 0) return SendClientMessage(playerid, COLOR_GRIS, "Info: "#CROSA"[!]"#CGRIS2" No estбs cerca de un negocio");
if(InformacionNegocio[id][nEnVenta] != 0 || InformacionNegocio[id][nPrecio] == 0) return SendClientMessage(playerid, COLOR_GRIS, "Info: "#CROSA"[!]"#CGRIS2" Este negocio no estб en venta.");
if(Informacion[playerid][pNegocioID] != 0) return SendClientMessage(playerid, COLOR_GRIS, "Info: "#CROSA"[!]"#CGRIS2" Ya tienes un negocio.");
if(GetPlayerMoney(playerid) < InformacionNegocio[id][nPrecio]) return SendClientMessage(playerid, COLOR_GRIS, "Info: "#CROSA"[!]"#CGRIS2" No tienes suficiente dinero para comprar este negocio.");
Informacion[playerid][pNegocioID] = id;
DarDinero(playerid, -InformacionNegocio[id][nPrecio]);
InformacionNegocio[id][nEstado] = 0;
InformacionNegocio[id][nEnVenta] = 1;
InformacionNegocio[id][nPropietario] = Nombre;
SendClientMessage(playerid, COLOR_GRIS, "Bien hecho! has comprado un negocio");
GuardarNegocio(playerid);
}
return 1;
}


