Trasladar esto ????
#1

Buenas, he pensando en como trasladar esto a MYSQL R39, el cargado es Y_INI, y bueno no se me ocurre como hacerlo, lo de las cuentas si lo hice se me hizo fбcil, porque en el dialogo de ingreso busca la tabla del jugador del jugador y despuйs mando a cargar los datos, pero con los negocios no se me ocurre como hacerlo, asн es ¬¬

Код:
OnGamemodeInit..

CargarNegocios();

stock CargarNegocios()
{
	new str_negocios[40], negocio = 0, neg = 0;
	while(negocio < MAX_NEGOCIOS)
	{
		format(str_negocios, 64, "/Negocios/%i.ini", negocio);
		if(fexist(str_negocios))
		{
			INI_ParseFile(str_negocios, "CargarNegocio_%s", .bExtra = true, .extra = negocio);
			InformacionNegocio[negocio][nPickup] = CreateDynamicPickup(1272, 1, InformacionNegocio[negocio][nExtX], InformacionNegocio[negocio][nExtY], InformacionNegocio[negocio][nExtZ], InformacionNegocio[negocio][nWorldExt]);
            ActualizarLabelNegocio(negocio);
			neg++;
		}
		negocio ++;
	}
	if(neg) printf("%d Negocios Cargados", neg);
	return 1;
}
CALLBACK: CargarNegocio_data(negid, name[], value[])
{///////// Esto acб, o sea cargar los datos de la tabla lo se hacer, pero como acceder a la tabla no, no se si me entiende, con tal de que modifiquen arriba el cуdigo para cargar los datos del negocio esto lo harй yo.
	INI_Int("Dueno", InformacionNegocio[negid][nDueno]);
	INI_Int("Precio", InformacionNegocio[negid][nPrecio]);
	INI_String("NombreDueno", InformacionNegocio[negid][nNombreDueno], 24);
	INI_Int("Tipo", InformacionNegocio[negid][nTipo]);
	INI_Int("Estado", InformacionNegocio[negid][nEstado]);
	INI_Int("CajaFuerte", InformacionNegocio[negid][nCajaFuerte]);
	INI_Int("PrecioEntrada", InformacionNegocio[negid][nPrecioEntrada]);
	INI_Float("ExtX", InformacionNegocio[negid][nExtX]);
	INI_Float("ExtY", InformacionNegocio[negid][nExtY]);
	INI_Float("ExtZ", InformacionNegocio[negid][nExtZ]);
	INI_Float("ExtA", InformacionNegocio[negid][nExtA]);
	INI_Float("IntX", InformacionNegocio[negid][nIntX]);
	INI_Float("IntY", InformacionNegocio[negid][nIntY]);
	INI_Float("IntZ", InformacionNegocio[negid][nIntZ]);
	INI_Float("IntA", InformacionNegocio[negid][nIntA]);
	INI_Int("InteriorExt", InformacionNegocio[negid][nInteriorExt]);
	INI_Int("WorldExt", InformacionNegocio[negid][nWorldExt]);
	INI_Int("InteriorInt", InformacionNegocio[negid][nInteriorInt]);
	INI_Int("WorldInt", InformacionNegocio[negid][nWorldInt]);
	return 1;
}
Reply
#2

Nose si solo se crea el Pickup y Label, en caso de ser asi, creo que seria el siguiente codigo:
PHP код:
stock CargarNegocios()
{
    new 
query[256],neg 0;
    
mysql_query(mysql,"SELECT * FROM TABLA_NEGOCIOS");
    while(
neg cache_num_rows())
    {
        
InformacionNegocio[neg][nExtX] = cache_get_field_content_float(neg,"nExtX");
        
InformacionNegocio[neg][nExtY] = cache_get_field_content_float(neg,"nExtY");
        
InformacionNegocio[neg][nExtZ] = cache_get_field_content_float(neg,"nExtZ");
        
//etc
        
InformacionNegocio[neg][nPickup] = CreateDynamicPickup(12721InformacionNegocio[negocio][nExtX], InformacionNegocio[negocio][nExtY], InformacionNegocio[negocio][nExtZ], InformacionNegocio[negocio][nWorldExt]
        
neg++;
    }
    if(
negprintf("%d Negocios Cargados",neg);
    return 
1;

No entendi mucho, pero espero averte dado una idea por lo menos.
Reply
#3

Quote:
Originally Posted by mcreed
Посмотреть сообщение
Nose si solo se crea el Pickup y Label, en caso de ser asi, creo que seria el siguiente codigo:
PHP код:
stock CargarNegocios()
{
    new 
query[256],neg 0;
    
mysql_query(mysql,"SELECT * FROM TABLA_NEGOCIOS");
    while(
neg cache_num_rows())
    {
        
InformacionNegocio[neg][nExtX] = cache_get_field_content_float(neg,"nExtX");
        
InformacionNegocio[neg][nExtY] = cache_get_field_content_float(neg,"nExtY");
        
InformacionNegocio[neg][nExtZ] = cache_get_field_content_float(neg,"nExtZ");
        
//etc
        
InformacionNegocio[neg][nPickup] = CreateDynamicPickup(12721InformacionNegocio[negocio][nExtX], InformacionNegocio[negocio][nExtY], InformacionNegocio[negocio][nExtZ], InformacionNegocio[negocio][nWorldExt]
        
neg++;
    }
    if(
negprintf("%d Negocios Cargados",neg);
    return 
1;

No entendi mucho, pero espero averte dado una idea por lo menos.
Muchas gracias hombre.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)